Example #1
0
    /**
     * Print the JS configuration of flowplayer
     *
     * @param string $moviepath the direct path of a movie (within the slideshow), if empty (within albums) the zenphoto function getUnprotectedImageURL() is used
     * @param string $imagetitle the title of the movie [not used by flowplayer]
     * 	 */
    function getPlayerConfig($moviepath = '', $imagetitle, $count = '')
    {
        global $_zp_current_image;
        if (empty($moviepath)) {
            $moviepath = getUnprotectedImageURL();
            $ext = strtolower(strrchr(getUnprotectedImageURL(), "."));
        } else {
            $ext = strtolower(strrchr($moviepath, "."));
        }
        if (!empty($count)) {
            $count = "-" . $count;
        }
        if (getOption("flow_player_autoplay") == 1) {
            $autoplay = "true";
        } else {
            $autoplay = "";
            // actually false should work, but it doesn't...
        }
        if ($ext === ".mp3") {
            return '<p id="playerContainer' . $count . '">' . gettext('<a href="http://www.adobe.com/go/getflashplayer">Get Flash</a> to see this player.') . '</p>
			<script>
			$("#playerContainer' . $count . '").flashembed({
      	src:\'' . WEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/flowplayer/FlowPlayerLight.swf\',
      	width:' . getOption('flow_player_width') . ', 
      	height:' . FLOW_PLAYER_MP3_HEIGHT . '
    	},
    		{config: {  
      		autoPlay: \'' . $autoplay . '\',
    			loop: false,
					controlsOverVideo: \'false\',
      		videoFile: \'' . $moviepath . '\',
      		initialScale: \'fit\',
      		backgroundColor: \'' . getOption('flow_player_backgroundcolor') . '\',
      		controlBarBackgroundColor: \'' . getOption('flow_player_controlbarbackgroundcolor') . '\',
      		controlsAreaBorderColor: \'' . getOption('flow_player_controlsareabordercolor') . '\'
    		}} 
  		);
			</script>';
        } else {
            return '<p id="playerContainer' . $count . '">' . gettext('<a href="http://www.adobe.com/go/getflashplayer">Get Flash</a> to see this player.') . '</p>
			<script>
			$("#playerContainer' . $count . '").flashembed({
      	src:\'' . WEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/flowplayer/FlowPlayerLight.swf\',
      	width:' . getOption('flow_player_width') . ', 
      	height:' . getOption('flow_player_height') . '
    	},
    		{config: {  
      		autoPlay: \'' . $autoplay . '\',
    			loop: false,
					controlsOverVideo: \'ease\',
      		videoFile: \'' . $moviepath . '\',
      		initialScale: \'fit\',
      		backgroundColor: \'' . getOption('flow_player_backgroundcolor') . '\',
      		controlBarBackgroundColor: \'' . getOption('flow_player_controlbarbackgroundcolor') . '\',
      		controlsAreaBorderColor: \'' . getOption('flow_player_controlsareabordercolor') . '\'
    		}} 
  		);
  		</script>';
        }
    }
