本文整理匯總了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');
}
}
}
}