Help tweeking the <img> tag code.

gdesanto

Joined: 2002-10-04
Posts: 8
Posted: Fri, 2002-10-04 17:51

Well, I'm not a PHP guy, but i've been looking for a way to change the dimensions of the thumbnail displayed by the random-block... as have a few other people here I've noticed after reading the posts...

Well, I tracked down the code responsible and could use some help..

if (isset($index)) {
$id = $album->getPhotoId($index);

echo ""
."<a href=" .makeAlbumUrl($album->fields["name"], $id) .">"
.$album->getThumbnailTag($index)
."</a>";

the .$album->getThumbnailTag($index) is responsible for generating the <IMG> tag for the picture. The problem is that this call generates not only the <img> tag, but also the height, width, and border attributes within that tag.

What I've done is this, and I'm not sure if this is a viable solution..

if (isset($index)) {
$id = $album->getPhotoId($index);
$photocode = $album->getThumbnailTag($index);

echo ""
."<a href=" .makeAlbumUrl($album->fields["name"], $id) .">"
.$photocode
."</a>";

This $photocode variable now represents the following code

<img src=http://www.thedesantos.com/media/albums/album06/aaj.thumb.jpg width=125 height=84 border=0>

Now I need to find a way to evaluate the string, and drop off everthing after the ".jpg", unfotunately I can't search for .jpg, cause what if its a movie, or gif, or another type of image file...

Any of the PHP people out there have any ideas on how this could be done?

Greg DeSanto

 
jackal

Joined: 2002-10-01
Posts: 2
Posted: Mon, 2002-10-07 15:48

This is exactly the thing I need to do..... anyone can help?

 
joerg
joerg's picture

Joined: 2002-10-12
Posts: 77
Posted: Sat, 2002-10-12 16:51

Hi,

I think we can combine that with this <!-- BBCode Start --><A HREF="http://gallery.menalto.com/modules.php?op=modload&amp;name=phpBB_14&amp;file=index&amp;action=viewtopic&amp;topic=930&amp;1" TARGET="_blank">thread</A><!-- BBCode End -->. OK?

Joerg