当前位置: 首页>>代码示例>>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;未经允许,请勿转载。