|
#1
|
|||
|
|||
|
grabbing the image width - help!
just wondering if there is a way to grab the image width.. was looking at index.php and noticed there is something about image width's with the thumbnails but i dont know php well enough to really figure out what is going on or where those vars are coming from... looking to grab the image width of the main image on display and put that width into a css width field... i know enough to know how to create the var and use the converting func to make a tag (i.e. <IMAGE_WIDTH> but i just dont know how to grab the actual width... any help will be appreciated.. thanks!
horix - galexkeene.wornpath.net |
|
#2
|
||||
|
||||
|
Look for around line 135 in main index.php file
It should be a $image_notes... thing there. After that, add Code:
list($main_image_width,$main_image_height,$type,$attr) = getimagesize("images/$image_name");
$tpl = ereg_replace("<MAIN_IMAGE_WIDTH>",$main_image_width,$tpl);
$tpl = ereg_replace("<MAIN_IMAGE_HEIGHT>",$main_image_height,$tpl);
// punk
__________________
icq: 66760929 |
|
#3
|
|||
|
|||
|
i put in that code, but its not working... i put the tag in the page just as text, to test it out and instead of a number its outputting an e with an accent on it... i guess its using the number as a character code instead of just being a number? wondering where the formatting is wrong here.. thanks for the help!
|
|
#4
|
||||
|
||||
|
I would guess you need to zap some gremlins
![]() When copy/pasting from the web invisible stuff comes along. Open it up in whatever texteditor you use, notepad, bbedit or the likes, and look for invisible and weird characters and delete them. // punk
__________________
icq: 66760929 |
|
#5
|
|||
|
|||
|
nope.. looks clean to me... reuploaded just to make sure... and now my site is broken... :-\
|
|
#6
|
||||
|
||||
|
If your site is broken I would still guess there are some funkyness with invisible characters.
Can you send me a .zip of your index.php file? punk [at] pixelpunk.se // pixel
__________________
icq: 66760929 |
|
#7
|
|||
|
|||
|
TROUBLE TOO
The replace part is working, but the it's not replacing with the right info. Keep getting odd things entered into the tags. here are some samples.
Code:
width="" height="" width="" height="*" width="" height="" |
|
#8
|
|||
|
|||
|
Hey... I PM'd punk about this and he went and fixed the problem, here is the correct code:
Code:
list($image_width,$image_height,$imtype,$imattr) = getimagesize("images/$image_name");
$img_width = $image_width;
$tpl = ereg_replace("<IMAGE_WIDTH>","$img_width",$tpl);
|
|
#9
|
|||
|
|||
|
Money
There you go! that did it.
Thank you both |
| Post Reply |
| Thread Tools | |
|
|