Ejemplo n.º 1
0
 /**
  * Gets the feed items
  *
  * @return array
  */
 public function getitems()
 {
     global $_zp_CMS;
     switch ($this->feedtype) {
         case 'gallery':
             if ($this->mode == "albums") {
                 $items = getAlbumStatistic($this->itemnumber, $this->sortorder, $this->albumfolder, 0, $this->sortdirection);
             } else {
                 $items = getImageStatistic($this->itemnumber, $this->sortorder, $this->albumfolder, $this->collection, 0, $this->sortdirection);
             }
             break;
         case 'news':
             switch ($this->newsoption) {
                 case "category":
                     if ($this->sortorder) {
                         $items = getZenpageStatistic($this->itemnumber, 'categories', $this->sortorder, $this->sortdirection);
                     } else {
                         $items = getLatestNews($this->itemnumber, $this->catlink, false, $this->sortdirection);
                     }
                     break;
                 default:
                 case "news":
                     if ($this->sortorder) {
                         $items = getZenpageStatistic($this->itemnumber, 'news', $this->sortorder, $this->sortdirection);
                     } else {
                         // Needed baceause type variable "news" is used by the feed item method and not set by the class method getArticles!
                         $items = getLatestNews($this->itemnumber, '', false, $this->sortdirection);
                     }
                     break;
             }
             break;
         case "pages":
             if ($this->sortorder) {
                 $items = getZenpageStatistic($this->itemnumber, 'pages', $this->sortorder, $this->sortdirection);
             } else {
                 $items = $_zp_CMS->getPages(NULL, false, $this->itemnumber);
             }
             break;
         case 'comments':
             switch ($type = $this->commentfeedtype) {
                 case 'gallery':
                     $items = getLatestComments($this->itemnumber, 'all');
                     break;
                 case 'album':
                     $items = getLatestComments($this->itemnumber, 'album', $this->id);
                     break;
                 case 'image':
                     $items = getLatestComments($this->itemnumber, 'image', $this->id);
                     break;
                 case 'zenpage':
                     $type = 'all';
                 case 'news':
                 case 'page':
                     if (function_exists('getLatestZenpageComments')) {
                         $items = getLatestZenpageComments($this->itemnumber, $type, $this->id);
                     }
                     break;
                 case 'allcomments':
                     $items = getLatestComments($this->itemnumber, 'all');
                     $items_zenpage = array();
                     if (function_exists('getLatestZenpageComments')) {
                         $items_zenpage = getLatestZenpageComments($this->itemnumber, 'all', $this->id);
                         $items = array_merge($items, $items_zenpage);
                         $items = sortMultiArray($items, 'date', true);
                         $items = array_slice($items, 0, $this->itemnumber);
                     }
                     break;
             }
             break;
     }
     if (isset($items)) {
         return $items;
     }
     if (TEST_RELEASE) {
         zp_error(gettext('Bad ' . $this->feed . ' feed:' . $this->feedtype), E_USER_WARNING);
     }
     return NULL;
 }
Ejemplo n.º 2
0
			<div class="ui-content" role="main">

				<div class="content-primary">
					<?php 
printGalleryDesc();
?>
					<?php 
