/**
 * Prints the read more link or if using CombiNews feature also the link to the image.php gallery page as a full html link
 *
 * @param string $readmore The readmore text to be shown for the full news article link. If empty the option setting is used.
 * @return string
 * @deprecated
 */
function printNewsReadMoreLink($readmore = '')
{
    deprecated_function_notify(gettext('Functionality is now included in getNewsContent(), printNewsContent() and getContentShorten() to properly cover custom shortening via TinyMCE <pagebreak>.'), E_USER_NOTICE);
    $readmore = getNewsReadMore($readmore);
    if (!empty($readmore)) {
        if (is_NewsType("news")) {
            $newsurl = getNewsURL(getNewsTitleLink());
        } else {
            $newsurl = html_encode(getNewsTitleLink());
        }
        echo "<a href='" . $newsurl . "' title=\"" . getBareNewsTitle() . "\">" . html_encode($readmore) . "</a>";
    }
}
/**
 * Prints the statistics Zenpage items as an unordered list
 *
 * @param int $number The number of news items to get
 * @param string $option "all" pages and articles
 * 											 "news" for news articles
 * 											 "pages" for pages
 * @param string $mode "popular" most viewed for pages, news articles and categories
 * 										 "mostrated" for news articles and pages
 * 										 "toprated" for news articles and pages
 * 										 "random" for pages, news articles and categories
 * @param bool $showstats if the value should be shown
 * @param bool $showtype if the type should be shown
 * @param bool $showdate if the date should be shown (news articles and pages only)
 * @param bool $showcontent if the content should be shown (news articles and pages only)
 * @param bool $contentlength The shortened lenght of the content
 * @param string $sortdir "asc" for ascending or "desc" for descending (default)
 */
function printZenpageStatistic($number = 10, $option = "all", $mode = "popular", $showstats = true, $showtype = true, $showdate = true, $showcontent = true, $contentlength = 40, $sortdir = 'desc')
{
    $stats = getZenpageStatistic($number, $option, $mode);
    $contentlength = sanitize_numeric($contentlength);
    switch ($mode) {
        case 'popular':
            $cssid = "'zenpagemostpopular'";
            break;
        case 'mostrated':
            $cssid = "'zenpagemostrated'";
            break;
        case 'toprated':
            $cssid = "'zenpagetoprated'";
            break;
        case 'random':
            $cssid = "'zenpagerandom'";
            break;
    }
    echo "<ul id={$cssid}>";
    foreach ($stats as $item) {
        switch ($mode) {
            case 'popular':
                $statsvalue = $item['hitcounter'];
                break;
            case 'mostrated':
                $statsvalue = $item['total_votes'];
                break;
            case 'toprated':
                $statsvalue = $item['rating'];
                break;
        }
        switch ($item['type']) {
            case 'Page':
                $titlelink = html_encode(getPageURL($item['titlelink']));
            case 'News':
                $titlelink = html_encode(getNewsURL($item['titlelink']));
                break;
            case 'Category':
                $titlelink = html_encode(getNewsCategoryURL($item['titlelink']));
                break;
        }
        echo '<li><a href = "' . $titlelink . '" title = "' . html_encode(getBare($item['title'])) . '"><h3>' . $item['title'];
        echo '<small>';
        if ($showtype) {
            echo ' [' . $item['type'] . ']';
        }
        if ($showstats && ($item['type'] != 'Category' && $mode != 'mostrated' && $mode != 'toprated')) {
            echo ' (' . $statsvalue . ')';
        }
        echo '</small>';
        echo '</h3></a>';
        if ($showdate && $item['type'] != 'Category') {
            echo "<p>" . zpFormattedDate(DATE_FORMAT, strtotime($item['date'])) . "</p>";
        }
        if ($showcontent && $item['type'] != 'Category') {
            echo '<p>' . truncate_string($item['content'], $contentlength) . '</p>';
        }
        echo '</li>';
    }
    echo '</ul>';
}
Example #3
0
/**
 * Prints the link to an news entry
 */
function jqm_getLink()
{
    $link = getNewsURL();
    return $link;
}
Example #4
0
?>

