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


PHP tpl::o方法代码示例

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


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

示例1: show

 /**
  * Отображение списка логов
  * @param string $type тип логов
  * @param string $sort сортировка
  * @return null
  */
 protected function show($type = null, $sort = null)
 {
     tpl::o()->assign('curtype', $type);
     $orderby = '';
     if ($sort) {
         $sort = explode(",", $sort);
         $c = count($sort);
         for ($i = 0; $i < $c; $i += 2) {
             if (!$this->orderby[$sort[$i]]) {
                 continue;
             }
             $orderby .= ($orderby ? ', ' : '') . "`" . $this->orderby[$sort[$i]] . "` " . ($sort[$i + 1] ? "asc" : "desc");
         }
     }
     if (!$orderby) {
         $orderby = 'l.`time` DESC';
     }
     $count = db::o()->p($type)->count_rows("logs", $type ? 'type=?' : "");
     list($pages, $limit) = display::o()->pages($count, config::o()->v('table_perpage'), 'switch_logs_page', 'page', 5, true);
     $r = db::o()->p($type)->query('SELECT l.*, u.username, u.group, u2.username AS tusername, u2.group AS tgroup
         FROM logs AS l LEFT JOIN users AS u ON u.id=l.byuid LEFT JOIN users AS u2 ON u2.id=l.touid
         ' . ($type ? ' WHERE l.type=?' : "") . '
         ' . ($orderby ? ' ORDER BY ' . $orderby : "") . '
         ' . ($limit ? ' LIMIT ' . $limit : ""));
     tpl::o()->assign('res', db::o()->fetch2array($r));
     tpl::o()->assign('log_types', $this->types);
     tpl::o()->assign('pages', $pages);
     tpl::o()->display('admin/logs/index.tpl');
 }
开发者ID:SjayLiFe,项目名称:CTRev,代码行数:35,代码来源:logs.php

示例2: show

 /**
  * Отображение списка обратной связи
  * @param string $sort сортировка
  * @param string $type тип
  * @return null
  */
 protected function show($sort = null, $type = '')
 {
     $orderby = '';
     if ($sort) {
         $sort = explode(",", $sort);
         $c = count($sort);
         for ($i = 0; $i < $c; $i += 2) {
             if (!$this->orderby[$sort[$i]]) {
                 continue;
             }
             $orderby .= ($orderby ? ', ' : '') . "`" . $this->orderby[$sort[$i]] . "` " . ($sort[$i + 1] ? "asc" : "desc");
         }
     }
     if (!$orderby) {
         $orderby = 'f.`time` DESC';
     }
     $where = $type ? 'f.type=?' : "";
     $count = db::o()->p($type)->as_table('f')->count_rows("feedback", $where);
     list($pages, $limit) = display::o()->pages($count, config::o()->v('table_perpage'), 'switch_feedback_page', 'page', 5, true);
     $r = db::o()->p($type)->query('SELECT f.*, u.username, u.group
         FROM feedback AS f LEFT JOIN users AS u ON u.id=f.uid
         ' . ($where ? ' WHERE ' . $where : "") . '
         ' . ($orderby ? ' ORDER BY ' . $orderby : "") . '
         ' . ($limit ? ' LIMIT ' . $limit : ""));
     tpl::o()->assign('res', db::o()->fetch2array($r));
     tpl::o()->assign('pages', $pages);
     tpl::o()->assign('type', $type);
     tpl::o()->display('admin/feedback/index.tpl');
 }
开发者ID:SjayLiFe,项目名称:CTRev,代码行数:35,代码来源:feedback.php

示例3: show

 /**
  * Функция отображения доп. полей
  * @return null
  */
 protected function show()
 {
     $r = db::o()->query('SELECT * FROM users_fields');
     tpl::o()->assign('res', db::o()->fetch2array($r));
     tpl::o()->register_modifier('cut_type_descr', array($this, 'cut_type_descr'));
     tpl::o()->display('admin/userfields/index.tpl');
 }
开发者ID:SjayLiFe,项目名称:CTRev,代码行数:11,代码来源:userfields.php

示例4: show_online

 /**
  * Вывод списка online-пользователей
  * @return null
  */
 public function show_online()
 {
     $i = (int) config::o()->v('online_interval');
     if (!$i) {
         $i = 15;
     }
     $time = time() - $i;
     $res = db::o()->p($time)->query('SELECT userdata FROM sessions
             WHERE time > ? GROUP BY IF(uid>0,uid,ip)');
     $res = db::o()->fetch2array($res);
     tpl::o()->assign("res", $res);
     $c = count($res);
     $mo = stats::o()->read("max_online");
     if (!intval($mo) || $mo < $c) {
         $mo = $c;
         stats::o()->write("max_online", $c);
         stats::o()->write("max_online_time", time());
     }
     $mot = stats::o()->read("max_online_time");
     tpl::o()->assign("record_total", $mo);
     tpl::o()->assign("record_time", $mot);
     /* @var $user user */
     $user = plugins::o()->get_module("user");
     lang::o()->get("profile");
     tpl::o()->register_modifier("gau", array($user, "get_age"));
     tpl::o()->assign("bdl", $this->bd_list());
     tpl::o()->display("blocks/contents/online.tpl");
 }
开发者ID:SjayLiFe,项目名称:CTRev,代码行数:32,代码来源:downm.php

示例5: show

 /**
  * Функция отображения типов файлов
  * @return null
  */
 protected function show()
 {
     $r = db::o()->query('SELECT * FROM allowed_ft');
     tpl::o()->assign('res', db::o()->fetch2array($r));
     tpl::o()->register_modifier('aftbasic', array($this, 'is_basic'));
     tpl::o()->display('admin/allowedft/index.tpl');
 }
开发者ID:SjayLiFe,项目名称:CTRev,代码行数:11,代码来源:allowedft.php

示例6: edit

 /**
  * Редактирование пользователя
  * @param int $id ID пользователя
  * @return null
  */
 protected function edit($id)
 {
     $id = (int) $id;
     lang::o()->get("registration");
     lang::o()->get("usercp");
     lang::o()->get('admin/groups');
     /* @var $etc etc */
     $etc = n("etc");
     users::o()->set_tmpvars($etc->select_user($id));
     if (users::o()->v('confirmed') != 3) {
         tpl::o()->assign('unco', true);
     }
     tpl::o()->assign('inusercp', true);
     /* @var $usercp usercp */
     $usercp = plugins::o()->get_module('usercp');
     /* @var $groups groups_man */
     $groups = plugins::o()->get_module('groups', 1);
     ob_start();
     $group = users::o()->get_group(users::o()->v('old_group') ? users::o()->v('old_group') : users::o()->v('group'));
     users::o()->alter_perms($group);
     $groups->add($group, false, true);
     $c = ob_get_contents();
     ob_end_clean();
     tpl::o()->assign('perms', $c);
     $usercp->show_index();
     users::o()->remove_tmpvars();
 }
开发者ID:SjayLiFe,项目名称:CTRev,代码行数:32,代码来源:users.php

示例7: add

 /**
  * Добавление/редактирование бота
  * @param int $id ID бота
  * @return null
  */
 protected function add($id = null)
 {
     $id = (int) $id;
     if ($id) {
         $r = db::o()->p($id)->query('SELECT * FROM bots WHERE id=? LIMIT 1');
         tpl::o()->assign("row", db::o()->fetch_assoc($r));
     }
     tpl::o()->assign("id", $id);
     tpl::o()->display('admin/bots/add.tpl');
 }
开发者ID:SjayLiFe,项目名称:CTRev,代码行数:15,代码来源:bots.php

示例8: init

 /**
  * Инициализация чата
  * @return null
  */
 public function init()
 {
     if (!users::o()->perm('chat')) {
         return;
     }
     if (!config::o()->mstate('chat')) {
         return;
     }
     lang::o()->get("blocks/chat");
     tpl::o()->display('chat/index.tpl');
 }
开发者ID:SjayLiFe,项目名称:CTRev,代码行数:15,代码来源:chat.php

示例9: users_init

/**
 * Инициализация юзерей
 * @return null
 */
function users_init()
{
    users::o()->init();
    if (!defined("DELAYED_SINIT")) {
        users::o()->write_session();
    }
    tpl::o()->assign('groups', users::o()->get_group());
    tpl::o()->assign('curlang', users::o()->get_lang());
    tpl::o()->assign('curtheme', users::o()->get_theme());
    tpl::o()->assign('curtheme_color', users::o()->get_theme(true));
    tpl::o()->assign('curuser', users::o()->v('username'));
    tpl::o()->assign('curgroup', users::o()->v('group'));
}
开发者ID:SjayLiFe,项目名称:CTRev,代码行数:17,代码来源:init.php

示例10: init

 /**
  * Инициализация блока новостей
  * @return null
  */
 public function init()
 {
     if (!config::o()->mstate('news')) {
         return;
     }
     lang::o()->get('news');
     $l = (int) config::o()->v('news_max');
     $a = db::o()->cname('news')->query('SELECT n.*, u.username, u.group FROM news AS n
         LEFT JOIN users AS u ON u.id=n.poster_id
         ORDER BY n.posted_time DESC' . ($l ? ' LIMIT ' . $l : ""));
     tpl::o()->assign('rows', $a);
     tpl::o()->display('news/index.tpl');
 }
开发者ID:SjayLiFe,项目名称:CTRev,代码行数:17,代码来源:news.php

示例11: init

 /**
  * Инициализация блока контента
  * @return null
  */
 public function init()
 {
     lang::o()->get("content");
     if (!users::o()->perm('content')) {
         return;
     }
     /* @var $content content */
     $content = plugins::o()->get_module("content");
     if (!is_callable(array($content, "show"))) {
         return;
     }
     tpl::o()->assign('content_in_block', true);
     $content->show();
 }
开发者ID:SjayLiFe,项目名称:CTRev,代码行数:18,代码来源:content.php

示例12: init

 /**
  * Стат. страницы
  * @return null
  */
 public function init()
 {
     $url = $_GET['page'];
     $r = db::o()->p($url)->query('SELECT * FROM static WHERE url=? LIMIT 1');
     $row = db::o()->fetch_assoc($r);
     if (!$row) {
         furl::o()->location('');
     }
     $this->title = $row['title'];
     tpl::o()->assign('title', $row['title']);
     tpl::o()->assign('content', $row['content']);
     tpl::o()->assign('type', $row['type']);
     tpl::o()->display('static.tpl');
 }
开发者ID:SjayLiFe,项目名称:CTRev,代码行数:18,代码来源:statics.php

示例13: init

 /**
  * Инициализация блока календаря
  * @return null
  */
 public function init()
 {
     $day_of_week = implode(',', array_map(array(db::o(), 'esc'), array_map('trim', explode(",", lang::o()->v('calendar_day_of_week')))));
     $months = input::$months;
     $monthes = array();
     // lol'd
     foreach ($months as $month) {
         $monthes[] = db::o()->esc(lang::o()->v('month_' . $month));
     }
     $content = $this->count_content();
     tpl::o()->assign("content_count", $content);
     tpl::o()->assign('day_of_week', $day_of_week);
     tpl::o()->assign("months", implode(",", $monthes));
     tpl::o()->display("blocks/contents/calendar.tpl");
 }
开发者ID:SjayLiFe,项目名称:CTRev,代码行数:19,代码来源:calendar.php

示例14: init

 /**
  * Инициализация блока-торрентов
  * @return null
  */
 public function init()
 {
     if (!config::o()->v('torrents_on')) {
         return;
     }
     lang::o()->get("blocks/content");
     if (!users::o()->perm('content')) {
         return;
     }
     $curcats = $this->settings['cats'];
     if (!$curcats) {
         return;
     }
     print "Torrents block inited";
     $this->get_children($curcats);
     tpl::o()->assign('curcats', array_reverse($curcats));
 }
开发者ID:SjayLiFe,项目名称:CTRev,代码行数:21,代码来源:torrents.php

示例15: add

 /**
  * Добавление новости
  * @param int $id ID новости
  * @return null
  * @throws EngineException
  */
 protected function add($id)
 {
     $id = (int) $id;
     if ($id) {
         $row = db::o()->p($id)->query('SELECT * FROM news WHERE id=? LIMIT 1');
         $row = db::o()->fetch_assoc($row);
         if ($row) {
             if (users::o()->v('id') == $row['poster_id']) {
                 users::o()->check_perms('edit_news');
             } else {
                 users::o()->check_perms('edit_news', '2');
             }
         } else {
             throw new EngineException('news_are_not_exists');
         }
         tpl::o()->assign('row', $row);
     }
     tpl::o()->display('news/add.tpl');
 }
开发者ID:SjayLiFe,项目名称:CTRev,代码行数:25,代码来源:news.php


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