function main()
 {
     if ($this->page) {
         $arr = static_parse($this->page);
         if (THEME_LEGACY_MODE) {
             theme_entry_filters($arr, null);
         }
         $this->smarty->assign('entry', $arr);
     } else {
         return 1;
     }
 }
 function _makePreview($arr, $id = null)
 {
     if (!$id) {
         $arr['subject'] = apply_filters('title_save_pre', $arr['subject']);
         $arr['content'] = apply_filters('content_save_pre', $arr['content']);
     }
     $this->smarty->assign('post', $arr);
     if (THEME_LEGACY_MODE) {
         theme_entry_filters($arr, $id);
     }
     $arr = array_change_key_case($arr, CASE_LOWER);
     $this->smarty->assign('entry', $arr);
     $this->smarty->assign('preview', true);
     $this->smarty->assign('id', $id);
 }
 function main()
 {
     global $fpdb;
     if (isset($_REQUEST['entry'])) {
         $id = $_REQUEST['entry'];
         if ($a = entry_parse($id)) {
         } else {
             $a = draft_parse($id);
         }
         if ($a) {
             if (THEME_LEGACY_MODE) {
                 theme_entry_filters($a, $id);
             }
             $this->smarty->assign('entry', $a);
             $this->smarty->assign('id', $id);
             return 0;
         }
     }
     return 1;
 }
Example #4
0
 function _makePreview($arr, $id = null)
 {
     if (!$id) {
         $arr['subject'] = apply_filters('title_save_pre', $arr['subject']);
         $arr['content'] = apply_filters('content_save_pre', $arr['content']);
     }
     if ($this->draft || ($this->draft = draft_exists($this->id))) {
         if (isset($arr['categories']) && is_array($arr['categories']) && !in_array('draft', $arr['categories'])) {
             $arr['categories'][] = 'draft';
         } else {
             $arr['categories'][] = 'draft';
         }
     }
     // unfiltered content (for editing)
     $this->smarty->assign('post', $arr);
     if (THEME_LEGACY_MODE) {
         theme_entry_filters($arr, $id);
     }
     // content for preview
     $this->smarty->assign('entry', $arr);
     $this->smarty->assign('preview', true);
 }
Example #5
0
function smarty_block_entry($params, $content, &$smarty, &$repeat)
{
    global $fpdb;
    // clean old variables
    $smarty->assign(array('subject' => '', 'content' => '', 'categories' => array(), 'filed_under' => '', 'date' => '', 'author' => '', 'version' => '', 'ip-address' => ''));
    if (isset($params['content']) && is_array($params['content']) && $params['content']) {
        //foreach ($params['entry'] as $k => $val)
        $smarty->assign($params['content']);
        return $content;
    }
    if (isset($params['alwaysshow']) && $params['alwaysshow']) {
        return $content;
    }
    $q =& $fpdb->getQuery();
    if ($repeat = $q->hasMore()) {
        $couplet =& $q->getEntry();
        $id =& $couplet[0];
        $entry =& $couplet[1];
        if (THEME_LEGACY_MODE) {
            $entry = theme_entry_filters($entry, $id);
        }
        foreach ($entry as $k => $v) {
            $smarty->assign_by_ref($k, $entry[$k]);
        }
        $smarty->assign_by_ref('id', $id);
        $smarty->assign('entry_commslock', @in_array('commslock', $entry['categories']));
        do_action('entry_block', $id);
    }
    return $content;
}
Example #6
0
function smarty_block_static($params, $content, &$smarty, &$repeat)
{
    global $fpdb;
    static $pointer = 0;
    // clean old variables
    $smarty->assign(array('subject' => '', 'content' => '', 'date' => '', 'author' => '', 'version' => '', 'id' => ''));
    if ($arr = $smarty->get_template_vars('static_page')) {
        $smarty->assign('id', $smarty->get_template_vars('static_id'));
        if (THEME_LEGACY_MODE) {
            theme_entry_filters($arr);
        }
        $smarty->assign($arr);
        return $content;
    }
    if (isset($params['content']) && is_array($params['content']) && $params['content']) {
        //foreach ($params['entry'] as $k => $val)
        $smarty->assign($params['content']);
        return $content;
    }
    if (isset($params['alwaysshow']) && $params['alwaysshow']) {
        return $content;
    }
    $list = $smarty->get_template_vars('statics');
    if (isset($list[$pointer])) {
        //foreach ($entry as $k => $val)
        $smarty->assign(static_parse($list[$pointer]));
        $smarty->assign('id', $list[$pointer]);
        $pointer++;
        $repeat = true;
    } else {
        $repeat = false;
    }
    return $content;
}