Exemplo n.º 1
0
function zpArdoise_printRandomImages($number = 5, $class = NULL, $option = 'all', $rootAlbum = '', $width = NULL, $height = NULL, $crop = NULL, $fullimagelink = false, $a_class = NULL)
{
    if (is_null($crop) && is_null($width) && is_null($height)) {
        $crop = 2;
    } else {
        if (is_null($width)) {
            $width = 85;
        }
        if (is_null($height)) {
            $height = 85;
        }
        if (is_null($crop)) {
            $crop = 1;
        } else {
            $crop = (int) $crop && true;
        }
    }
    if (!empty($class)) {
        $class = ' class="' . $class . '"';
    }
    echo "<ul" . $class . ">";
    for ($i = 1; $i <= $number; $i++) {
        switch ($option) {
            case "all":
                $randomImage = getRandomImages();
                break;
            case "album":
                $randomImage = getRandomImagesAlbum($rootAlbum);
                break;
        }
        if (is_object($randomImage) && $randomImage->exists) {
            echo "<li>\n";
            if ($fullimagelink) {
                $aa_class = ' class="' . $a_class . '"';
                $randomImageURL = $randomImage->getFullimageURL();
            } else {
                $aa_class = NULL;
                $randomImageURL = $randomImage->getLink();
            }
            echo '<a href="' . html_encode($randomImageURL) . '"' . $aa_class . ' title="' . html_encode($randomImage->getTitle()) . '">';
            switch ($crop) {
                case 0:
                    $html = "<img src=\"" . html_encode(pathurlencode($randomImage->getCustomImage($width, NULL, NULL, NULL, NULL, NULL, NULL, TRUE))) . "\" alt=\"" . html_encode($randomImage->getTitle()) . "\" />\n";
                    break;
                case 1:
                    $html = "<img src=\"" . html_encode(pathurlencode($randomImage->getCustomImage(NULL, $width, $height, $width, $height, NULL, NULL, TRUE))) . "\" alt=\"" . html_encode($randomImage->getTitle()) . "\" width=\"" . $width . "\" height=\"" . $height . "\" />\n";
                    break;
                case 2:
                    $html = "<img src=\"" . html_encode(pathurlencode($randomImage->getThumb())) . "\" alt=\"" . html_encode($randomImage->getTitle()) . "\" />\n";
                    break;
            }
            echo zp_apply_filter('custom_image_html', $html, false);
            echo "</a>";
            echo "</li>\n";
        } else {
            break;
        }
    }
    echo "</ul>";
}
Exemplo n.º 2
0
$zenpage = extensionEnabled('zenpage');
$galleryactive = $_zp_gallery_page == 'index.php' || $_zp_gallery_page == 'album.php' || $_zp_gallery_page == 'image.php' ? true : false;
require_once SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/print_album_menu.php';
require_once SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/image_album_statistics.php';
setOption('flag_thumbnail_use_text', true, false);
setOption('flag_thumbnail_new_text', '<i title="' . gettext("New Image") . '" class="fa fa-flag fa-fw"></i>', false);
setOption('flag_thumbnail_geodata_text', '<i title="' . gettext("Geotagged") . '" class="fa fa-map-marker fa-fw"></i>', false);
setOption('flag_thumbnail_locked_text', '<i title="' . gettext("Protected") . '" class="fa fa-lock fa-fw"></i>', false);
setOption('flag_thumbnail_unpublished_text', '<span title="' . gettext("Unpublished") . '" class="fa-stack"><i class="fa fa-circle fa-stack-1x fa-fw"></i><i class="fa fa-exclamation-circle fa-stack-1x fa-fw red"></i></span>', false);
$quickmenu = '<div id="quickmenu">';
$quickmenu .= '<a id="nav-icon" class="quick-menu menu-btn"><i class="fa fa-bars fa-lg"></i></a>';
$quickmenu .= '<a id="search-icon" class="quick-menu" href="' . getCustomPageURL('archive') . '" title="' . gettext('Archive/Search') . '"><i class="fa fa-search fa-lg"></i></a>';
$quickmenu .= '<a id="scrollup" class="quick-menu scrollup" title="' . gettext('Scroll to top') . '"><i class="fa fa-chevron-circle-up fa-lg"></i></a>';
$quickmenu .= '</div>';
if ($_zp_current_album && $_zp_gallery_page != 'favorites.php' && $_zp_gallery_page != '404.php') {
    $randomImage = getRandomImagesAlbum($_zp_current_album);
} else {
    $randomImage = getRandomImages();
}
if (is_object($randomImage) && $randomImage->exists) {
    $bg = html_encode(pathurlencode($randomImage->getCustomImage(1200, null, null, null, null, null, null, true)));
} else {
    $bg = '';
}
?>

