Topic: long page load times after installing lightbox mod
Hello,
I recently installed the lightbox mod (http://www.punres.org/viewtopic.php?id=1733) on my forum (http://www.teamg3.com/forum). I noticed that on any thread with pictures the load times were horrible. I enabled debug mode to get the times:
this thread has no pictures:
http://www.teamg3.com/forum/viewtopic.php?id=353
[ Generated in 0.111 seconds, 9 queries executed ]
this has several:
http://www.teamg3.com/forum/viewtopic.php?id=333
[ Generated in 11.989 seconds, 9 queries executed ]
i put my original parser.php back and this made the times back to normal on picture threads.
here is the code that is changed in parser:
#
#---------[ 6. FIND (line:293) ]---------------------------------------------------
#
else if (!$is_signature && $pun_user['show_img'] != '0')
$img_tag = '<img class="postimg" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
#
#---------[ 7. REPLACE WITH ]---------------------------------------------------
#
else if (!$is_signature && $pun_user['show_img'] != '0')
{
if (@fclose(@fopen($url, "r")))
{
$imagehw = GetImageSize($url);
$width = $imagehw[0];
$height = $imagehw[1];
$img_tag = '<img class="postimg" src="'.$url.'" alt="'.htmlspecialchars($url).'" />';
if ($width > 550)
{
$img_tag = '<a href="'.$url.'" rel="lightbox">' . $img_tag . '</a>';
}
}
else
{
$img_tag = '<strong>error: image ' . $url . ' cannot be loaded.</strong>';
}
}
#
#
am i doomed to slow load times with this mod? is it because the server i am on just can't process it enough? or because it has to download it and process it?
thanks for your help,
John