/**
 * Gets the author of a news article (if in Combinews mode for gallery items the owner)
 *
 * @return string
 */
function getNewsAuthor($fullname = false)
{
    global $_zp_current_zenpage_news;
    if (is_News()) {
        return getAuthor($fullname);
    }
    return false;
}
예제 #2
0
 /**
  * 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;
 }
/**
 * @deprecated
 * Enter description here ...
 * @param $mode
 * @param $obj
 */
function getZenpageHitcounter($mode = "", $obj = NULL)
{
    deprecated_function_notify(gettext('Use getHitcounter().'));
    global $_zp_current_zenpage_news, $_zp_current_zenpage_page, $_zp_gallery_page, $_zp_current_category;
    switch ($mode) {
        case "news":
            if ((is_NewsArticle() or is_News()) and !is_object($obj)) {
                $obj = $_zp_current_zenpage_news;
                $hc = $obj->get('hitcounter');
            } else {
                if (is_object($obj)) {
                    $hc = $obj->get('hitcounter');
                } else {
                    $hc = 0;
                }
            }
            return $hc;
            break;
        case "page":
            if (is_Pages() and !is_object($obj)) {
                $obj = $_zp_current_zenpage_page;
                $hc = $obj->get('hitcounter');
            } else {
                if (is_object($obj)) {
                    $hc = $obj->get('hitcounter');
                } else {
                    $hc = 0;
                }
            }
            return $hc;
            break;
        case "category":
            if (!is_object($obj) || is_NewsCategory() and !empty($obj)) {
                $obj = $_zp_current_category;
                $hc = $obj->get('hitcounter');
            } else {
                if (is_object($obj)) {
                    $hc = $obj->get('hitcounter');
                } else {
                    $hc = 0;
                }
            }
            return $hc;
            break;
    }
}
/**
 * Gets the author of a news article
 *
 * @return string
 */
function getNewsAuthor($fullname = false)
{
    if (is_News() and is_NewsType("news")) {
        return getAuthor($fullname);
    }
}
예제 #5
0
/**
 * Gets the author of a news article (if in Combinews mode for gallery items the owner)
 *
 * @return string
 */
function getNewsAuthor($fullname = false)
{
    if (is_News()) {
        return getAuthor($fullname);
    }
    return false;
}
/**

* Retuns the count of comments on the current image
*
* @return int
*/
function getCommentCount()
{
    global $_zp_current_image, $_zp_current_album, $_zp_current_zenpage_page, $_zp_current_zenpage_news;
    if (in_context(ZP_IMAGE) && in_context(ZP_ALBUM)) {
        if (is_null($_zp_current_image)) {
            return false;
        }
        return $_zp_current_image->getCommentCount();
    } else {
        if (!in_context(ZP_IMAGE) && in_context(ZP_ALBUM)) {
            if (is_null($_zp_current_album)) {
                return false;
            }
            return $_zp_current_album->getCommentCount();
        }
    }
    if (function_exists('is_News')) {
        if (is_News()) {
            return $_zp_current_zenpage_news->getCommentCount();
        }
        if (is_Pages()) {
            return $_zp_current_zenpage_page->getCommentCount();
        }
    }
}