當前位置: 首頁>>代碼示例>>PHP>>正文


PHP s::add方法代碼示例

本文整理匯總了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);
             }
         }
     }
 }
開發者ID:rigidus,項目名稱:ea,代碼行數:52,代碼來源:main.handler.php

示例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);
     }
 }
開發者ID:rigidus,項目名稱:ea,代碼行數:42,代碼來源:main.handler.php

示例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 . '" />');
         }
     }
 }
開發者ID:rigidus,項目名稱:ea,代碼行數:14,代碼來源:admin.php

示例4: stop

 function stop()
 {
     s::add('block', ' stop');
 }
開發者ID:rigidus,項目名稱:ea,代碼行數:4,代碼來源:main.handler.php


注:本文中的s::add方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。