<!DOCTYPE html>
<html>
<head>
	<meta charset="<?php 
echo LOCAL_CHARSET;
Exemplo n.º 3
0
/**
 * Puts up random image thumbs from the gallery
 *
 * @param int $number how many images
 * @param string $class optional class
 * @param string $option what you want selected: all for all images, album for selected ones from an album
 * @param mixed $rootAlbum optional album object/folder from which to get the image.
 * @param integer $width the width/cropwidth of the thumb if crop=true else $width is longest size.
 * @param integer $height the height/cropheight of the thumb if crop=true else not used
 * @param bool $crop 'true' (default) if the thumb should be cropped, 'false' if not
 * @param bool $fullimagelink 'false' (default) for the image page link , 'true' for the unprotected full image link (to use Colorbox for example)
 */
function printRandomImages($number = 5, $class = null, $option = 'all', $rootAlbum = '', $width = NULL, $height = NULL, $crop = NULL, $fullimagelink = false)
{
    if (is_null($crop) && is_null($width) && is_null($height)) {
        $crop = 2;
    } else {
        if (is_null($width)) {
            $width = 85;
        }
        if (is_null($height)) {
            $height = 85;
        }
        if (is_null($crop)) {
            $crop = 1;
        } else {
            $crop = (int) $crop && true;
        }
    }
    if (!empty($class)) {
        $class = ' class="' . $class . '"';
    }
    echo "<ul" . $class . ">";
    for ($i = 1; $i <= $number; $i++) {
        switch ($option) {
            case "all":
                $randomImage = getRandomImages();
                break;
            case "album":
                $randomImage = getRandomImagesAlbum($rootAlbum);
                break;
        }
        if (is_object($randomImage) && $randomImage->exists) {
            echo "<li>\n";
            if ($fullimagelink) {
                $randomImageURL = $randomImage->getFullimageURL();
            } else {
                $randomImageURL = $randomImage->getLink();
            }
            echo '<a href="' . html_encode($randomImageURL) . '" title="' . sprintf(gettext('View image: %s'), html_encode($randomImage->getTitle())) . '">';
            switch ($crop) {
                case 0:
                    $sizes = getSizeCustomImage($width, NULL, NULL, NULL, NULL, NULL, NULL, $randomImage);
                    $html = '<img src="' . html_encode(pathurlencode($randomImage->getCustomImage($width, NULL, NULL, NULL, NULL, NULL, NULL, TRUE))) . '" width="' . $sizes[0] . '" height="' . $sizes[1] . '" alt="' . html_encode($randomImage->getTitle()) . '" />' . "\n";
                    break;
                case 1:
                    $sizes = getSizeCustomImage(NULL, $width, $height, $width, $height, NULL, NULL, $randomImage);
                    $html = '<img src="' . html_encode(pathurlencode($randomImage->getCustomImage(NULL, $width, $height, $width, $height, NULL, NULL, TRUE))) . '" width="' . $sizes[0] . '" height="' . $sizes[1] . '" alt="' . html_encode($randomImage->getTitle()) . '" />' . "\n";
                    break;
                case 2:
                    $sizes = getSizeDefaultThumb($randomImage);
                    //$html = '<img src="' . html_encode(pathurlencode($randomImage->getThumb())) . '" width="' . $sizes[0] . '" height="' . $sizes[1] . '" alt="' . html_encode($randomImage->getTitle()) . '" />' . "\n";
                    $html = $randomImage->filename . " (" . $randomImage->album->name . ")";
                    break;
            }
            echo zp_apply_filter('custom_image_html', $html, false);
            echo "</a>";
            echo "</li>\n";
        } else {
            break;
        }
    }
    echo "</ul>";
}
Exemplo n.º 4
0
</a> |
							<?php 
}
printParentBreadcrumb();
?>
</span>
					<?php 
printBareAlbumTitle(25);
?>
				</div>
			</div> <!-- wrapnav -->

			<!-- Random Image -->
			<?php 
if (isAlbumPage()) {
    printHeadingImage(getRandomImagesAlbum(NULL, getOption('effervescence_daily_album_image')));
}
?>
		</div> <!-- header -->

		<!-- Wrap Subalbums -->
		<div id="subcontent">
			<div id="submain">

				<!-- Album Description -->
				<div id="description">
					<?php 
