当前位置: 首页>>代码示例>>PHP>>正文


PHP s::roll方法代码示例

本文整理汇总了PHP中s::roll方法的典型用法代码示例。如果您正苦于以下问题:PHP s::roll方法的具体用法?PHP s::roll怎么用?PHP s::roll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在s的用法示例。


在下文中一共展示了s::roll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: path

 function path()
 {
     $sep = ' <span>&rarr;</span> ';
     $first = params::get('first');
     $last = params::get('last');
     $i = 0;
     foreach (web::$pages as $v) {
         if ($first == 'no' && $v['page_folder'] == '/') {
             continue;
         }
         if ($last == 'no' && $v['page_id'] == PAGE_ID) {
             continue;
         }
         if ($v['page_folder'] == '/users/[dynamic]/') {
             $v['page_folder'] = '/users/' . router::get(1) . '/';
             $v['page_title'] = router::get(1);
         }
         if ($v['page_id'] == PAGE_ID) {
             $path_item = web::get('page_title');
         } else {
             $path_item = '<a href="' . $v['page_folder'] . '">' . $v['page_title'] . '</a>';
         }
         s::roll('page_path', array('path_item' => $path_item));
         if ($v['page_id'] != PAGE_ID) {
             s::roll('page_path', array('path_item' => $sep));
         }
     }
 }
开发者ID:rigidus,项目名称:ea,代码行数:28,代码来源:main.handler.php

示例2: edit

 function edit()
 {
     events::observe('save', 'templates', 'apps', '_save');
     events::observer();
     $tmpl_file = events::get('tmpl_file');
     $app = events::get('app');
     if (events::detect('restore')) {
         self::restoreVersion($app, $tmpl_file, events::get('restore'));
     }
     admin::components('tabs', 'validator');
     f::set('app', $app);
     f::set('tmpl_file', $tmpl_file);
     s::set('app', $app);
     s::set('tmpl_file', $tmpl_file);
     $file = SYS_ROOT . 'tmpls/' . ADMIN_SITE . '/' . $app . '/' . $tmpl_file;
     $code = files::get($file);
     f::set('tmpl_code', $code);
     self::getApps();
     /*
     	Load versions
     */
     db::table('templates_versions');
     db::where('app', $app);
     db::where('tmpl_file', $tmpl_file);
     db::order('version_date', 'DESC');
     $res = db::select();
     while ($row = mysql_fetch_assoc($res)) {
         $row['version_date'] = dt::date2print('%H:%i %d.%m.%Y', $row['version_date']);
         $row['version_code'] = '{non}' . htmlspecialchars($row['version_code']) . '{/non}';
         s::roll('versions', $row);
     }
 }
开发者ID:rigidus,项目名称:ea,代码行数:32,代码来源:apps.module.php

示例3: view

 function view()
 {
     $tmp = $modules = array();
     $file = SYS_ROOT . 'conf/global/modules.ini';
     $tmp = ini::parse($file);
     foreach ($tmp as $k => $v) {
         $arr = explode('.', $k);
         $modules[$arr[0]][] = array('module_name' => $arr[1], 'module_title' => $v['title'], 'module_version' => $v['ver']);
     }
     $tmp = $apps = array();
     $file = SYS_ROOT . 'conf/global/apps.ini';
     $tmp = ini::parse($file);
     foreach ($tmp as $k => $v) {
         $v['app'] = $k;
         if ($v['in'] == '1') {
             s::roll('appsin', $v);
             if (isset($modules[$k])) {
                 s::rollArray('appsin' . $k, $modules[$k]);
             }
         } else {
             s::roll('apps', $v);
             if (isset($modules[$k])) {
                 s::rollArray('apps' . $k, $modules[$k]);
             }
         }
     }
 }
开发者ID:rigidus,项目名称:ea,代码行数:27,代码来源:main.module.php

示例4: setup

 function setup()
 {
     db::table('pages_content');
     db::where('page_id', PAGE_ID);
     db::where('content_pub', '1');
     db::order('content_id');
     $res = db::select('content');
     $i = 0;
     if ($res) {
         while ($row = mysql_fetch_assoc($res)) {
             $i++;
             s::set('page_content' . $i, $row['content']);
         }
     }
     db::table('pages_files');
     db::where('page_id', PAGE_ID);
     $r = db::select();
     if (db::rows() != 0) {
         s::section('page_files_show');
     }
     while ($a = mysql_fetch_assoc($r)) {
         $a['file_icon'] = files::getFileIco($a['file_type']);
         $a['file_size'] = files::parseSizeSmart($a['file_size']);
         s::roll('page_files', $a);
     }
 }
开发者ID:rigidus,项目名称:ea,代码行数:26,代码来源:main.handler.php

