本文整理汇总了PHP中Flash::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP Flash::getList方法的具体用法?PHP Flash::getList怎么用?PHP Flash::getList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Flash
的用法示例。
在下文中一共展示了Flash::getList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: date
<?php
require '../include/init.inc.php';
$list = Flash::getList(array('status' => 1));
foreach ($list as &$val) {
preg_match('#{{(\\d)}}#', $val['url'], $matches);
if (count($matches) > 0) {
if ($matches[1] > 0) {
if (strpos($val['url'], '?')) {
$val['url'] .= '&start_date=' . date("Y-m-d", time() - 86400 * $matches[1]);
} else {
$val['url'] .= '?start_date=' . date("Y-m-d", time() - 86400 * $matches[1]);
}
$val['url'] .= '&end_date=' . date("Y-m-d", time());
}
$val['url'] = preg_replace('#{{\\d}}#', '', $val['url']);
}
}
Template::assign('flashtime', System::get('flashtime') * 1000);
Template::assign('list', json_encode($list));
Template::display('flash/show.tpl');
示例2: intval
$sort = intval($_POST['sort']);
Flash::update($id, array('name' => $name, 'title' => $title, 'url' => $url, 'status' => $status, 'sort' => $sort));
Common::jumpUrl("flash/manage.php");
} else {
$item = Flash::getById($id);
Template::assign('item', $item);
Template::display('flash/edit.tpl');
}
} else {
if (isset($_GET['del'])) {
$id = intval($_GET['id']);
if ($id < 1) {
Common::jumpUrl("flash/manage.php");
}
Flash::del($id);
Common::jumpUrl("flash/manage.php");
} else {
if (isset($_GET['uptime'])) {
if (intval($_GET['time']) > 1) {
System::set('flashtime', intval($_GET['time']));
}
Common::jumpUrl("flash/manage.php");
} else {
$list = Flash::getList();
Template::assign('list', $list);
Template::assign('flashtime', System::get('flashtime'));
Template::display('flash/manage.tpl');
}
}
}
}