PDA

View Full Version : <IMAGE_HEIGHT2>


Ubbe
12-19-2006, 06:32 PM
Hi all, i just wanted to hear if somebody could help me, what i want to do is create a new tag that for instance is called <IMAGE_HEIGHT2>, this tag will contain the original height minus 30 px..

so if <IMAGE_HEIGHT> is 400px
<IMAGE_HEIGHT2> will be 370px

would it be possible to make a quick addon that would allow this new tag?

Ubbe
12-19-2006, 06:46 PM
MUAHAHAA i figured it out.. if anybody wants to use this for whatever reason its quite simple this is how i did:

at this place in index.php

$image_width = $image_extra['0'];
$image_height = $image_extra['1'];
$tpl = str_replace("<IMAGE_WIDTH>",$image_width,$tpl);
$tpl = str_replace("<IMAGE_HEIGHT>",$image_height,$tpl);

i just added $image_height2 and the replace tag.

$image_width = $image_extra['0'];
$image_height = $image_extra['1'];
$image_height2 = $image_height - 30;
$tpl = str_replace("<IMAGE_WIDTH>",$image_width,$tpl);
$tpl = str_replace("<IMAGE_HEIGHT>",$image_height,$tpl);
$tpl = str_replace("<IMAGE_HEIGHT2>",$image_height2,$tpl);

Dennis
12-20-2006, 06:11 AM
Remember you have to implement this hack again when the core files are updated.

GeoS
12-20-2006, 06:48 AM
That is why this hack would be good to place in the simple addon.

Ubbe
12-21-2006, 08:58 PM
Yeah i just need to figure out how to do addons, i haven't really tried it yet so...

Dennis
12-22-2006, 04:38 PM
$image_height2 = $image_height - 30;
$tpl = str_replace("<IMAGE_HEIGHT2>",$image_height2,$tpl);


well you could drop this in a php file and in the addon's folder and it works. To make it nicer you can use these:

These are displayed in a users admin panel under addons:
$addon_name
$addon_description
$addon_version

Ubbe
12-27-2006, 10:32 PM
thanks alot, i thought it was more complicated, but i'm glad to see its not.. i think i'll start working on a admin panel of some sort so you can easily add more properties from the admin panel.