コード例 #1
0
ファイル: shortcode_handler.php プロジェクト: JBeezygit/e107
 /**
  * Empty scvar object data
  * @return e_shortcode
  */
 public function emptyScVars()
 {
     $this->scVars->emptyVars();
     return $this;
 }
コード例 #2
0
ファイル: news_months_menu.php プロジェクト: notzen/e107
    if (!$sql->db_Select("news", "news_id, news_datestamp", "news_class IN (" . USERCLASS_LIST . ") AND news_datestamp > " . intval($start) . " AND news_datestamp < " . intval($end) . " ORDER BY news_datestamp DESC")) {
        e107::getCache()->set($cString, '');
        return '';
    }
    while ($news = $sql->db_Fetch()) {
        $xmonth = date("n", $news['news_datestamp']);
        if (!isset($month_links[$xmonth]) || !$month_links[$xmonth]) {
            $xmonth_cnt[$xmonth] = 0;
            $month_links[$xmonth] = e107::getUrl()->create('news/list/month', 'id=' . newsFormatDate($req_year, $xmonth));
        }
        $xmonth_cnt[$xmonth]++;
    }
    // go over the link array and create the option fields
    $menu_text = array();
    $template = e107::getTemplate('news', 'news_menu', 'months');
    $bullet = defined('BULLET') ? THEME_ABS . 'images/' . BULLET : THEME_ABS . 'images/bullet2.gif';
    $vars = new e_vars(array('bullet' => $bullet));
    foreach ($month_links as $index => $val) {
        $vars->addData(array('active' => $index == $req_month ? " active" : '', 'url' => $val, 'month' => $marray[$index - 1], 'count' => $xmonth_cnt[$index]));
        $menu_text[] = $tp->simpleParse($template['item'], $vars);
    }
    $cached = $template['start'] . implode($template['separator'], $menu_text) . $template['end'];
    if ($cached) {
        if (!$parms['showarchive']) {
            $cached .= '<div class="e-menu-link archive"><a href="' . e_PLUGIN_ABS . 'blogcalendar_menu/archive.php">' . BLOGCAL_L2 . '</a></div>';
        }
        $cached = $ns->tablerender(BLOGCAL_L1 . $req_year, $cached, 'news_months_menu', true);
    }
    e107::getCache()->set($cString, $cached);
}
echo $cached;