/** * 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>"; } }
echo " <span class='newstype'>[" . getNewsType() . "]</span>"; ?> </h3> <div class="newsarticlecredit"><span class="newsarticlecredit-left"><?php printNewsDate(); ?> | <?php echo gettext("Comments:"); ?> <?php echo getCommentCount(); ?> </span> <?php if (is_GalleryNewsType()) { if (!is_NewsType("album")) { echo " | " . gettext("Album:") . "<a href='" . getNewsAlbumURL() . "' title='" . getBareNewsAlbumTitle() . "'> " . getNewsAlbumTitle() . "</a>"; } else { echo "<br />"; } } else { printNewsCategories(", ", gettext("Categories: "), "newscategories"); } ?> </div> <?php printNewsContent(); ?> <?php printCodeblock(1); ?>
static function printNewsCategories($separator = '', $link = true, $print = true) { $text = ''; $categories = getNewsCategories(); $catcount = count($categories); if ($catcount != 0) { if (is_NewsType("news")) { $count = 0; foreach ($categories as $cat) { $count++; $catname = get_language_string($cat['cat_name']); if ($count >= $catcount) { $separator = ""; } else { $separator = ", "; } $url = getNewsCategoryURL($cat['cat_link']); $text .= ($link ? "<a href='{$url}'>" : "") . $catname . ($link ? "</a>" : "") . $separator; } } } if ($print) { echo $text; } return $text; }
/** * Prints the categories of current article as a unordered html list * * @param string $separator A separator to be shown between the category names if you choose to style the list inline * @param string $class The CSS class for styling * @return string */ function printNewsCategories($separator = '', $before = '', $class = '') { $categories = getNewsCategories(); $catcount = count($categories); if ($catcount != 0) { if (is_NewsType("news")) { echo $before . "<ul class=\"{$class}\">\n"; $count = 0; foreach ($categories as $cat) { $count++; $catobj = new ZenpageCategory($cat['titlelink']); if ($count >= $catcount) { $separator = ""; } echo "<li><a href=\"" . getNewsCategoryURL($catobj->getTitlelink()) . "\" title=\"" . html_encode($catobj->getTitle()) . "\">" . $catobj->getTitle() . '</a>' . html_encode($separator) . "</li>\n"; } echo "</ul>\n"; } } }