示例5: get

 function get($res, $name = 'clouds')
 {
     $nums_clouds = array();
     if (db::rows() > 0) {
         while ($row = mysql_fetch_array($res)) {
             $nums_clouds[$row['tag_name']] = $row['num'];
         }
         ksort($nums_clouds);
         $max_size = 200;
         // max font size in %
         $min_size = 100;
         // min font size in %
         $max_qty = max(array_values($nums_clouds));
         $min_qty = min(array_values($nums_clouds));
         $spread = $max_qty - $min_qty;
         if (0 == $spread) {
             $spread = 1;
         }
         $step = ($max_size - $min_size) / $spread;
         foreach ($nums_clouds as $k => $v) {
             $size = $min_size + ($v - $min_qty) * $step;
             s::roll($name, array('name' => $k, 'size' => $size, 'value' => $v));
         }
     }
 }
开发者ID:rigidus,项目名称:ea,代码行数:25,代码来源:clouds.php

示例6: rollApps

 function rollApps()
 {
     $tmp = $apps = array();
     $file = SYS_ROOT . 'conf/global/apps.ini';
     $tmp = ini::parse($file);
     foreach ($tmp as $k => $v) {
         $v['app'] = $k;
         s::roll('apps', $v);
     }
 }
开发者ID:rigidus,项目名称:ea,代码行数:10,代码来源:manage.app.php

示例7: getMenus

 function getMenus($site_id)
 {
     db::table('menus');
     db::where('site_id', $site_id);
     db::where('menu_pub', '1');
     db::order('menu_title');
     $res = db::select();
     while ($row = mysql_fetch_assoc($res)) {
         s::roll('menus', $row);
     }
 }
开发者ID:rigidus,项目名称:ea,代码行数:11,代码来源:menus.app.php

示例8: getBlocks

 function getBlocks($site_id = 1)
 {
     db::table('blocks');
     db::where('site_id', $site_id);
     db::where('block_pub', '1');
     db::order('block_name');
     $res = db::select();
     while ($row = mysql_fetch_assoc($res)) {
         s::roll('blocks', $row);
     }
 }
开发者ID:rigidus,项目名称:ea,代码行数:11,代码来源:blocks.app.php

示例9: view

 function view()
 {
     db::table('news');
     db::order('news_date', 'DESC');
     $res = db::select();
     while ($row = mysql_fetch_assoc($res)) {
         $row = filter::get('news_pub', array('unpub', 'pub'), $row);
         $row['news_title'] = strip_tags($row['news_title']);
         $row['news_date'] = dt::date2print('%d %F %Y, %H:%i', $row['news_date']);
         s::roll('news', $row);
     }
 }
开发者ID:rigidus,项目名称:ea,代码行数:12,代码来源:main.module.php

示例10: view

 function view()
 {
     db::table('admin_log_actions');
     db::join('admin_users', 'admin_log_actions', 'user_id');
     db::order('log_date', 'DESC');
     db::limit(30);
     $res = db::select();
     while ($row = mysql_fetch_assoc($res)) {
         $row['log_date'] = dt::format('%d.%m.%Y %H:%M', $row['log_date']);
         s::roll('logs_list', $row);
     }
 }
开发者ID:rigidus,项目名称:ea,代码行数:12,代码来源:log.module.php

示例11: 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

示例12: view

 function view()
 {
     events::observe('upload', 'index');
     events::observer();
     $dir = IMAGES_PATH . 'index/';
     db::table('images');
     $r = db::select();
     while ($a = mysql_fetch_assoc($r)) {
         $a = filter::get('img_set', array('unpub', 'pub'), $a);
         $a['thumb'] = $dir . $a['img_id'] . '_m.jpg';
         s::roll('images', $a);
     }
 }
开发者ID:rigidus,项目名称:ea,代码行数:13,代码来源:main.module.php

示例13: view

 function view()
 {
     db::table('mails');
     $res = db::select();
     if (db::rows() == 0) {
         s::section('no_data');
     } else {
         s::section('yes_data');
     }
     while ($row = mysql_fetch_assoc($res)) {
         s::roll('mails', $row);
     }
 }
开发者ID:rigidus,项目名称:ea,代码行数:13,代码来源:main.module.php

示例14: getTmpls

 function getTmpls($site_id = 1)
 {
     db::table('templates');
     db::where('site_id', $site_id);
     db::where('tmpl_pub', '1');
     db::order('tmpl_name');
     $res = db::select();
     if (db::rows() == 0) {
         s::section('no_data');
     } else {
         s::section('yes_data');
     }
     while ($row = mysql_fetch_assoc($res)) {
         s::roll('tmpls', $row);
     }
 }
开发者ID:rigidus,项目名称:ea,代码行数:16,代码来源:templates.app.php

示例15: 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


注:本文中的s::roll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。