Example #2
0
    /**
     * Prints the JS configuration of flv player
     *
     * @param string $moviepath the direct path of a movie (within the slideshow), if empty (within albums) the zenphoto function getUnprotectedImageURL() is used
     * @param string $imagetitle the title of the movie to be passed to the player for display (within slideshow), if empty (within albums) the function getImageTitle() is used
     * @param string $count unique text for when there are multiple player items on a page
     */
    function getPlayerConfig($moviepath = '', $imagetitle = '', $count = '')
    {
        global $_zp_current_image, $_zp_current_album;
        if (empty($moviepath)) {
            $moviepath = getUnprotectedImageURL();
            $ext = strtolower(strrchr(getUnprotectedImageURL(), "."));
        } else {
            $ext = strtolower(strrchr($moviepath, "."));
        }
        if (empty($imagetitle)) {
            $imagetitle = getImageTitle();
        }
        if (!empty($count)) {
            $count = "-" . $count;
        }
        $imgextensions = array(".jpg", ".jpeg", ".gif", ".png");
        if (is_null($_zp_current_image)) {
            $albumfolder = $moviepath;
            $filename = $imagetitle;
            $videoThumb = '';
        } else {
            $album = $_zp_current_image->getAlbum();
            $albumfolder = $album->name;
            $filename = $_zp_current_image->filename;
            $videoThumb = checkObjectsThumb(getAlbumFolder() . $albumfolder, $filename);
            if (!empty($videoThumb)) {
                $videoThumb = getAlbumFolder(WEBPATH) . $albumfolder . '/' . $videoThumb;
            }
        }
        $output = '';
        $output .= '<p id="player' . $count . '"><a href="http://www.macromedia.com/go/getflashplayer">' . gettext("Get Flash") . '</a> to see this player.</p>
			<script type="text/javascript">';
        if ($ext === ".mp3" and !isset($videoThumb)) {
            $output .= '	var so = new SWFObject("' . WEBPATH . '/' . ZENFOLDER . '/plugins/flvplayer/' . getOption("flv_player_version") . '.swf","player' . $count . '","' . getOption('flv_player_width') . '","' . FLV_PLAYER_MP3_HEIGHT . '","7");';
        } else {
            $output .= '	var so = new SWFObject("' . WEBPATH . '/' . ZENFOLDER . '/plugins/flvplayer/' . getOption("flv_player_version") . '.swf","player' . $count . '","' . getOption('flv_player_width') . '","' . getOption('flv_player_height') . '","7");';
            $output .= 'so.addVariable("displayheight","' . getOption('flv_player_displayheight') . '");';
        }
        $output .= 'so.addParam("allowfullscreen","true");
			so.addVariable("file","' . $moviepath . '&amp;title=' . strip_tags($imagetitle) . '");
			' . (!empty($videoThumb) ? 'so.addVariable("image","' . $videoThumb . '")' : '') . '
			so.addVariable("backcolor","' . getOption('flv_player_backcolor') . '");
			so.addVariable("frontcolor","' . getOption('flv_player_frontkcolor') . '");
			so.addVariable("lightcolor","' . getOption('flv_player_lightcolor') . '");
			so.addVariable("screencolor","' . getOption('flv_player_screencolor') . '");
			so.addVariable("autostart","' . (getOption('flv_player_autostart') ? 'true' : 'false') . '");
			so.addVariable("overstretch","true");
			so.addVariable("bufferlength","' . getOption('flv_player_buffer') . '");
			so.addVariable("controlbar","' . getOption('flv_player_controlbar') . '");
			so.write("player' . $count . '");
			</script>';
        return $output;
    }
Example #3
0
/**
 * Prints the Shutterfly logo and links to print an image.
 *
 */
