Lionel
08-21-2005, 01:19 AM
My thumbnails are 200 wide by default as they display in a table at left of the post itself. Now that's too big to display on the newspage right? I also needed to display geeks images being pulled with the news module.
Here is what I did.
In the news.php module, right after
if ($attachment['hasthumbnail'] AND $vboptions['attachthumbs'] AND
($newsforumperms["$news[forumid]"] & CANGETATTACHMENT))
{
I put:
$image="http://www.yoursite.com/forums/attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&stc=
1&thumb=1";
$size = getimagesize("$image");
$height = $size[1];
$width = "$size[0]";
if ($newscount==1)
{
$imgw = round($width) * .50;
$imgh = round($height) * .50;
}
else
{
$imgw = round($width) * .40;
$imgh = round($height) * .40;
}
$imgsize = "width=\"$imgw\" height=\"$imgh\"";
You must put the full url of your site as getimagesize is pulling from database.
Then I replaced the eval
eval('$news[\'attachment\'] .= "' . fetch_template('postbit_attachmentthumbnail')
with
eval('$news[\'attachment\'] .= "' . fetch_template('postbit_attachmentthumbnailportal')
I copied the postbit_attachmentthumbnail into a new template named 'postbit_attachmentthumbnailportal'. In the new template, right before the src in <img src= I did <img $imgsize src=
Notice that I have a if ($newscount==1) in php code? That's for my needs, it creates the thumb bigger for first news item and smaller for subsequent ones. Play with .50 and .40 to your desired size, or simply omit the if ($newscount==1) statement to make all of them the same size.
Here is what I did.
In the news.php module, right after
if ($attachment['hasthumbnail'] AND $vboptions['attachthumbs'] AND
($newsforumperms["$news[forumid]"] & CANGETATTACHMENT))
{
I put:
$image="http://www.yoursite.com/forums/attachment.php?$session[sessionurl]attachmentid=$attachment[attachmentid]&stc=
1&thumb=1";
$size = getimagesize("$image");
$height = $size[1];
$width = "$size[0]";
if ($newscount==1)
{
$imgw = round($width) * .50;
$imgh = round($height) * .50;
}
else
{
$imgw = round($width) * .40;
$imgh = round($height) * .40;
}
$imgsize = "width=\"$imgw\" height=\"$imgh\"";
You must put the full url of your site as getimagesize is pulling from database.
Then I replaced the eval
eval('$news[\'attachment\'] .= "' . fetch_template('postbit_attachmentthumbnail')
with
eval('$news[\'attachment\'] .= "' . fetch_template('postbit_attachmentthumbnailportal')
I copied the postbit_attachmentthumbnail into a new template named 'postbit_attachmentthumbnailportal'. In the new template, right before the src in <img src= I did <img $imgsize src=
Notice that I have a if ($newscount==1) in php code? That's for my needs, it creates the thumb bigger for first news item and smaller for subsequent ones. Play with .50 and .40 to your desired size, or simply omit the if ($newscount==1) statement to make all of them the same size.