本文整理汇总了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'));
}
示例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'));
}
示例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;
}
}
示例4: doIndex
function doIndex()
{
global $iCMS;
$iCMS->output('index', plugin::tpl('message'));
}