本文整理汇总了PHP中s::add方法的典型用法代码示例。如果您正苦于以下问题:PHP s::add方法的具体用法?PHP s::add怎么用?PHP s::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类s
的用法示例。
在下文中一共展示了s::add方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: show
function show()
{
$event = web::getEvent();
if ($event === false) {
$year = date('Y');
} else {
$year = $event;
}
s::set('info_date_select', htmlspecialchars($year));
$sql = "SELECT `section_year` as date FROM `info_sections` WHERE `section_view`='0' GROUP BY `date` ORDER BY `date` DESC";
$res = db::query($sql);
$rows = mysql_num_rows($res);
if ($rows > 1) {
s::add('info_date_selector', '<ul class="years">');
while ($row = mysql_fetch_assoc($res)) {
if ($row['date'] == $year) {
$row['date'] = '<li><span>' . $row['date'] . '</span></li>';
} else {
$row['date'] = '<li><a href="' . web::get('page_folder') . '' . $row['date'] . '/">' . $row['date'] . '</a></li>';
}
s::add('info_date_selector', $row['date']);
}
s::add('info_date_selector', '</ul>');
}
$files = array();
db::table('info_files');
$r = db::select();
while ($a = mysql_fetch_assoc($r)) {
$files[$a['section_id']][] = $a;
}
db::table('info_sections');
db::order('section_order', 'DESC');
db::where('section_year', $year);
$r = db::select();
if (db::rows() == 0) {
web::error404();
}
while ($a = mysql_fetch_assoc($r)) {
if ($a['section_view'] == '0') {
s::roll('sections', $a);
} else {
s::roll('sections_view', $a);
}
if (isset($files[$a['section_id']])) {
foreach ($files[$a['section_id']] as $v) {
$v['file_icon'] = files::getFileIco($v['file_type']);
$v['file_size'] = files::parseSizeSmart($v['file_size']);
s::roll('items' . $a['section_id'], $v);
}
}
}
}
示例2: show
function show()
{
$list = params::get('list');
$event = web::getEvent();
if ($event === false) {
$year = date('Y');
} else {
$year = $event;
}
s::set('news_date_select', htmlspecialchars($year));
$sql = "SELECT DATE_FORMAT(`news_date`, '%Y') as date FROM `news` GROUP BY `date` ORDER BY `date` DESC";
$res = db::query($sql);
$rows = mysql_num_rows($res);
if ($rows > 1) {
s::add('news_date_selector', '<ul class="years">');
while ($row = mysql_fetch_assoc($res)) {
if ($row['date'] == $year) {
$row['date'] = '<li><span>' . $row['date'] . '</span></li>';
} else {
$row['date'] = '<li><a href="' . web::get('page_folder') . '' . $row['date'] . '/">' . $row['date'] . '</a></li>';
}
s::add('news_date_selector', $row['date']);
}
s::add('news_date_selector', '</ul>');
}
db::table('news');
db::where('news_pub', '1');
db::where('news_date', $year . '-01-01 00:00:00', '>=');
db::where('news_date', $year . '-12-31 23:59:59', '<=');
db::order('news_date', 'DESC');
if ($list !== false) {
db::limit($list);
}
$res = db::select();
if (db::rows() == 0) {
web::error404();
}
while ($row = mysql_fetch_assoc($res)) {
$row['news_date'] = dt::date2print('%d %F %Y', $row['news_date']);
s::roll('news', $row);
}
}
示例3: components
function components()
{
$mode = func_get_args();
foreach ($mode as $v) {
$component_js = 'cmts/' . $v . '/' . $v . '.js';
$component_css = 'cmts/' . $v . '/css/' . $v . '.css';
if (file_exists(SYS_ROOT . $component_js)) {
s::add('admin_headers', '<script type="text/javascript" src="' . 'http://' . SERVER . SYS_DIR . $component_js . '"></script>');
}
if (file_exists(SYS_ROOT . $component_css)) {
s::add('admin_headers', '<link rel="stylesheet" type="text/css" media="all" href="' . 'http://' . SERVER . SYS_DIR . $component_css . '" />');
}
}
}
示例4: stop
function stop()
{
s::add('block', ' stop');
}