printAlbumDesc();
?>
				</div>
Exemplo n.º 5
0
    ?>
</a> | 
				<?php 
    printParentBreadcrumb();
    ?>
</span>
				<?php 
    printAlbumTitle(true);
    ?>
			</div>
		</div> <!-- wrapnav -->

		<!-- Random Image -->
		<?php 
    if (isAlbumPage()) {
        printHeadingImage(getRandomImagesAlbum());
    }
    ?>
	</div> <!-- header -->

	<!-- Wrap Subalbums -->
	<div id="subcontent">
		<div id="submain">

			<!-- Album Description -->
			<div id="description">
				<?php 
    printAlbumDesc(true);
    ?>
			</div>
Exemplo n.º 6
0
/*******************************************************************************
 * random.php: return random image
 *******************************************************************************
 * URL Parameters:
 *   num	- number of images
 *   width	- width of random image.
 *   height	- height of random image.
 *   class	- css class for random image.
 *   album	- album to get the random image, default is root.
 *
 *******************************************************************************
 */
define('OFFSET_PATH', true);
require_once "template-functions.php";
isset($_REQUEST['num']) ? $num = $_REQUEST['num'] : ($num = 0);
isset($_REQUEST['width']) ? $width = $_REQUEST['width'] : ($width = 50);
isset($_REQUEST['height']) ? $height = $_REQUEST['height'] : ($height = 50);
isset($_REQUEST['class']) ? $class = $_REQUEST['class'] : ($class = '');
isset($_REQUEST['album']) ? $album = $_REQUEST['album'] : ($album = '');
header('Content-Type: text/html; charset=' . getOption('charset'));
while ($num > 0) {
    if ($album == '') {
        $randomImage = getRandomImages();
    } else {
        $randomImage = getRandomImagesAlbum($album);
    }
    $randomImageURL = getURL($randomImage);
    echo '<a href="' . getMainSiteURL() . $randomImageURL . '" title="View image: ' . $randomImage->getTitle() . '" class="' . $class . '">' . '<img src="' . getMainSiteURL() . $randomImage->getCustomImage(null, $width, $height, null, null, null, null) . '" width="' . $width . '" height="' . $height . '" alt="' . $randomImage->getTitle() . '"';
    echo "/></a>\n";
    $num--;
}
/**
 * Puts up random image thumbs from the gallery
 *
 * @param int $number how many images
 * @param string $class optional class
 * @param string $option what you want selected: all for all images, album for selected ones from an album
 * @param string $rootAlbum optional album from which to get the images
 * @param integer $width the width/cropwidth of the thumb if crop=true else $width is longest size.
 * @param integer $height the height/cropheight of the thumb if crop=true else not used
 * @param bool $crop 'true' (default) if the thumb should be cropped, 'false' if not
 */
function printRandomImages($number = 5, $class = null, $option = 'all', $rootAlbum = '', $width = 100, $height = 100, $crop = true)
{
    if (!is_null($class)) {
        $class = ' class="' . $class . '"';
    }
    echo "<ul" . $class . ">";
    for ($i = 1; $i <= $number; $i++) {
        echo "<li>\n";
        switch ($option) {
            case "all":
                $randomImage = getRandomImages();
                break;
            case "album":
                $randomImage = getRandomImagesAlbum($rootAlbum);
                break;
        }
        if (is_object($randomImage) && $randomImage->exists) {
            $randomImageURL = html_encode(getURL($randomImage));
            echo '<a href="' . $randomImageURL . '" title="' . sprintf(gettext('View image: %s'), html_encode($randomImage->getTitle())) . '">';
            if ($crop) {
                $html = "<img src=\"" . html_encode($randomImage->getCustomImage(NULL, $width, $height, $width, $height, NULL, NULL, TRUE)) . "\" alt=\"" . html_encode($randomImage->getTitle()) . "\" />\n";
            } else {
                $html = "<img src=\"" . html_encode($randomImage->getCustomImage($width, NULL, NULL, NULL, NULL, NULL, NULL, TRUE)) . "\" alt=\"" . html_encode($randomImage->getTitle()) . "\" />\n";
            }
            echo zp_apply_filter('custom_image_html', $html, false);
            echo "</a>";
        }
        echo "</li>\n";
    }
    echo "</ul>";
}