function printShutterfly()
{
    echo '<script type="text/javascript">' . "\n";
    echo '<!--/* Code from http://www.netlobo.com/div_hiding.html */-->' . "\n";
    echo '	function toggleLayer(whichLayer) {' . "\n";
    echo '		if (document.getElementById) {' . "\n";
    echo '// this is the way the standards work' . "\n";
    echo '			var style2 = document.getElementById(whichLayer).style;' . "\n";
    echo '			style2.display = style2.display? "":"block";' . "\n";
    echo '		} else if (document.all) {' . "\n";
    echo '// this is the way old msie versions work' . "\n";
    echo '			var style2 = document.all[whichLayer].style;' . "\n";
    echo '			style2.display = style2.display? "":"block";' . "\n";
    echo '		} else if (document.layers) {' . "\n";
    echo '// this is the way nn4 works' . "\n";
    echo '			var style2 = document.layers[whichLayer].style;' . "\n";
    echo '			style2.display = style2.display? "":"block";' . "\n";
    echo '		}' . "\n";
    echo '	}' . "\n";
    echo '</script>' . "\n";
    echo "<div id=\"zp-shutterfly\" onClick=\"toggleLayer('extended')\">\n";
    echo '	<div id="extended">' . "\n";
    echo '		<form action="http://www.shutterfly.com/c4p/UpdateCart.jsp" method="post">' . "\n";
    echo '			<input type="hidden" name="addim" value="1" />' . "\n";
    echo '			<input type="hidden" name="protocol" value="SFP,100" />' . "\n";
    echo '			<input type="hidden" name="pid" value="C4P" />' . "\n";
    echo '			<input type="hidden" name="psid" value="AFFL" />' . "\n";
    echo '			<input type="hidden" name="puid" value="visitor" />' . "\n";
    echo '			<input type="hidden" name="imnum" value="1" />' . "\n";
    echo '			<input type="hidden" name="imraw-1" value="http://' . $_SERVER['HTTP_HOST'] . htmlspecialchars(getUnprotectedImageURL()) . '" />' . "\n";
    echo '			<input type="hidden" name="imrawwidth-1" value="' . getFullWidth() . '" />' . "\n";
    echo '			<input type="hidden" name="imrawheight-1" value="' . getFullHeight() . '" />' . "\n";
    echo '			<input type="hidden" name="imthumb-1" value="http://' . $_SERVER['HTTP_HOST'] . getImageThumb() . '" />' . "\n";
    echo '			<input type="hidden" name="imthumbheight-1" value="' . getOption('thumb_crop_height') . '" />' . "\n";
    echo '			<input type="hidden" name="imthumbwidth-1" value="' . getOption('thumb_crop_width') . '" />' . "\n";
    echo '			<input type="hidden" name="returl" value="http://' . $_SERVER['HTTP_HOST'] . htmlspecialchars(getImageLinkURL()) . '" />' . "\n";
    echo '			<input type="submit" value="Add to Shutterfly Cart &raquo;" />' . "\n";
    echo '		</form>' . "\n";
    echo '	</div>' . "\n";
    echo '</div>' . "\n";
}
Example #4
0
            printCustomSizedImage(getBareImageTitle(), null, 160, 120, 160, 120, null, null, 'thumb', null, true);
            ?>
				</a>
			<?php 
        } else {
            ?>
			<li class="thumb-portrait">
				<div class="album-tools-portrait">
						<?php 
            if ($zpfocus_use_colorbox && !isImageVideo()) {
                ?>
<a class="album-tool" rel="zoom" href="<?php 
                if ($zpfocus_cbtarget) {
                    echo htmlspecialchars(getDefaultSizedImage());
                } else {
                    echo htmlspecialchars(getUnprotectedImageURL());
                }
                ?>
" title="<?php 
                echo getBareImageTitle();
                ?>
"><img src="<?php 
                echo $_zp_themeroot;
                ?>
/images/search.png" alt="Zoom Image" /></a><?php 
            }
            ?>
						<?php 
            if (function_exists('printCommentForm') && $_zp_current_image->getCommentsAllowed() && $_zp_current_image->getCommentCount() > 0) {
                ?>
						<a class="album-tool" href="<?php 
Example #5
0
    echo ' class="switch"';
}
?>
>
		<?php 
if (function_exists('printThumbNav')) {
    printThumbNav(2, 77, 77, 77, 77);
}
?>
		<div id="image-wrap">
			<div id="full-image">
				<?php 
if ($zpmin_finallink == 'colorbox') {
    ?>
<a class="thickbox" href="<?php 
    echo html_encode(getUnprotectedImageURL());
    ?>
" title="<?php 
    echo html_encode(getBareImageTitle());
    ?>
"><?php 
    printCustomSizedImage(getAnnotatedImageTitle(), 550);
    ?>
</a><?php 
}
?>
				<?php 
if ($zpmin_finallink == 'nolink') {
    printCustomSizedImage(getAnnotatedImageTitle(), 550);
}
?>
Example #6
0
 <?php 
//
if (function_exists('printjCarouselThumbNav')) {
    printjCarouselThumbNav(6, 50, 50, 50, 50, FALSE);
} else {
    if (function_exists("printPagedThumbsNav")) {
        printPagedThumbsNav(6, FALSE, gettext('&laquo; prev thumbs'), gettext('next thumbs &raquo;'), 40, 40);
    }
}
?>

	<div id="image">
		<?php 
if (getOption("Use_thickbox") && !isImageVideo()) {
    $boxclass = " class=\"thickbox\"";
    $tburl = getUnprotectedImageURL();
} else {
    $boxclass = "";
    $tburl = getFullImageURL();
}
if (!empty($tburl)) {
    ?>
			<a href="<?php 
    echo html_encode($tburl);
    ?>
"<?php 
    echo $boxclass;
    ?>
 title="<?php 
    echo getBareImageTitle();
    ?>
Example #7
0
    /**
     * Print the JS configuration of flowplayer
     *
     * @param string $moviepath the direct path of a movie (within the slideshow), if empty (within albums)
     * the zenphoto function getUnprotectedImageURL() is used
     *
     * @param string $imagetitle the filename of the movie
     * 	 */
    function getPlayerConfig($moviepath = '', $imagetitle = '', $count = '', $width = NULL, $height = NULL)
    {
        global $_zp_current_image;
        $playerwidth = getOption('flow_player3_width');
        $playerheight = getOption('flow_player3_height');
        if (empty($moviepath)) {
            $moviepath = getUnprotectedImageURL();
            $ext = strtolower(strrchr(getUnprotectedImageURL(), "."));
        } else {
            $moviepath = $moviepath;
            $ext = strtolower(strrchr($moviepath, "."));
        }
        if (!empty($count)) {
            $count = "-" . $count;
        }
        $imgextensions = array(".jpg", ".jpeg", ".gif", ".png");
        $videoThumbImg = '';
        if (is_null($_zp_current_image)) {
            $albumfolder = $moviepath;
            $filename = $imagetitle;
            $videoThumb = '';
        } else {
            $album = $_zp_current_image->getAlbum();
            $albumfolder = $album->name;
            $filename = $_zp_current_image->filename;
            $splashimagerwidth = $playerwidth;
            $splashimageheight = $playerheight;
            getMaxSpaceContainer($splashimagerwidth, $splashimageheight, $_zp_current_image, true);
            $videoThumb = $_zp_current_image->getCustomImage(null, $splashimagerwidth, $splashimageheight, null, null, null, null, true);
            if (getOption('flow_player3_splashimage')) {
                $videoThumbImg = '<img src="' . pathurlencode($videoThumb) . '" alt="" />';
            }
        }
        if (getOption("flow_player3_autoplay") == 1) {
            $autoplay = "true";
        } else {
            $autoplay = "false";
        }
        if ($ext == ".mp3") {
            if (getOption('flow_player3_mp3coverimage')) {
                if (is_null($height)) {
                    $height = $playerheight;
                }
            } else {
                if (is_null($height)) {
                    $height = FLOW_PLAYER_MP3_HEIGHT;
                }
                $videoThumbImg = '';
                $videoThumb = '';
            }
            $allowfullscreen = 'false';
        } else {
            if (is_null($height)) {
                $height = $playerheight;
            }
            $allowfullscreen = 'true';
        }
        if (is_null($width)) {
            $width = $this->getVideoWidth();
        }
        if (is_null($width)) {
            $width = $playerwidth;
        }
        // inline css is kind of ugly but since we need to style dynamically there is no other way
        $curdir = getcwd();
        chdir(SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/flowplayer3');
        $filelist = safe_glob('flowplayer-*.swf');
        $swf = array_shift($filelist);
        $filelist = safe_glob('flowplayer.audio-*.swf');
        $audio = array_shift($filelist);
        $filelist = safe_glob('flowplayer.controls-*.swf');
        $controls = array_shift($filelist);
        chdir($curdir);
        $playerconfig = '
		<span id="player' . $count . '" class="flowplayer" style="display:block; width: ' . $width . 'px; height: ' . $height . 'px">
		' . $videoThumbImg . '
		</span>
		<script type="text/javascript">
		// <!-- <![CDATA[
		flowplayer("player' . $count . '","' . WEBPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/flowplayer3/' . $swf . '", {
		plugins: {
			audio: {
				url: "' . $audio . '"
			},
			controls: {
				url: "' . $controls . '",
				backgroundColor: "' . getOption('flow_player3_controlsbackgroundcolor') . '",
				backgroundGradient: "' . getOption('flow_player3_controlsbackgroundcolorgradient') . '",
				autoHide: "' . getOption('flow_player3_controlsautohide') . '",
				timeColor:"' . getOption('flow_player3_controlstimecolor') . '",
				durationColor: "' . getOption('flow_player3_controlsdurationcolor') . '",
				progressColor: "' . getOption('flow_player3_controlsprogresscolor') . '",
				progressGradient: "' . getOption('flow_player3_controlsprogressgradient') . '",
				bufferColor: "' . getOption('flow_player3_controlsbuffercolor') . '",
				bufferGradient:	 "' . getOption('flow_player3_controlsbuffergradient') . '",
				sliderColor: "' . getOption('flow_player3_controlsslidercolor') . '",
				sliderGradient: "' . getOption('flow_player3_controlsslidergradient') . '",
				buttonColor: "' . getOption('flow_player3_controlsbuttoncolor') . '",
				buttonOverColor: "' . getOption('flow_player3_controlsbuttonovercolor') . '",
				fullscreen : ' . $allowfullscreen . '
			}
		},
		canvas: {
			backgroundColor: "' . getOption('flow_player3_backgroundcolor') . '",
			backgroundGradient: "' . getOption('flow_player3_backgroundcolorgradient') . '"
		},';
        $playerconfigadd = 'clip:
			{
				url:"' . pathurlencode($moviepath) . '",
				autoPlay: ' . $autoplay . ',
				autoBuffering: ' . $autoplay . ',
				scaling: "' . getOption('flow_player3_scaling') . '"';
        if ($ext == ".mp3" && getOption('flow_player3_mp3coverimage')) {
            $playerconfigadd .= ',
				coverImage: {
					url:"' . urlencode($videoThumb) . '",
					scaling: "' . getOption('flow_player3_scaling') . '"
				}
				';
        }
        $playerconfigadd .= '
			}
		});
		// ]]> -->
		</script>';
        $playerconfig = $playerconfig . $playerconfigadd;
        return $playerconfig;
    }
Example #8
0
    /**
     * Prints the JS configuration of flv player
     *
     * @param string $moviepath the direct path of a movie (within the slideshow), if empty (within albums) the ZenPhoto function getUnprotectedImageURL() is used
     * @param string $imagetitle the title of the movie to be passed to the player for display (within slideshow), if empty (within albums) the function getImageTitle() is used
     * @param string $count unique text for when there are multiple player items on a page
     */
    function getPlayerConfig($moviepath = '', $imagetitle = '', $count = '')
    {
        global $_zp_current_image, $_zp_current_album, $_flv_player;
        if (empty($moviepath)) {
            $moviepath = getUnprotectedImageURL();
            $ext = strtolower(strrchr(getUnprotectedImageURL(), "."));
        } else {
            $ext = strtolower(strrchr($moviepath, "."));
        }
        if (empty($imagetitle)) {
            $imagetitle = getImageTitle();
        }
        if (!empty($count)) {
            $count = "-" . $count;
        }
        $imgextensions = array(".jpg", ".jpeg", ".gif", ".png");
        if (is_null($_zp_current_image)) {
            $albumfolder = $moviepath;
            $filename = $imagetitle;
            $videoThumb = '';
        } else {
            $album = $_zp_current_image->getAlbum();
            $albumfolder = $album->name;
            $filename = $_zp_current_image->filename;
            $videoThumb = $_zp_current_image->objectsThumb;
            if (!empty($videoThumb)) {
                $videoThumb = getAlbumFolder(WEBPATH) . $albumfolder . '/' . $videoThumb;
            }
        }
        $output = '';
        $output .= '<p id="player' . $count . '">' . gettext('The flv player is not installed. Please install or activate the flv player plugin.') . '</p>
			<script type="text/javascript">' . "\n\n";
        if ($ext === ".mp3" and !isset($videoThumb)) {
            $output .= 'var so = new SWFObject("' . WEBPATH . "/" . USER_PLUGIN_FOLDER . '/flvplayer/' . $_flv_player . '","player' . $count . '","' . getOption('flv_player_width') . '","' . FLV_PLAYER_MP3_HEIGHT . '",7);' . "\n";
        } else {
            $output .= 'var so = new SWFObject("' . WEBPATH . "/" . USER_PLUGIN_FOLDER . '/flvplayer/' . $_flv_player . '","player' . $count . '","' . getOption('flv_player_width') . '","' . getOption('flv_player_height') . '","7");' . "\n";
        }
        $output .= 'so.addVariable("file","' . $moviepath . '&amp;title=' . strip_tags($imagetitle) . '");' . "\n";
        if (!empty($videoThumb)) {
            $output .= 'so.addVariable("image","' . $videoThumb . '");' . "\n";
        }
        $output .= 'so.addVariable("backcolor","' . getOptionColor('flv_player_backcolor') . '");' . "\n";
        $output .= 'so.addVariable("frontcolor","' . getOptionColor('flv_player_frontcolor') . '");' . "\n";
        $output .= 'so.addVariable("lightcolor","' . getOptionColor('flv_player_lightcolor') . '");' . "\n";
        $output .= 'so.addVariable("screencolor","' . getOptionColor('flv_player_screencolor') . '");' . "\n";
        $output .= 'so.addVariable("autostart",' . (getOption('flv_player_autostart') ? 'true' : 'false') . ');' . "\n";
        $output .= 'so.addVariable("stretching","' . getOption('flv_player_stretching') . '");' . "\n";
        $output .= 'so.addVariable("bufferlength",' . getOption('flv_player_buffer') . ');' . "\n";
        $output .= 'so.addVariable("controlbar","' . getOption('flv_player_controlbar') . '");' . "\n";
        $output .= 'so.addParam("allowfullscreen",true);' . "\n";
        $output .= 'so.write("player' . $count . '");' . "\n";
        $output .= "\n</script>\n";
        return $output;
    }
/**
 * Returns the url to original image.
 * It will return a protected image is the option "protect_full_image" is set
 *
 * @return string
 */
function getFullImageURL()
{
    global $_zp_current_image;
    if (is_null($_zp_current_image)) {
        return false;
    }
    $outcome = getOption('protect_full_image');
    if ($outcome == 'No access') {
        return NULL;
    }
    if (isImageVideo()) {
        // Download, Protected View, and Unprotected access all allowed
        // Search for a high quality version of the video
        $album = $_zp_current_image->getAlbum();
        $folder = $album->getFolder();
        $video = $_zp_current_image->getFileName();
        $video = substr($video, 0, strrpos($video, '.'));
        foreach (array(".ogg", ".OGG", ".avi", ".AVI", ".wmv", ".WMV") as $ext) {
            if (file_exists(internalToFilesystem(ALBUM_FOLDER_SERVERPATH . $folder . "/" . $video . $ext))) {
                return ALBUM_FOLDER_WEBPATH . $folder . "/" . $video . $ext;
            }
        }
        return getUnprotectedImageURL();
    } else {
        if ($outcome == 'Unprotected') {
            return getUnprotectedImageURL();
        } else {
            return getProtectedImageURL();
        }
    }
}
/**
 * Returns the url to original image.
 * It will return a protected image is the option "protect_full_image" is set
 *
 * @return string
 */
function getFullImageURL()
{
    global $_zp_current_image;
    if (is_null($_zp_current_image)) {
        return false;
    }
    $outcome = getOption('protect_full_image');
    if ($outcome == 'No access') {
        return null;
    }
    $url = getUnprotectedImageURL();
    if (is_valid_video($url)) {
        // Download, Protected View, and Unprotected access all allowed
        $album = $_zp_current_image->getAlbum();
        $folder = $album->getFolder();
        $original = checkVideoOriginal(getAlbumFolder() . $folder, $_zp_current_image->getFileName());
        if ($original) {
            return getAlbumFolder(WEBPATH) . $folder . "/" . $original;
        } else {
            return $url;
        }
    } else {
        // normal image
        if ($outcome == 'Unprotected') {
            return $url;
        } else {
            return getProtectedImageURL();
        }
    }
}
 function getImagesHTML()
 {
     global $_zp_themeroot, $_zp_current_image, $_zp_current_album;
     $showImages = $this->getNumImages() > 0 && $this->albumPage >= $this->getFirstImagePage();
     $w = 318;
     if (!$showImages) {
         return '';
     }
     $inContext = $this->context & ZP_IMAGE || in_context(ZP_SEARCH);
     if ($inContext && $_zp_current_image) {
         $fileName = $_zp_current_image->getFileName();
         $folder = $_zp_current_image->album->getFilename();
     }
     $u = 0;
     $initialHeight = 0;
     $images = '';
     $start = $this->getAlbumPage() - ($this->getNumAlbums() > 0 ? $this->getFirstImagePage() - 1 : 0);
     $albumImages = $this->getAlbumImages($start);
     for ($k = 0; $k < count($albumImages); $k++) {
         $_zp_current_image = $this->getImage($albumImages[$k]);
         if ($u == 0) {
             $image = $_zp_current_image;
         }
         $cls = '';
         if (!$inContext && $u == 0 || $inContext && !$fileName && $u == 0 || $inContext && $_zp_current_image && $fileName == $_zp_current_image->getFileName() && $folder == $_zp_current_image->album->getFilename()) {
             $cls = 'force-selection';
             $image = $_zp_current_image;
         }
         $title = getImageTitle();
         $size = getSizeCustomImage(NULL, $w);
         $desc = getImageDesc();
         if (!empty($desc)) {
             //$desc = theme_clean($desc);
         } else {
             $desc = '';
         }
         $small = getCustomImageURL(NULL, $w);
         $full = getOption('protect_full_image') == 'Unprotected' ? getUnprotectedImageURL() : '';
         $thumb = getCustomImageURL(NULL, 32, 32);
         $width = $size[0];
         $height = $size[1];
         if ($width < $w + 2) {
             $width = $w + 2;
             $height = $height * ($w + 2) / $width;
         }
         if ($u == 0) {
             $initialHeight = $height;
         }
         $images .= "<span class='img img-{$u}' width='35' height='35'>" . "<a href='" . $this->getImageThumbLink() . "' sref='{$small}' title='{$title}' targetHeight='{$height}' >" . "<img src='{$thumb}' index='{$u}' width='35' height='35' title='{$title}' class='{$cls}' ref='{$full}' />" . "</a>" . "</span>";
         $u++;
     }
     $m = $u;
     while ($u < 8) {
         $images .= "<span class='img img-{$u}'>" . "<img src='{$_zp_themeroot}/resources/images/opa/bg-b-20.png' width='35' height='35' />" . "</span>";
         $u++;
     }
     if (!in_context(ZP_IMAGE)) {
         set_context(get_context() | ZP_IMAGE);
     }
     $_zp_current_image = $image;
     $numAlbums = $this->getNumAlbums();
     $slideshowLink = $this->getSlideshowLink();
     $s = ($this->getAlbumPage() - $this->getFirstImagePage()) * getOption('images_per_page');
     $batch = $s + 1 . "-" . ($s + $m);
     $imagesDivs = "<div id='subalbum-count' class='count'>" . (isset($slideshowLink) ? "<span id='album-slideshow-link' class='unselected'><a href='{$slideshowLink}'>Slideshow</a></span>" : "") . ($numAlbums > 0 ? "<span id='subalbum-count' class='unselected'>" . "<a href='" . $this->getAlbumTabLink() . "'>" . $numAlbums . " " . gettext($this->getAlbumTabText($numAlbums)) . "</a>" . "</span>" : "") . "<span class='selected last'>{$batch} / " . $this->getNumImages() . " " . gettext("images") . "</span></div>" . "<div id='images'>{$images}</div>" . "<div id='image-container'>" . "<img src='" . getCustomImageURL(NULL, $w) . "' width='316' />" . "</div> ";
     return $imagesDivs;
 }