if (function_exists('printLatestImages')) {
    ?>
						<h2><?php 
    echo gettext('Latest images');
    ?>
</h2>
						<?php 
    $latestimages = getImageStatistic(8, 'latest', '', false, 0, 'desc');
    ?>
						<div class="ui-grid-c">
							<?php 
    $count = '';
    foreach ($latestimages as $image) {
        $count++;
        switch ($count) {
            case 1:
                $imgclass = ' ui-block-a';
                break;
            case 2:
                $imgclass = ' ui-block-b';
                break;
            case 3:
                $imgclass = ' ui-block-c';
Ejemplo n.º 3
0
				<div class="container" id="home-left">
					<div><?php 
    echo shortenContent(printGalleryDesc(), 20, '...');
    ?>
</div>
					<div id="minigal-thumbwrap">
						<div class="navigation-container">
							<div id="thumbshome" class="navigation">
								<a class="pageLink prev" style="visibility: hidden;" href="#" title="Previous Page"></a>
								<ul class="thumbs noscript">
									<?php 
    if ($minigalstat) {
        ?>
										<?php 
        $images = getImageStatistic($minigalcount, $zpgal_minigaloption);
        foreach ($images as $image) {
            ?>
											<li>
												<a class="thumb" href="<?php 
            echo html_encode($image->getCustomImage(null, 412, $minigalimageheight, 412, $minigalimageheight, null, null, true));
            ?>
" title="<?php 
            echo html_encode($image->getTitle());
            ?>
">
													<img src="<?php 
            echo html_encode($image->getCustomImage(null, 65, 65, 65, 65, null, null, true));
            ?>
" alt="<?php 
            echo html_encode($image->getTitle());
Ejemplo n.º 4
0
        echo $divider;
        ?>
								<?php 
        if (getNumImages() > 0) {
            echo getNumImages() . ' ' . gettext("images");
        }
        ?>
							</div>
						</div>
					</div>	
					<?php 
    }
} else {
    // or latest images
    require_once SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/image_album_statistics.php';
    $images = getImageStatistic(getOption('zpbase_galhomecount'), 'latest');
    foreach ($images as $image) {
        if (isImagePhoto($image)) {
            makeImageCurrent($image);
            ?>
					<div class="sdscroll-item">
						<?php 
            if (getOption('zpbase_nodetailpage')) {
                printCustomSizedImage(getBareImageTitle(), null, null, getOption('zpbase_sds_maxheight'), null, null, null, null, 'remove-attributes', null, true);
            } else {
                ?>
						<a href="<?php 
                echo html_encode(getImageURL());
                ?>
" title="<?php 
                printBareImageTitle();
Ejemplo n.º 5
0
function zpArdoise_printImageStatistic($number, $option, $albumfolder = '', $showtitle = false, $showdate = false, $showdesc = false, $desclength = 40, $showstatistic = '', $width = NULL, $height = NULL, $crop = NULL, $collection = false, $fullimagelink = false, $threshold = 0, $a_class = NULL)
{
    $images = getImageStatistic($number, $option, $albumfolder, $collection, $threshold);
    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;
        }
    }
    echo "\n<div id=\"{$option}\">\n";
    echo "<ul>";
    foreach ($images as $image) {
        if ($fullimagelink) {
            $aa_class = ' class="' . $a_class . '"';
            $imagelink = $image->getFullImageURL();
        } else {
            $aa_class = NULL;
            $imagelink = $image->getLink();
        }
        echo "<li><a href=\"" . html_encode(pathurlencode($imagelink)) . "\"" . $aa_class . " title=\"" . html_encode($image->getTitle()) . "\">\n";
        switch ($crop) {
            case 0:
                echo "<img src=\"" . html_encode(pathurlencode($image->getCustomImage($width, NULL, NULL, NULL, NULL, NULL, NULL, TRUE))) . "\" alt=\"" . html_encode($image->getTitle()) . "\" /></a>\n";
                break;
            case 1:
                echo "<img src=\"" . html_encode(pathurlencode($image->getCustomImage(NULL, $width, $height, $width, $height, NULL, NULL, TRUE))) . "\" alt=\"" . html_encode($image->getTitle()) . "\" width=\"" . $width . "\" height=\"" . $height . "\" /></a>\n";
                break;
            case 2:
                echo "<img src=\"" . html_encode(pathurlencode($image->getThumb())) . "\" alt=\"" . html_encode($image->getTitle()) . "\" /></a>\n<br />";
                break;
        }
        if ($showtitle) {
            echo "<h3><a href=\"" . html_encode(pathurlencode($image->getLink())) . "\" title=\"" . html_encode($image->getTitle()) . "\">\n";
            echo $image->getTitle() . "</a></h3>\n";
        }
        if ($showdate) {
            echo "<p>" . zpFormattedDate(DATE_FORMAT, strtotime($image->getDateTime())) . "</p>";
        }
        if ($showstatistic === "rating" or $showstatistic === "rating+hitcounter") {
            $votes = $image->get("total_votes");
            $value = $image->get("total_value");
            if ($votes != 0) {
                $rating = round($value / $votes, 1);
            }
            echo "<p>" . sprintf(gettext('Rating: %1$u (Votes: %2$u)'), $rating, $votes) . "</p>";
        }
        if ($showstatistic === "hitcounter" or $showstatistic === "rating+hitcounter") {
            $hitcounter = $image->get("hitcounter");
            if (empty($hitcounter)) {
                $hitcounter = "0";
            }
            echo "<p>" . sprintf(gettext("Views: %u"), $hitcounter) . "</p>";
        }
        if ($showdesc) {
            echo html_encodeTagged(shortenContent($image->getDesc(), $desclength, ' (...)'));
        }
        echo "</li>";
    }
    echo "</ul></div>\n";
}
Ejemplo n.º 6
0
/**
 * Prints an image or album statistic slideshow using the {@link http://galleria.io/  jQuery plugin Galleria}
 *
 * See readme/documentation for usage:
 * Call directly in a template file or codeblock.
 *
 * NOTE: movie and audio files not supported.
 *
 * @param string $type return statistics of either 'images' or 'albums'
 * @param integer $number the number of items to get (images or albums, depending on $type set)
 * @param string $option
 *  	"popular" for the most popular
 *		"latest" for the latest uploaded by id (Discovery)
 * 		"latest-date" for the latest by date
 * 		"latest-mtime" for the latest by mtime
 *   	"latest-publishdate" for the latest by publishdate
 *      "mostrated" for the most voted
 *		"toprated" for the best voted
 *		"latestupdated" for the latest updated
 *		"random" for random order (yes, strictly no statistical order...)
 * @param string $albumfolder foldername of a specific album to pull items from
 * @param bool $collection only if $albumfolder is set: true if you want to get statistics from this album and all of its subalbums
 * @param bool $linkslides true to link to image or album on slide, else click advances slideshow instead
 * @param mixed $autoplay true to autoplay slideshow with interval set in options, false to start with slideshow stopped.  Set integer in milliseconds to autoplay at that interval (Ex. 4000), overriding plugin option set.
 * @param integer $threshold the minimum number of ratings an image must have to be included in the list. (Default 0)
 *
 */
function printGslideshowStatistic($type, $number, $option, $albumfolder = '', $collection = false, $linkslides = true, $autoplay = true, $threshold = 0)
{
    save_context();
    $data = 'data';
    $embedded = true;
    $forceheight = true;
    $imagenumber = 0;
    $albumtitle = '';
    $returnpath = '';
    require_once SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/image_album_statistics.php';
    if ($type == 'album' || $type == 'albums') {
        $albums = getAlbumStatistic($number, $option, $albumfolder);
    } else {
        $images = getImageStatistic($number, $option, $albumfolder, $collection, $threshold);
    }
    ?>

			<script>
				var data = [

	<?php 
    if ($type == 'album' || $type == 'albums') {
        $c = 1;
        foreach ($albums as $album) {
            $tempalbum = newAlbum($album['folder']);
            $albumpath = html_encode(rewrite_path("/" . pathurlencode($tempalbum->name), "index.php?album=" . pathurlencode($tempalbum->name)));
            $albumthumb = $tempalbum->getAlbumThumbImage();
            $image = newImage($tempalbum, $albumthumb->filename);
            $ext = isImagePhoto($image);
            if ($ext) {
                makeImageCurrent($image);
                echo '{' . "\n";
                echo 'thumb: \'' . getCustomSizedImageMaxSpace(getOption('gslideshow_thumbsize'), getOption('gslideshow_thumbsize')) . '\',' . "\n";
                echo 'image: \'' . getCustomSizedImageMaxSpace(getOption('gslideshow_mediumsize'), getOption('gslideshow_mediumsize')) . '\',' . "\n";
                echo 'big: \'' . getCustomSizedImageMaxSpace(getOption('gslideshow_bigsize'), getOption('gslideshow_bigsize')) . '\',' . "\n";
                echo 'title: \'' . html_encode($tempalbum->getTitle()) . '\',' . "\n";
                $desc = $tempalbum->getDesc();
                $desc = str_replace("\r\n", '<br />', $desc);
                $desc = str_replace("\r", '<br />', $desc);
                echo 'description: \'' . js_encode($desc) . '\',' . "\n";
                echo 'link: \'' . $albumpath . '\'' . "\n";
                if ($c == $number) {
                    echo '}' . "\n";
                } else {
                    echo '},' . "\n";
                }
            }
            $c++;
        }
        echo "\n";
    } else {
        $c = 1;
        foreach ($images as $image) {
            $ext = isImagePhoto($image);
            if ($ext) {
                makeImageCurrent($image);
                echo '{' . "\n";
                echo 'thumb: \'' . getCustomSizedImageMaxSpace(getOption('gslideshow_thumbsize'), getOption('gslideshow_thumbsize')) . '\',' . "\n";
                echo 'image: \'' . getCustomSizedImageMaxSpace(getOption('gslideshow_mediumsize'), getOption('gslideshow_mediumsize')) . '\',' . "\n";
                echo 'big: \'' . getCustomSizedImageMaxSpace(getOption('gslideshow_bigsize'), getOption('gslideshow_bigsize')) . '\',' . "\n";
                echo 'title: \'' . html_encode($image->getTitle()) . '\',' . "\n";
                $desc = $image->getDesc();
                $desc = str_replace("\r\n", '<br />', $desc);
                $desc = str_replace("\r", '<br />', $desc);
                echo 'description: \'' . js_encode($desc) . '\',' . "\n";
                echo 'link: \'' . html_encode($image->getLink()) . '\'' . "\n";
                if ($c == $number) {
                    echo '}' . "\n";
                } else {
                    echo '},' . "\n";
                }
            }
            $c++;
        }
        echo "\n";
    }
    ?>
				];
			</script>
			<?php 
    printGalleriaRun($data, $linkslides, $autoplay, $embedded, $forceheight, $imagenumber, $albumtitle, $returnpath);
    restore_context();
    // needed if the slideshow is for example called directly via album object before the next_album loop on index.php
}
Ejemplo n.º 7
0
            ?>
</h3>
							</div>
							<i class="fa fa-angle-up mobile-click-details"></i>
						</div>	
						<?php 
        }
    } else {
        echo '<br /><p>' . gettext('Sorry, no statistical page to show...') . '</p>';
    }
    ?>
					</div>
					
					<?php 
} elseif ($stat_type == 'images') {
    $images = getImageStatistic(25, $stat_option, '', false, 1);
    ?>
					
					<div class="gallery-thumbs">
						<?php 
    if ($images) {
        foreach ($images as $image) {
            ?>
						<div>
							<a href="<?php 
            echo html_encode($image->getLink());
            ?>
" title="<?php 
            echo html_encode($image->getTitle());
            ?>
">
Ejemplo n.º 8
0
				<h2>Description</h2>
				<?php 
printGalleryDesc();
?>
			</div>
			<div class="module">
				<?php 
$selector = getOption('Mini_slide_selector');
?>
				<ul id="randomlist">
					<?php 
switch ($selector) {
    case 'Recent images':
        if (function_exists('getImageStatistic')) {
            echo '<h2>' . gettext('Recent images') . '</h2>';
            $images = getImageStatistic(12, "latest");
            $c = 0;
            foreach ($images as $image) {
                if (is_valid_image($image->filename)) {
                    if ($c++ < 6) {
                        echo "<li><table><tr><td>\n";
                        $imageURL = html_encode(getURL($image));
                        if ($image->getWidth() >= $image->getHeight()) {
                            $iw = 44;
                            $ih = NULL;
                            $cw = 44;
                            $ch = 33;
                        } else {
                            $iw = NULL;
                            $ih = 44;
                            $ch = 44;
Ejemplo n.º 9
0
<?php

include 'inc-header.php';
?>
		
		<?php 
if ($_zp_page == 1) {
    ?>
		<div id="ss-wrap">
			<ul id="cbp-bislideshow" class="cbp-bislideshow">
				<?php 
    $images = getImageStatistic(5, getOption('libratus_ss_type'), getOption('libratus_ss_album'), true);
    foreach ($images as $image) {
        echo '<li>';
        $html = '<img src="' . html_encode(pathurlencode($image->getCustomImage(1200, null, null, null, null, null, null, true))) . '" alt="' . html_encode($image->getTitle()) . '" />';
        echo zp_apply_filter('custom_image_html', $html, false);
        echo '</li>';
    }
    ?>
			</ul>
		<?php 
} else {
    ?>
		<div id="ss-noshow" style="background-image: linear-gradient(rgba(0, 0, 0, 0.75),rgba(0, 0, 0, 0.75)), url(<?php 
    echo $bg;
    ?>
);">
		<?php 
}
?>
			
/**
 * Prints image statistic according to $option as an unordered HTML list
 * A css id is attached by default named accordingly'$option'
 *
 * @param string $number the number of albums to get
 * @param string $option "popular" for the most popular images,
 *                       "latest" for the latest uploaded,
 *                       "latest-date" for the latest uploaded, but fetched by date,
 * 											 "latest-mtime" for the latest uploaded, but fetched by mtime,
 *                       "mostrated" for the most voted,
 *                       "toprated" for the best voted
 * @param string $albumfolder foldername of an specific album
 * @param bool $showtitle if the image title should be shown
 * @param bool $showdate if the image date should be shown
 * @param bool $showdesc if the image description should be shown
 * @param integer $desclength the length of the description to be shown
 * @param string $showstatistic "hitcounter" for showing the hitcounter (views),
 * 															"rating" for rating,
 * 															"rating+hitcounter" for both.
 * @param integer $width the width/cropwidth of the thumb if crop=true else $width is longest size. (Default 85px)
 * @param integer $height the height/cropheight of the thumb if crop=true else not used.  (Default 85px)
 * @param bool $crop 'true' (default) if the thumb should be cropped, 'false' if not
 * @param bool $collection only if $albumfolder is set: true if you want to get statistics from this album and all of its subalbums
 *
 * @return string
 */
function printImageStatistic($number, $option, $albumfolder = '', $showtitle = false, $showdate = false, $showdesc = false, $desclength = 40, $showstatistic = '', $width = 85, $height = 85, $crop = true, $collection = false)
{
    $images = getImageStatistic($number, $option, $albumfolder, $collection);
    echo "\n<div id=\"{$option}\">\n";
    echo "<ul>";
    foreach ($images as $image) {
        echo "<li><a href=\"" . html_encode($image->getImageLink()) . "\" title=\"" . html_encode($image->getTitle()) . "\">\n";
        if ($crop) {
            echo "<img src=\"" . html_encode($image->getCustomImage(NULL, $width, $height, $width, $height, NULL, NULL, TRUE)) . "\" alt=\"" . html_encode($image->getTitle()) . "\" /></a>\n";
        } else {
            echo "<img src=\"" . html_encode($image->getCustomImage($width, NULL, NULL, NULL, NULL, NULL, NULL, TRUE)) . "\" alt=\"" . html_encode($image->getTitle()) . "\" /></a>\n";
        }
        if ($showtitle) {
            echo "<h3><a href=\"" . html_encode($image->getImageLink()) . "\" title=\"" . html_encode($image->getTitle()) . "\">\n";
            echo $image->getTitle() . "</a></h3>\n";
        }
        if ($showdate) {
            echo "<p>" . zpFormattedDate(DATE_FORMAT, strtotime($image->getDateTime())) . "</p>";
        }
        if ($showstatistic === "rating" or $showstatistic === "rating+hitcounter") {
            $votes = $image->get("total_votes");
            $value = $image->get("total_value");
            if ($votes != 0) {
                $rating = round($value / $votes, 1);
            }
            echo "<p>" . sprintf(gettext('Rating: %1$u (Votes: %2$u)'), $rating, $votes) . "</p>";
        }
        if ($showstatistic === "hitcounter" or $showstatistic === "rating+hitcounter") {
            $hitcounter = $image->get("hitcounter");
            if (empty($hitcounter)) {
                $hitcounter = "0";
            }
            echo "<p>" . sprintf(gettext("Views: %u"), $hitcounter) . "</p>";
        }
        if ($showdesc) {
            echo shortenContent($image->getDesc(), $desclength, ' (...)');
        }
        echo "</li>";
    }
    echo "</ul></div>\n";
}
Ejemplo n.º 11
0
        ?>
							<?php 
        if (getOption('libratus_stats_images_toprated')) {
            ?>
&nbsp;<a class="stats-more" title="<?php 
            echo gettext('More');
            ?>
" href="<?php 
            echo getCustomPageURL('archive') . '?set=topratedimages';
            ?>
"><i class="fa fa-caret-right"></i></a><?php 
        }
        ?>
						</h5>
						<?php 
        $items = getImageStatistic($number, 'toprated', '', false, 1);
        ?>
						<div class="gallery-thumbs">
						<?php 
        foreach ($items as $item) {
            ?>
							<a href="<?php 
            echo html_encode($item->getLink());
            ?>
" title="<?php 
            echo html_encode($item->getTitle());
            ?>
">
								<?php 
            echo '<img src="' . html_encode(pathurlencode($item->getCustomImage(null, 140, 140, 140, 140, null, null, true))) . '" alt="' . html_encode($item->getTitle()) . "\" />\n<br />";
            ?>
Ejemplo n.º 12
0
</language>
<pubDate><?php 
echo date("r", time());
?>
</pubDate>
<lastBuildDate><?php 
echo date("r", time());
?>
</lastBuildDate>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<generator>ZenPhoto RSS Generator</generator>
	<?php 
if ($rssmode == "albums") {
    $result = getAlbumStatistic($items, getOption("feed_sortorder_albums"), $albumfolder);
} else {
    $result = getImageStatistic($items, getOption("feed_sortorder"), $albumfolder, $collection);
}
foreach ($result as $item) {
    if ($rssmode != "albums") {
        $ext = strtolower(strrchr($item->filename, "."));
        $albumobj = $item->getAlbum();
        $itemlink = $host . WEBPATH . $albumpath . pathurlencode($albumobj->name) . $imagepath . pathurlencode($item->filename) . $modrewritesuffix;
        $fullimagelink = $host . WEBPATH . "/albums/" . pathurlencode($albumobj->name) . "/" . $item->filename;
        $imagefile = "albums/" . $albumobj->name . "/" . $item->filename;
        $thumburl = '<img border="0" src="' . $protocol . '://' . $host . $item->getCustomImage($size, NULL, NULL, NULL, NULL, NULL, NULL, TRUE) . '" alt="' . get_language_string(get_language_string($item->get("title"), $locale)) . '" />';
        $itemcontent = '<![CDATA[<a title="' . html_encode(get_language_string($item->get("title"), $locale)) . ' in ' . html_encode(get_language_string($albumobj->get("title"), $locale)) . '" href="' . $protocol . '://' . $itemlink . '">' . $thumburl . '</a>' . get_language_string(get_language_string($item->get("desc"), $locale)) . ']]>';
        $videocontent = '<![CDATA[<a title="' . html_encode(get_language_string($item->get("title"), $locale)) . ' in ' . html_encode(get_language_string($albumobj->getTitle(), $locale)) . '" href="' . $protocol . '://' . $itemlink . '"><img src="' . $protocol . '://' . $host . $item->getThumb() . '" alt="' . get_language_string(get_language_string($item->get("title"), $locale)) . '" /></a>' . get_language_string(get_language_string($item->get("desc"), $locale)) . ']]>';
        $datecontent = '<![CDATA[Date: ' . zpFormattedDate(DATE_FORMAT, $item->get('mtime')) . ']]>';
    } else {
        $galleryobj = new Gallery();
        $albumitem = new Album($galleryobj, $item['folder']);
Ejemplo n.º 13
0
			</div>
	
			<div id="alt-thumbs" class="withsidebar">
				<?php 
if (is_numeric($zpgal_archivecount)) {
    $archivecount = $zpgal_archivecount;
} else {
    $archivecount = 12;
}
?>
				<ul class="alt-thumbs">
					<?php 
if ($zpgal_archiveoption != 'random') {
    ?>
					<?php 
    $images = getImageStatistic($archivecount, $zpgal_archiveoption);
    foreach ($images as $image) {
        ?>
					<li style="width:<?php 
        echo getOption('thumb_size');
        ?>
px;height:<?php 
        echo getOption('thumb_size');
        ?>
px;">
						<a href="<?php 
        echo html_encode($image->getLink());
        ?>
" title="<?php 
        echo html_encode($image->getTitle());
        ?>