Screenshot class optimization. Defer creation of thumbnail and screenshot images until values are necessary.

This greatly speeds up the loading of the main page as we create screenshot objects to check their other internal
parameters and not output their images.
This commit is contained in:
Chris Morgan
2006-07-10 15:18:08 +00:00
committed by WineHQ
parent 6405eeafa4
commit 5f4998194a
3 changed files with 76 additions and 11 deletions

View File

@@ -120,11 +120,11 @@ if (!$aClean['iId'])
$oScreenshot = new Screenshot($obj_row->id);
echo '<tr valign=top><td class=color0><b>Submited image</b></td>',"\n";
echo '<td>';
$imgSRC = '<img width="'.$oScreenshot->oThumbnailImage->width.'" height="'.$oScreenshot->oThumbnailImage->height.'" src="../appimage.php?bQueued=true&iId='.$obj_row->id.'" />';
$imgSRC = '<img width="'.$oScreenshot->get_thumbnail_width().'" height="'.$oScreenshot->get_thumbnail_height().'" src="../appimage.php?bQueued=true&iId='.$obj_row->id.'" />';
// generate random tag for popup window
$randName = User::generate_passwd(5);
// set image link based on user pref
$img = '<a href="javascript:openWin(\'../appimage.php?bQueued=true&iId='.$obj_row->id.'\',\''.$randName.'\','.$oScreenshot->oScreenshotImage->width.','.($oScreenshot->oScreenshotImage->height+4).');">'.$imgSRC.'</a>';
$img = '<a href="javascript:openWin(\'../appimage.php?bQueued=true&iId='.$obj_row->id.'\',\''.$randName.'\','.$oScreenshot->get_screenshot_width().','.($oScreenshot->get_screenshot_height()+4).');">'.$imgSRC.'</a>';
if ($_SESSION['current']->isLoggedIn())
{
if ($_SESSION['current']->getpref("window:screenshot") == "no")