Ejemplo n.º 1
0
/**
 * Returns the title (name) of the current weblog. It takes one optional 
 * parameter "strip" which if equal to one, will remove all HTML tags from the 
 * output.
 *
 * @param array $params
 * @return string
 */
function smarty_weblogtitle($params)
{
    global $PIVOTX;
    $output = $PIVOTX['weblogs']->get('', 'name');
    if ($params['strip'] == true) {
        $output = strip_tags($output);
    } else {
        if (!empty($params['internal'])) {
            $output = $PIVOTX['weblogs']->getCurrent();
        }
    }
    return entifyAmpersand($output);
}
Ejemplo n.º 2
0
function smarty_gallery_image($params, &$smarty)
{
    global $PIVOTX;
    $params = cleanParams($params);
    $number = getDefault($params['number'], 0);
    $attr = getDefault($params['attr'], 'src');
    $vars = $smarty->get_template_vars();
    $entry = $vars['entry'];
    $page = $vars['page'];
    // Get the images from the Entry or Page..
    $gallery = getDefault($entry['extrafields']['galleryimagelist'], $page['extrafields']['galleryimagelist']);
    $output = "";
    if (!empty($gallery)) {
        $gallery = explode("\n", $gallery);
        $image = trim($gallery[$number]);
        list($image, $title, $alttext) = explode('###', $image);
        if ($attr == 'src') {
            $output = $image;
        } elseif ($attr == 'title') {
            $output = $title;
        } elseif ($attr == 'alttext') {
            $output = $alttext;
        }
    }
    return entifyAmpersand($output);
}