All right, here you go. This is the function where 1486 is in. You’ll find the line by looking for lots of #####.
<?php //I am telling SMF to highlight sysntax, strip me out.
function spgm_DisplayPicture($strGalleryId, $iPictureId, $strFilterFlags) {
global $cfg;
$arrPictureFilenames = spgm_CreatePictureArray($strGalleryId, $strFilterFlags, true);
$iPictureNumber = count($arrPictureFilenames);
$strPathToPictures = DIR_GAL.$strGalleryId.'/';
$strPictureFilename = $arrPictureFilenames[$iPictureId];
$_strFileExtension = strrchr($strPictureFilename, '.');
$strPictureBasename = substr($strPictureFilename, 0, -strlen($_strFileExtension));
$strPictureURL = $strPathToPictures.$strPictureFilename;
$strCaptionURL = $strPictureURL.EXT_PIC_CAPTION; // DEPRECATED
$strGalleryName = str_replace('_', ' ', $strGalleryId);
$strGalleryName = str_replace('/', ' » ', $strGalleryName);
$bSlideshowMode = strstr($strFilterFlags, PARAM_VALUE_FILTER_SLIDESHOW) != FALSE;
$output = '';
if ($cfg['conf']['thumbnailsPerPage'] != 0) {
$iPageNumber = $iPictureNumber / $cfg['conf']['thumbnailsPerPage'];
if ($iPageNumber > (int)($iPictureNumber / $cfg['conf']['thumbnailsPerPage']))
$iPageNumber = (int)++$iPageNumber;
}
spgm_Trace(
'<p>function spgm_DisplayPicture</p>'."\n"
.'strGalleryId: '.$strGalleryId.'<br />'."\n"
.'strPictureFilename: '.$strPictureFilename.'<br />'."\n"
.'strPathToPictures: '.$strPathToPictures.'<br />'."\n"
.'strPictureURL: '.$strPictureURL.'<br />'."\n"
);
if (($iPictureId < 0) || ($iPictureId > $iPictureNumber-1) || $iPictureId == '')
spgm_Error(ERRMSG_UNKNOWN_PICTURE);
if (! spgm_IsGallery($strGalleryId) )
spgm_Error(ERRMSG_UNKNOWN_GALLERY);
if ( spgm_IsPicture($strPictureFilename, $strGalleryId) ) {
$arrPictureDim = getimagesize($strPictureURL);
$iPreviousPictureId = $iPictureId - 1;
$iNextPictureId = $iPictureId + 1;
// always display the gallery header
$output .= spgm_DisplayGalleryNavibar($strGalleryId, $strFilterFlags, $iPictureId, $arrPictureFilenames);
// thumbnails are only displayed if wanted
if ( ! strstr($strFilterFlags, PARAM_VALUE_FILTER_NOTHUMBS)
&& ! $bSlideshowMode ) {
$output .= spgm_DisplayThumbnails($strGalleryId, $arrPictureFilenames, $iPictureId, '', $strFilterFlags);
}
// left-right orientation
if ($cfg['conf']['galleryOrientation'] == ORIENTATION_LEFTRIGHT) {
$output .= ' <td class="'.CLASS_TD_ORIENTATION_RIGHT.'">'."\n\n";
}
// Prepare layout for stuff left
$output .= '<br /><br />'."\n";
$output .= '<table cellspacing="0" class="'.CLASS_TABLE_PICTURE.'">'."\n";
// display the previous/next arrow section if we are not in slideshow mode
if ( ! $bSlideshowMode ) {
$output .= ' <tr>'."\n";
$output .= ' <td class="'.CLASS_TD_PICTURE_NAVI.'"><a name="pic" id="'.ID_PICTURE_NAVI.'"></a>'."\n";
if ($iPreviousPictureId >= 0)
$output .= ' <a href="'.$cfg['global']['documentSelf'].'?'.PARAM_NAME_GALID.'='.$strGalleryId.'&'.PARAM_NAME_PICID.'='.$iPreviousPictureId.'&'.PARAM_NAME_FILTER.'='.str_replace(PARAM_VALUE_FILTER_SLIDESHOW, '', $strFilterFlags).$cfg['global']['URLExtraParams'].'#pic">'.$cfg['theme']['previousPictureIcon'].'</a> ';
//multi-language support
$cfg['locale']['pictureNaviBar'] = str_replace(PATTERN_CURRENT_PIC, "$iNextPictureId", $cfg['locale']['pictureNaviBar']);
$cfg['locale']['pictureNaviBar'] = str_replace(PATTERN_NB_PICS, "$iPictureNumber", $cfg['locale']['pictureNaviBar']);
$output .= ' '.$cfg['locale']['pictureNaviBar'].' ';
if ($iNextPictureId < $iPictureNumber)
$output .= '<a href="'.$cfg['global']['documentSelf'].'?'.PARAM_NAME_GALID.'='.$strGalleryId.'&'.PARAM_NAME_PICID.'='.$iNextPictureId.'&'.PARAM_NAME_FILTER.'='.str_replace(PARAM_VALUE_FILTER_SLIDESHOW, '', $strFilterFlags).$cfg['global']['URLExtraParams'].'#pic">'.$cfg['theme']['nextPictureIcon'].'</a>'."\n";
$output .= ' </td>'."\n".' </tr>'."\n";
}
// Client side zoom buttons
if (count($cfg['conf']['zoomFactors']) > 0) {
$output .= '</tr>'."\n".'<tr>'."\n".' <td class="'.CLASS_TD_ZOOM_FACTORS.'">'."\n";
for ($i=0; $i<count($cfg['conf']['zoomFactors']); $i++) {
$iHeight = (int)($arrPictureDim[1]*$cfg['conf']['zoomFactors'][$i]/100);
##############line 1486########################################
$iWidth = (int)($arrPictureDim[0]*$cfg['conf']['zoomFactors'][$i]/100);
$output .= '<input type="button" class="'.CLASS_BUTTON_ZOOM_FACTORS.'" value=" '.$cfg['conf']['zoomFactors'][$i].'% " ';
$output .= 'onClick="document.getElementById('."'".ID_PICTURE."'".').setAttribute('."'".'height'."'".', '.$iHeight.'); ';
$output .= 'document.getElementById('."'".ID_PICTURE."'".').setAttribute('."'".'width'."'".', '.$iWidth.'); ';
$output .= 'document.getElementById('."'".ID_PICTURE_NAVI."'".').scrollIntoView();">'."\n";
}
$output .= "\n".' </td>'."\n".'</tr>'."\n";
}
// EXIF data
if ( count($cfg['conf']['exifInfo']) > 0 ) {
if ( extension_loaded('exif') ) { // ... where available
$output .= '<tr><td>'."\n";
$strExifData = spgm_LoadExif($strPictureURL);
$output .= '[<span onmouseover="return overlib(\''.$strExifData.'\', CAPTION, \''.$cfg['locale']['exifHeading'].' '.$strPictureFilename.'\', STICKY);" onmouseout="return nd();" style="color: #2e408d; font-weight: bold; font-size: 9pt;">Exif</span>]';
$output .= '</td></tr>'."\n";
}
}
//Load pictures if slideshow mode is enabled
if ( $bSlideshowMode ) {
$output .= '<script language="Javascript">'."\n";
$iPictureNumber = count( $arrPictureFilenames );
$_dim = array();
$_strPicturePath = '';
for ($i=0; $i<$iPictureNumber; $i++) {
$_strPicturePath = $strPathToPictures.$arrPictureFilenames[$i];
$_dim = getimagesize($_strPicturePath);
$_strPictureCaption = '';*/
if ( isset($cfg['captions'][$arrPictureFilenames[$i]]) ) {
$_strPictureCaption = $cfg['captions'][$arrPictureFilenames[$i]];
}
$output .= ' addPicture(\''.$_strPicturePath.'\', \''.addslashes($_strPictureCaption).'\', '.$_dim[0].', '.$_dim[1].');'."\n";
}
$output .='</script>'."\n";
}
// compute image dimensions
$iWidth = $arrPictureDim[0];
$iHeight = $arrPictureDim[1];
if ($cfg['conf']['fullPictureWidth'] != ORIGINAL_SIZE) {
$iWidth = $cfg['conf']['fullPictureWidth'];
if ($cfg['conf']['fullPictureHeight'] == ORIGINAL_SIZE) {
$iHeight = (int)$arrPictureDim[1]*($cfg['conf']['fullPictureWidth']/$arrPictureDim[0]);
} else {
$iHeight = $cfg['conf']['fullPictureHeight'];
}
} else {
if ($cfg['conf']['fullPictureHeight'] != ORIGINAL_SIZE) {
$iHeight = $cfg['conf']['fullPictureHeight'];
$iWidth = (int)$arrPictureDim[0]*($cfg['conf']['fullPictureHeight']/$arrPictureDim[1]);
}
}
// Eventually display the picture
$output .='<tr>'."\n";
$output .=' <td class="'.CLASS_TD_PICTURE_PIC.'">'."\n";
// Overlib hidden span for EXIF data
$output .=' <div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>'."\n";
$output .= spgm_DropShadowsBeginWrap();
if (! ($iNextPictureId < $iPictureNumber) ) $iNextPictureId = 0; // to link to the appropriate next pic
if ( ! $bSlideshowMode ) {
if ($cfg['conf']['popupOverFullPictures'] == TRUE) {
$iPopupWidth = $cfg['conf']['popupWidth'];
$iPopupHeight = $cfg['conf']['popupHeight'];
$strJustPicture = 'false';
if ($cfg['conf']['popupFitPicture'] == true) {
$iPopupWidth = $arrPictureDim[0];
$iPopupHeight = $arrPictureDim[1];
$strJustPicture = 'true';
}
$output .= ' <a href="#?"';
$output .= ' onclick="popupPicture(\''.$strPictureURL.'\', '.$iPopupWidth.', '.$iPopupHeight.', '.$strJustPicture.');">';
} else {
$output .= ' <a href="'.$cfg['global']['documentSelf'].'?';
$output .= PARAM_NAME_GALID.'='.$strGalleryId.'&';
$output .= PARAM_NAME_PICID.'='.$iNextPictureId.'&';
$output .= PARAM_NAME_FILTER.'='.str_replace(PARAM_VALUE_FILTER_SLIDESHOW, '', $strFilterFlags).$cfg['global']['URLExtraParams'].'#pic">';
}
}
$output .= '<img id="'.ID_PICTURE.'" src="'.$strPictureURL.'" width="'.$iWidth.'" height="'.$iHeight.'" alt="'.$strPictureURL;
$output .= '" class="'.CLASS_IMG_PICTURE.'" />';
if ( ! $bSlideshowMode ) {
$output .= '</a>'."\n";
}
$output .= spgm_DropShadowsEndWrap();
$output .= ' </td>'."\n";
$output .='</tr>'."\n";
// display the picture's filename if needed
if ($cfg['conf']['filenameWithPictures'] == true) {
$output .= '<tr>'."\n";
$output .= ' <td class="'.CLASS_TD_PICTURE_FILENAME.'">'."\n";
$output .= $strPictureBasename.'<br />'."\n";
$output .= ' </td>'."\n";
$output .= '</tr>'."\n";
}
// display the caption
$output .= '<tr>'."\n";
$output .= ' <td id="'.ID_PICTURE_CAPTION.'" class="'.CLASS_TD_PICTURE_CAPTION.'"> '."\n";
if ( isset($cfg['captions'][$strPictureFilename]) ) {
$output .= $cfg['captions'][$strPictureFilename];
}
$output .= ' </td>'."\n";
$output .='</tr>'."\n";
$output .= '</table>'."\n";
// left-right orientation
if ($cfg['conf']['galleryOrientation'] == ORIENTATION_LEFTRIGHT) {
$output .= ' </td>'."\n";
$output .='</tr>'."\n";
$output .='</table>'."\n";
}
if ( $bSlideshowMode ) {
$output .= '<script language="Javascript">runSlideShow();</script>'."\n";
}
}
else
spgm_Error(ERRMSG_UNKNOWN_PICTURE);
return $output;
}
The whole source of the snippet can be found here:
http://utopia.proempel.de/spgm.php.txt
moderator note: Syntax Highlighting activated