/**
  * Returns the extra content
  *
  * @return string
  */
 function getExtraContent($locale = NULL)
 {
     $text = $this->get("extracontent");
     if ($locale == 'all') {
         return zpFunctions::unTagURLs($text);
     } else {
         return applyMacros(zpFunctions::unTagURLs(get_language_string($text, $locale)));
     }
 }
Example #2
0
 /**
  * Returns the gallery description
  *
  * @return string
  */
 function getDesc($locale = NULL)
 {
     $text = $this->get('Gallery_description');
     if ($locale == 'all') {
         return zpFunctions::unTagURLs($text);
     } else {
         return applyMacros(zpFunctions::unTagURLs(get_language_string($text, $locale)));
     }
     return $text;
 }
/**
 * Gets the content of a codeblock for an image, album or Zenpage newsarticle or page.
 *
 * The priority for codeblocks will be (based on context)
 * 	1: articles
 * 	2: pages
 * 	3: images
 * 	4: albums
 * 	5: gallery.
 *
 * This means, for instance, if we are in ZP_ZENPAGE_NEWS_ARTICLE context we will use the news article
 * codeblock even if others are available.
 *
 * Note: Echoing this array's content does not execute it. Also no special chars will be escaped.
 * Use printCodeblock() if you need to execute script code.
 *
 * @param int $number The codeblock you want to get
 * @param mixed $what optonal object for which you want the codeblock
 *
 * @return string
 */
function getCodeblock($number = 1, $object = NULL)
{
    global $_zp_current_album, $_zp_current_image, $_zp_current_zenpage_news, $_zp_current_zenpage_page, $_zp_gallery, $_zp_gallery_page;
    if (!$number) {
        setOptionDefault('codeblock_first_tab', 0);
    }
    if (!is_object($object)) {
        if ($_zp_gallery_page == 'index.php') {
            $object = $_zp_gallery;
        }
        if (in_context(ZP_ALBUM)) {
            $object = $_zp_current_album;
        }
        if (in_context(ZP_IMAGE)) {
            $object = $_zp_current_image;
        }
        if (in_context(ZP_ZENPAGE_PAGE)) {
            if ($_zp_current_zenpage_page->checkAccess()) {
                $object = $_zp_current_zenpage_page;
            }
        }
        if (in_context(ZP_ZENPAGE_NEWS_ARTICLE)) {
            if ($_zp_current_zenpage_news->checkAccess()) {
                $object = $_zp_current_zenpage_news;
            }
        }
    }
    if (!is_object($object)) {
        return NULL;
    }
    $codeblock = getSerializedArray($object->getcodeblock());
    $codeblock = zp_apply_filter('codeblock', @$codeblock[$number], $object, $number);
    if ($codeblock) {
        $codeblock = applyMacros($codeblock);
    }
    return $codeblock;
}