<?php 
if (extensionEnabled('zenpage')) {
    ?>
	<div class="menu">
		<h3><?php 
    echo gettext("Latest notes");
    ?>
</h3>
		<ul>
			<?php 
    $latest = getLatestNews(3);
    foreach ($latest as $item) {
        $title = htmlspecialchars(get_language_string($item['title']));
        $link = getNewsURL($item['titlelink']);
        echo "<li><a href=\"" . $link . "\" title=\"" . strip_tags(htmlspecialchars($title, ENT_QUOTES)) . "\">" . htmlspecialchars($title) . "</a></li>";
    }
    ?>
		</ul>
	</div>
<?php 
}
?>

<div class="menu">
	<h3><?php 
echo gettext("Toolbox");
?>
</h3>
	<ul>
Example #5
0
    $thumb = $img->getCustomImage(NULL, 75, 75, 75, 75, NULL, NULL, false);
    $link = $img->getLink();
    echo "<span class='thumb" . ($u == count($images) - 1 ? " last" : "") . "'>" . "<img class='pin' src='{$_zp_themeroot}/resources/images/pin.png'/><br/>" . "<a href='{$link}'><img src='{$thumb}' width='75' height='75'/></a>" . "</span>";
}
?>
	<div class="browse"><a href="<?php 
echo getGalleryIndexURL();
?>
" class="gallery">Browse gallery</a></div>
</div>

