本文整理汇总了PHP中getNewsCategories函数的典型用法代码示例。如果您正苦于以下问题:PHP getNewsCategories函数的具体用法?PHP getNewsCategories怎么用?PHP getNewsCategories使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getNewsCategories函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: printNewsTitle
<?php
if (getPrevNewsURL() or getPrevNewsURL()) {
?>
<br class="clearall" /><?php
}
?>
<h3><?php
printNewsTitle();
?>
</h3>
<div class="newsarticlecredit">
<span class="newsarticlecredit-left">
<?php
$count = @call_user_func('getCommentCount');
$cat = getNewsCategories();
printNewsDate();
if ($count > 0) {
echo ' | ';
printf(gettext("Comments: %d"), $count);
}
if (!empty($cat)) {
echo ' | ';
}
?>
</span>
<?php
if (!empty($cat)) {
printNewsCategories(", ", gettext("Categories: "), "newscategories");
}
?>
开发者ID:jurgenoosting,项目名称:zenphoto,代码行数:31,代码来源:news.php
示例2: printNewsCategories
/**
* 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 ($before) {
echo '<span class="beforetext">' . html_encode($before) . '</span>';
}
echo "<ul class=\"{$class}\">\n";
$count = 0;
if ($separator) {
$separator = '<span class="betweentext">' . html_encode($separator) . '</span>';
}
foreach ($categories as $cat) {
$count++;
$catobj = new ZenpageCategory($cat['titlelink']);
if ($count >= $catcount) {
$separator = "";
}
echo "<li><a href=\"" . $catobj->getLink() . "\" title=\"" . html_encode($catobj->getTitle()) . "\">" . $catobj->getTitle() . '</a>' . $separator . "</li>\n";
}
echo "</ul>\n";
}
}
开发者ID:rauldobrota,项目名称:zenphoto,代码行数:31,代码来源:zenpage-template-functions.php
示例3: html_encode
echo html_encode(getNewsTitle());
?>
</h3>
<?php
if (function_exists('zenFBLike')) {
zenFBLike();
}
?>
<div class="date">
<?php
echo gettext('Written by ') . getNewsAuthor() . gettext(' on ') . getNewsDate();
?>
</div>
</div>
<?php
if (getNewsCategories()) {
echo '<div class="tagsList">';
printNewsCategories(", ", gettext("Categories: "), "newslist_categories");
echo '</div>';
}
if (function_exists('printRating')) {
echo '<div class="clear ratings">';
printRating();
echo '</div>';
}
?>
</div>
<div id="news">
<?php
printCodeblock(1);
printNewsContent();
开发者ID:Imagenomad,项目名称:Unsupported,代码行数:31,代码来源:news.php
示例4: getMetaKeywords
/**
* Helper function to list tags/categories as keywords separated by comma.
*
* @param array $array the array of the tags or categories to list
*/
private static function getMetaKeywords()
{
global $_zp_gallery, $_zp_current_album, $_zp_current_image, $_zp_current_zenpage_news, $_zp_current_zenpage_page, $_zp_current_category, $_zp_gallery_page, $_zp_zenpage;
$words = '';
if (is_object($_zp_current_album) or is_object($_zp_current_image)) {
$tags = getTags();
$words .= htmlmetatags::getMetaAlbumAndImageTags($tags, "gallery");
} else {
if ($_zp_gallery_page === "index.php") {
$tags = array_keys(getAllTagsCount(true));
// get all if no specific item is set
$words .= htmlmetatags::getMetaAlbumAndImageTags($tags, "gallery");
}
}
if (extensionEnabled('zenpage')) {
if (is_NewsArticle()) {
$tags = getNewsCategories(getNewsID());
$words .= htmlmetatags::getMetaAlbumAndImageTags($tags, "zenpage");
$tags = getTags();
$words = $words . "," . htmlmetatags::getMetaAlbumAndImageTags($tags, "gallery");
} else {
if (is_Pages()) {
$tags = getTags();
$words = htmlmetatags::getMetaAlbumAndImageTags($tags, "gallery");
} else {
if (is_News()) {
$tags = $_zp_zenpage->getAllCategories();
$words .= htmlmetatags::getMetaAlbumAndImageTags($tags, "zenpage");
} else {
if (is_NewsCategory()) {
$words .= $_zp_current_category->getTitle();
}
}
}
}
}
return $words;
}
开发者ID:rb26,项目名称:zenphoto,代码行数:43,代码来源:html_meta_tags.php
示例5: jqm_printNewsCategories
/**
* Prints the categories of current article as a unordered html list WITHOUT links
*
* @param string $separator A separator to be shown between the category names if you choose to style the list inline
*/
function jqm_printNewsCategories($separator = '', $class = '')
{
$categories = getNewsCategories();
$catcount = count($categories);
if ($catcount != 0) {
echo "<ul class=\"{$class}\">\n";
$count = 0;
foreach ($categories as $cat) {
$count++;
$catobj = new ZenpageCategory($cat['titlelink']);
if ($count >= $catcount) {
$separator = "";
}
echo "<li>" . $catobj->getTitle() . "</li>\n";
}
echo "</ul>\n";
}
}
开发者ID:rauldobrota,项目名称:zenphoto,代码行数:23,代码来源:functions.php
示例6: commonNewsLoop
function commonNewsLoop($paged)
{
$newstypes = array('album' => gettext('album'), 'image' => gettext('image'), 'video' => gettext('video'), 'news' => gettext('news'));
while (next_news()) {
$newstypedisplay = gettext('news');
if (stickyNews()) {
$newstypedisplay .= ' <small><em>' . gettext('sticky') . '</em></small>';
}
?>
<div class="newsarticle<?php
if (stickyNews()) {
echo ' sticky';
}
?>
">
<h3><?php
printNewsURL();
echo " <span class='newstype'>[" . $newstypedisplay . "]</span>";
?>
</h3>
<div class="newsarticlecredit">
<span class="newsarticlecredit-left">
<?php
$count = @call_user_func('getCommentCount');
$cat = getNewsCategories();
printNewsDate();
if ($count > 0) {
echo ' | ';
printf(gettext("Comments: %d"), $count);
}
?>
</span>
<?php
if (!empty($cat)) {
echo ' | ';
printNewsCategories(", ", gettext("Categories: "), "newscategories");
}
?>
</div> <!-- newsarticlecredit -->
<?php
printCodeblock(1);
?>
<?php
printNewsContent();
?>
<?php
printCodeblock(2);
?>
<br class="clearall" />
</div>
<?php
}
if ($paged) {
printNewsPageListWithNav(gettext('next »'), gettext('« prev'), true, 'pagelist', true);
}
}
开发者ID:rb26,项目名称:zenphoto,代码行数:56,代码来源:functions.php
示例7: printNewsCategories
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;
}
开发者ID:Imagenomad,项目名称:Unsupported,代码行数:26,代码来源:NewsUtil.php
示例8: commonNewsLoop
function commonNewsLoop($paged)
{
$newstypes = array('album' => gettext('album'), 'image' => gettext('image'), 'video' => gettext('video'), 'news' => gettext('news'));
while (next_news()) {
$newstype = getNewsType();
$newstypedisplay = $newstypes[$newstype];
if (stickyNews()) {
$newstypedisplay .= ' <small><em>' . gettext('sticky') . '</em></small>';
}
?>
<div class="newsarticle<?php
if (stickyNews()) {
echo ' sticky';
}
?>
">
<h3><?php
printNewsTitleLink();
echo " <span class='newstype'>[" . $newstypedisplay . "]</span>";
?>
</h3>
<div class="newsarticlecredit">
<span class="newsarticlecredit-left">
<?php
$count = getCommentCount();
$cat = getNewsCategories();
printNewsDate();
if ($count > 0) {
echo ' | ';
printf(gettext("Comments: %d"), $count);
}
?>
</span>
<?php
if (is_GalleryNewsType()) {
echo ' | ' . gettext("Album:") . " <a href='" . getNewsAlbumURL() . "' title='" . getBareNewsAlbumTitle() . "'>" . getNewsAlbumTitle() . "</a>";
} else {
if (!empty($cat) && !in_context(ZP_ZENPAGE_NEWS_CATEGORY)) {
echo ' | ';
printNewsCategories(", ", gettext("Categories: "), "newscategories");
}
}
?>
</div> <!-- newsarticlecredit -->
<br clear="all" />
<?php
printCodeblock(1);
?>
<?php
printNewsContent();
?>
<?php
printCodeblock(2);
?>
<br clear="all" />
</div>
<?php
}
if ($paged) {
printNewsPageListWithNav(gettext('next »'), gettext('« prev'), true, 'pagelist', true);
}
}
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:62,代码来源:functions.php
示例9: printNewsCategories
/**
* 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";
}
}
}
开发者ID:hatone,项目名称:zenphoto-1.4.1.4,代码行数:27,代码来源:zenpage-template-functions.php
示例10: newsListDisplay
/**
* 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
}
}
开发者ID:Imagenomad,项目名称:Unsupported,代码行数:59,代码来源:functions.php
注:本文中的getNewsCategories函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论