當前位置: 首頁>>代碼示例>>PHP>>正文


PHP plugin::tpl方法代碼示例

本文整理匯總了PHP中plugin::tpl方法的典型用法代碼示例。如果您正苦於以下問題:PHP plugin::tpl方法的具體用法?PHP plugin::tpl怎麽用?PHP plugin::tpl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在plugin的用法示例。


在下文中一共展示了plugin::tpl方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: iCMS_plugins_calendar

function iCMS_plugins_calendar($vars, &$iCMS)
{
    $y = $_GET['y'];
    $m = $_GET['m'];
    list($nowy, $nowm) = explode('-', get_date('', 'Y-m'));
    $calendar = array();
    $calendar['year'] = $y ? $y : $nowy;
    $calendar['month'] = $m ? $m : $nowm;
    $calendar['days'] = calendar($calendar['month'], $calendar['year']);
    $calendar['nextmonth'] = $calendar['month'] + 1 > 12 ? 1 : $calendar['month'] + 1;
    $calendar['premonth'] = $calendar['month'] - 1 < 1 ? 12 : $calendar['month'] - 1;
    $calendar['nextyear'] = $calendar['year'] + 1;
    $calendar['preyear'] = $calendar['year'] - 1;
    $calendar['cur_date'] = get_date('', 'Y n.j D');
    $iCMS->value('SELF', __SELF__);
    $iCMS->value('calendar', $calendar);
    $iCMS->output('calendar', plugin::tpl('calendar'));
}
開發者ID:idreamsoft,項目名稱:iCMS5.0,代碼行數:18,代碼來源:function.php

示例2: iCMS_plugins_archives

function iCMS_plugins_archives($vars, &$iCMS)
{
    $rs = iCMS_DB::getArray("SELECT A.pubdate FROM `#iCMS@__article` AS A,#iCMS@__forum AS F WHERE A.status='1' AND A.fid=F.fid AND F.status='1' ORDER BY pubdate DESC");
    $_count = count($rs);
    for ($i = 0; $i < $_count; $i++) {
        $article[] = get_date($rs[$i]['pubdate'], 'Y-m');
    }
    $arr = array_count_values($article);
    $i = 0;
    foreach ($arr as $key => $val) {
        list($y, $m) = explode('-', $key);
        $archive[$i]['url'] = $y . '_' . $m;
        $archive[$i]['date'] = "{$y}年{$m}月";
        $archive[$i]['count'] = $val;
        $i++;
    }
    $iCMS->value('archive', $archive);
    $iCMS->output('archive', plugin::tpl('archives'));
}
開發者ID:idreamsoft,項目名稱:iCMS5.1,代碼行數:19,代碼來源:function.php

示例3: iCMS_plugins_message

function iCMS_plugins_message($vars, &$iCMS)
{
    if (isset($vars['call'])) {
        if ($vars['call'] == 'form') {
            echo $iCMS->output('form', plugin::tpl('message'));
            exit;
        }
    } else {
        $maxperpage = isset($vars['row']) ? (int) $vars['row'] : "20";
        $cacheTime = isset($vars['time']) ? (int) $vars['time'] : -1;
        $offset = 0;
        if ($vars['page']) {
            $total = iCMS_DB::getValue("SELECT count(*) FROM `#iCMS@__plugins_message` WHERE `status`='0'");
            $pagenav = isset($vars['pagenav']) ? $vars['pagenav'] : "pagenav";
            $pnstyle = isset($vars['pnstyle']) ? $vars['pnstyle'] : 0;
            $offset = $iCMS->multi(array('total' => $total, 'perpage' => $maxperpage, 'unit' => $iCMS->language('page:message'), 'nowindex' => $GLOBALS['page'], 'pagenav' => $pagenav, 'pnstyle' => $pnstyle));
        }
        $iscache = true;
        if ($vars['cache'] == false || isset($vars['page'])) {
            $iscache = false;
            $rs = '';
        } else {
            $cacheName = 'message/cache';
            $rs = $iCMS->getCache($cacheName);
        }
        if (empty($rs)) {
            $rs = iCMS_DB::getArray("SELECT * FROM `#iCMS@__plugins_message` WHERE `status`='0' order by `id` DESC LIMIT {$offset},{$maxperpage}");
            for ($i = 0; $i < count($rs); $i++) {
                if ($rs[$i]['reply']) {
                    $rs[$i]['reply'] = '<strong>' . $iCMS->language('reply:admin') . '</strong>' . $rs[$i]['reply'];
                }
            }
            $iscache && $iCMS->SetCache($cacheName, $rs, $cacheTime);
        }
        return $rs;
    }
}
開發者ID:idreamsoft,項目名稱:iCMS5.1,代碼行數:37,代碼來源:function.php

示例4: doIndex

 function doIndex()
 {
     global $iCMS;
     $iCMS->output('index', plugin::tpl('message'));
 }
開發者ID:idreamsoft,項目名稱:iCMS5.0,代碼行數:5,代碼來源:message.mo.php


注:本文中的plugin::tpl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。