<div id="latest-news">
<?php 
$news = getLatestNews(1);
foreach ($news as $n) {
    $link = getNewsURL($n['titlelink']);
    ?>
			
	<div class="news">
		<div class="news-header"> 
			<div class="news-date-placeholder">
				<span class="left">Latest note: <a href="<?php 
    echo $link;
    ?>
"><?php 
    echo $n['title'];
    ?>
</a></span>
				<div class="opa40 right"><b>: </b><?php 
    echo zpFormattedDate('%Y %b, %e', strtotime($n['date']));
    ?>
Example #6
0
					<div align="center"><?php 
    if (function_exists('zenFBComments')) {
        zenFBComments();
    }
    ?>
</div><?php 
} else {
    printNewsPageListWithNav(gettext('next »'), gettext('« prev'));
    echo "<hr />";
    // news article loop
    while (next_news()) {
        ?>
						<div class="newsarticle">
							<h3><?php 
        printNewsURL();
        echo " <span class='newstype'>[" . getNewsURL() . "]</span>";
        ?>
</h3>
							<div class="newsarticlecredit"><span class="newsarticlecredit-left"><?php 
        printNewsDate();
        ?>
 | <?php 
        echo gettext("Comments:");
        ?>
 <?php 
        echo getCommentCount();
        ?>
</span>
							<?php 
        if (is_NewsPage()) {
            echo "<br />";
Example #7
0
/**
 * Displays a list of all news in zenphoto
 *
 */
function newsListDisplay()
{
    while (next_news()) {
        ?>
		<div class="newslist_article">
			<div class="newslist_title">
				<span class="italic date_news"><?php 
        printNewsDate();
        ?>
</span>
				<h4><?php 
        printNewsURL();
        ?>
</h4>
				<div class="newslist_detail">
					<div class="italic newslist_type">
						<?php 
        $cat = getNewsCategories();
        if (!empty($cat)) {
            printNewsCategories(", ", gettext("Categories: "), "newslist_categories");
        }
        ?>
					</div>
				</div>
			</div>
			<div class="newslist_content">
				<?php 
        printCodeblock(1);
        ?>
				<?php 
        printNewsContent();
        ?>
				<?php 
        printCodeblock(2);
        ?>
				<?php 
        if (getNewsReadMore()) {
            ?>
					<p class="italic newslist_readmore">
						<?php 
            $readmore = getNewsReadMore($readmore);
            if (!empty($readmore)) {
                $newsurl = getNewsURL();
                echo "<a href='" . $newsurl . "' title=\"" . getBareNewsTitle() . "\">" . html_encode($readmore) . "</a>";
            }
            ?>
					</p>
				<?php 
        }
        ?>
			</div>
		</div>
		<?php 
    }
}
/**
 * Prints out latest comments for news articles and pages as a unordered list
 *
 * @param int $number how many comments you want.
 * @param string $shorten the number of characters to shorten the comment display
 * @param string $id The css id to style the list
 * @param string $type 	"all" for all latest comments for all news articles and all pages
 * 											"news" for the lastest comments of one specific news article
 * 											"page" for the lastest comments of one specific page
 * @param int $itemID the ID of the element to get the comments for if $type != "all"
 */
function printLatestZenpageComments($number, $shorten = '123', $id = 'showlatestcomments', $type = "all", $itemID = "")
{
    if (empty($class)) {
        $id = "";
    } else {
        $id = "id='" . $id . " ";
    }
    $comments = getLatestZenpageComments($number, $type, $itemID);
    echo "<ul {$id}>\n";
    foreach ($comments as $comment) {
        if ($comment['anon']) {
            $author = "";
        } else {
            $author = " " . gettext("by") . " " . $comment['name'];
        }
        $date = $comment['date'];
        $title = get_language_string($comment['title']);
        $titlelink = $comment['titlelink'];
        $website = $comment['website'];
        $shortcomment = truncate_string($comment['comment'], $shorten);
        $url = "";
        switch ($comment['type']) {
            case "news":
                $url = getNewsURL($titlelink);
                break;
            case "pages":
                $url = getPageLinkURL($titlelink);
                break;
        }
        echo "<li><a href=\"" . html_encode($url) . "\" class=\"commentmeta\">" . $title . $author . "</a><br />\n";
        echo "<span class=\"commentbody\">" . $shortcomment . "</span></li>";
    }
    echo "</ul>\n";
}
Example #9
0
function printLatestNewsCustom($number = 5, $category = '', $showdate = true, $showcontent = true, $contentlength = 70, $showcat = true)
{
    global $_zp_gallery, $_zp_current_article;
    $latest = getLatestNews($number, $category);
    echo "\n<div id=\"latestnews-spotlight\">\n";
    $count = "";
    foreach ($latest as $item) {
        $count++;
        $category = "";
        $categories = "";
        $obj = newArticle($item['titlelink']);
        $title = htmlspecialchars($obj->getTitle());
        $link = getNewsURL($item['titlelink']);
        $count2 = 0;
        $category = $obj->getCategories();
        foreach ($category as $cat) {
            $catobj = new Category($cat['titlelink']);
            $count2++;
            if ($count2 != 1) {
                $categories = $categories . "; ";
            }
            $categories = $categories . $catobj->getTitle();
        }
        $content = strip_tags($obj->getContent());
        $date = zpFormattedDate(getOption('date_format'), strtotime($item['date']));
        $type = 'news';
        echo "<div>";
        echo "<h3><a href=\"" . $link . "\" title=\"" . strip_tags(htmlspecialchars($title, ENT_QUOTES)) . "\">" . htmlspecialchars($title) . "</a></h3>\n";
        echo "<div class=\"newsarticlecredit\">\n";
        echo "<span class=\"latestnews-date\">" . $date . "</span>\n";
        echo "<span class=\"latestnews-cats\">| Posted in " . $categories . "</span>\n";
        echo "</div>\n";
        echo "<p class=\"latestnews-desc\">" . html_encode(getContentShorten($content, $contentlength, '(...)', null, null)) . "</p>\n";
        echo "</div>\n";
        if ($count == $number) {
            break;
        }
    }
    echo "</div>\n";
}
Example #10
0
echo zpFormattedDate('%b', $dt);
?>
</span>
			<span class="day"><?php 
echo date('jS', $dt);
?>
</span>
		</div>
		<div class="news-info">
			<div class="news-title"><?php 
echo getNewsTitle();
?>
</div>
			<div class="news-categories">In: <?php 
printNewsCategories(',', false, false);
?>
</div>
		</div>
	</div>
	<div class="news-content">
		<?php 
$c = getNewsContent();
if (defined('CROP_NEWS')) {
    $c = Utils::crop($c, 200, '<p><a>', '<a href="' . getNewsURL(getNewsTitleLink()) . '">(...)</a>');
}
echo $c;
?>
	</div>
</div>

Example #11
0
				</div>
				<div id="gallery_title">
					<?php 
echo getGalleryTitleHeader();
?>
				</div>
			</div>
			<div id="breadcrumb">
				<ul>
				<?php 
getFormattedMainSiteName('<li class="page">', '</li><li class="chevron"> > </li>');
echo '<li><a href="' . getGalleryIndexURL() . '">' . getBareGalleryTitle() . '</a></li>';
echo '<li class="chevron"><a> &gt; </a></li>';
echo '<li><a';
if (is_NewsArticle()) {
    echo ' href="' . getNewsURL() . '">News</a></li><li class="chevron"><a> &gt; </a></li><li><a>' . strip_tags(getNewsTitle());
} else {
    echo '>News';
}
echo '</a></li>';
?>
				</ul>
			</div>
			<div id="menu">
				<?php 
printThemeMenu();
?>
			</div>
			<div id="content" class="c">
				<div id="news">
					<div>
Example #12
0
/**
 * @deprecated
 * @since 1.4.6
 */
function getNewsLink($titlelink = '')
{
    deprecated_functions::notify(gettext('use getNewsURL()'));
    return getNewsURL($titlelink);
    global $_zp_current_zenpage_news;
}
Example #13
0
 private function getNewsBlock($newsobj, $current = FALSE)
 {
     $cls = $current ? 'current' : 'link';
     if (!isset($newsobj)) {
         return "<td class='empty'>" . "<div class='info'>" . "<div class='title'>" . "&nbsp;" . "</div>" . "<div class='date'>&nbsp;</div>" . "</div>" . "</td>";
     } else {
         $link = $newsobj->getTitleLink();
         return "<td class='{$cls}'>" . "<div class='info'>" . "<div class='title'>" . "<a href='" . getNewsURL($newsobj->getTitlelink()) . "' link='{$link}'>" . $newsobj->getTitle() . "</a>" . "</div>" . "<div class='date'>" . date('Y M, \\t\\h\\e jS', strtotime($newsobj->getDateTime())) . "</div>" . "</div>" . "</td>";
     }
 }
Example #14
0
            } else {
                $title = $category . ": " . $title;
            }
            $commentpath = $protocol . '://' . $host . WEBPATH . $albumpath . $album . $imagetag . "#" . $comment['id'];
            break;
        case 'news':
        case 'pages':
            $album = '';
            $date = $comment['date'];
            $category = '';
            $title = get_language_string($comment['title']);
            $titlelink = $comment['titlelink'];
            $website = $comment['website'];
            if (function_exists('getNewsURL')) {
                if ($comment['type'] == 'news') {
                    $commentpath = $protocol . '://' . $host . getNewsURL($titlelink) . "#" . $comment['id'];
                } else {
                    $commentpath = $protocol . '://' . $host . getPageLinkURL($titlelink) . "#" . $comment['id'];
                }
            } else {
                $commentpath = '';
            }
            break;
    }
    ?>
<item>
<title><?php 
    echo html_encode(strip_tags($title . $author));
    ?>
</title>
<link><?php 
Example #15
0
        break;
    case "withimages":
        $latest = getLatestNews($items, "with_latest_images_date");
        break;
}
$count = "";
foreach ($latest as $item) {
    $count++;
    $category = "";
    $categories = "";
    //get the type of the news item
    switch ($item['type']) {
        case 'news':
            $obj = new ZenpageNews($item['titlelink']);
            $title = get_language_string($obj->get('title'), $locale);
            $link = getNewsURL($obj->getTitlelink());
            $count2 = 0;
            $category = $obj->getCategories();
            foreach ($category as $cat) {
                $count2++;
                if ($count2 != 1) {
                    $categories = $categories . ", ";
                }
                $categories = $categories . get_language_string($cat['titlelink'], $locale);
            }
            $thumb = "";
            $filename = "";
            if (getOption('zenpage_rss_length') != "") {
                // empty value means full content!
                $content = shortenContent(get_language_string($obj->get('content'), $locale), getOption('zenpage_rss_length'), $elipsis = '...');
            }