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


PHP config::o方法代码示例

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


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

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

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

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

示例4: init

 /**
  * Инициализация нижнего блока
  * @return null
  */
 public function init()
 {
     if (!config::o()->mstate('downm')) {
         return;
     }
     lang::o()->get("blocks/downm");
     print "Down block inited";
 }
开发者ID:SjayLiFe,项目名称:CTRev,代码行数:12,代码来源:downm.php

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

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

示例7: check

 /**
  * Функция проверки кода recaptcha
  * @param array $error массив ошибок
  * @param string $var $_POST переменная для проверки введённого кода
  * @return null
  */
 public function check(&$error, $var = "recaptcha_challenge_field")
 {
     $posted_code = $_POST[$var];
     if (!$posted_code) {
         $error[] = lang::o()->v('captcha_false_captcha');
         return;
     }
     $r = recaptcha_check_answer(config::o()->v('recaptcha_private_key'), $_SERVER["REMOTE_ADDR"], $posted_code, $_POST["recaptcha_response_field"]);
     if (!$r || !is_object($r) || !$r->is_valid) {
         $error[] = lang::o()->v('captcha_false_captcha');
         return;
     }
     return true;
 }
开发者ID:SjayLiFe,项目名称:CTRev,代码行数:20,代码来源:inc.recaptcha.php

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

示例9: plugin_construct

 /**
  * Конструктор класса
  * @return null 
  */
 protected function plugin_construct()
 {
     $this->state = (bool) config::o()->mstate('rating_manage');
     $this->access_var('allowed_types', PVAR_ADD);
     $this->access_var('allowed_stypes', PVAR_ADD);
     $this->access_var('max', PVAR_ADD);
     $this->access_var('min', PVAR_ADD);
     $this->access_var('part', PVAR_ADD);
     /**
      * @note Отображение рейтинга(display_rating)
      * int toid ID ресурса
      * string type тип ресурса
      * int owner владелец ресурса
      * array res массив ресурса
      * int stoid доп. ID ресурса(для уникальности)
      * string stype доп. тип ресурса(для уникальности)
      */
     tpl::o()->register_function("display_rating", array($this, 'display'));
 }
开发者ID:SjayLiFe,项目名称:CTRev,代码行数:23,代码来源:class.rating.php

示例10: timer

globals::s('start', timer());
// Start time
require_once ROOT . 'include/smarty/Smarty.class.php';
require_once ROOT . 'include/functions_smarty.php';
@set_error_handler("myerror_report");
// Присваиваем функцию myerror_report, вместо стандартной, помогает избежать раскрытия путей.
db::o()->connect();
init_baseurl();
lang::o()->change_folder(config::o()->v('default_lang'));
init_spaths();
tpl::o()->register_modifier('lang', array(lang::o(), 'v'));
// языковая переменная
tpl::o()->register_modifier('getlang', array(lang::o(), 'get'));
// подключение языка прямо в шаблоне
tpl::o()->register_modifier('islang', array(lang::o(), 'visset'));
// языковая переменная
tpl::o()->register_modifier('config', array(config::o(), 'v'));
// конфиг. переменная
tpl::o()->register_modifier('mstate', array(config::o(), 'mstate'));
// разрешён ли модуль
tpl::o()->register_modifier('perm', array(users::o(), "perm"));
// проверка на права
tpl::o()->register_modifier('user', array(users::o(), "v"));
// поле юзера
/**
 * Не смей удалять копирайт ниже, а то дядя Ваня тебя покарает своим большим чёрным банхаммером.
 */
tpl::o()->assign("copyright", "Powered by <a href=\"http://ctrev.cyber-tm.ru/\" title=\"Go to the official site of CTRev\">CTRev v." . ENGINE_VERSION . ' ' . ENGINE_STAGE . "</a> &copy; <a href=\"http://cyber-tm.ru\" title=\"Go to the official site of Cyber-Team\">Cyber-Team</a> 2008-2012");
tpl::o()->assign("designed_by", "Дизайн сайта разработал <u>А. Воробей</u>. All Rights Reserved.");
//tpl::o()->assign_by_ref('config', $CONFIG);
require_once ROOT . 'include/init.php';
开发者ID:SjayLiFe,项目名称:CTRev,代码行数:31,代码来源:core.php

示例11: clear_chat

 /**
  * Очистка старых сообщений чата
  * @return null
  */
 protected function clear_chat()
 {
     if (!config::o()->v('chat_autoclear')) {
         return;
     }
     $hour = 3600;
     // Секунд в час
     $when = time() - config::o()->v('chat_autoclear') * $hour;
     db::o()->p($when)->delete('chat', 'WHERE posted_time <= ?');
 }
开发者ID:SjayLiFe,项目名称:CTRev,代码行数:14,代码来源:class.cleanup.php

示例12: init

 /**
  * Инициализация AJAX части конвертации
  * @return null 
  */
 public function init()
 {
     lang::o()->get('install/convert');
     if ($_GET['check']) {
         if (INSTALL_PAGE == "database") {
             $this->check_settings();
         }
         ok();
     } else {
         tpl::o()->assign("config", config::o());
         switch (INSTALL_PAGE) {
             case "database":
                 $this->show_database();
                 break;
             case "convert":
                 $this->show_convert();
                 break;
             case "notice":
                 cache::o()->clear();
                 break;
         }
         tpl::o()->display("convert/" . INSTALL_PAGE);
     }
 }
开发者ID:SjayLiFe,项目名称:CTRev,代码行数:28,代码来源:convert.php

示例13: __construct

 /**
  * Конструктор? А где конструктор? А нет его.
  * @return null 
  */
 private function __construct()
 {
     $this->state = (bool) config::o()->v('plugins_on');
     if (!$this->state) {
         return;
     }
     $this->manager = new plugins_manager($this, $this->current_plugin);
 }
开发者ID:SjayLiFe,项目名称:CTRev,代码行数:12,代码来源:class.plugins.php

示例14: init

 /**
  * Инициализация AJAX-части модуля
  * @return null
  */
 public function init()
 {
     $POST = globals::g('POST');
     lang::o()->get('admin/config');
     $cprefix = config_man::config_prefix;
     $cprefix_length = strlen($cprefix);
     $keys = array();
     $newcfg = array();
     $i = 0;
     $sort = array();
     foreach ($POST as $key => $value) {
         if (strpos($key, $cprefix) !== 0) {
             continue;
         }
         $key = substr($key, $cprefix_length);
         if (!config::o()->visset($key)) {
             continue;
         }
         $keys[] = $key;
         $newcfg[$key] = $value;
         $sort[$key] = ++$i;
     }
     if (!$keys) {
         return;
     }
     try {
         plugins::o()->pass_data(array("newcfg" => &$newcfg, "sort" => &$sort), true)->run_hook('admin_config_save');
     } catch (PReturn $e) {
         return $e->r();
     }
     $r = db::o()->p($keys)->query('SELECT name,type,allowed FROM config WHERE name IN(@' . count($keys) . '?)');
     $c = 0;
     while (list($name, $type, $allowed) = db::o()->fetch_row($r)) {
         if (!$this->check_type($type, $newcfg[$name], $allowed, $name)) {
             continue;
         }
         $c++;
         config::o()->set($name, $newcfg[$name], $sort[$name]);
     }
     db::o()->query('ALTER TABLE `config` ORDER BY `cat`, `sort`');
     log_add('changed_config', 'admin');
     print $c;
     die;
 }
开发者ID:SjayLiFe,项目名称:CTRev,代码行数:48,代码来源:config.php

示例15: query_stat

/**
 * Вывод статистики по запросам
 * @return string HTML код
 */
function query_stat()
{
    if (!config::o()->v('show_process') || !users::o()->perm('acp', 2)) {
        return;
    }
    $r = "";
    foreach (db::o()->query_stat as $n => $stat) {
        $r .= "[" . ($n + 1) . "] => \n            <b><font color='" . ($stat['seconds'] > 0.01 ? "red" : "green") . "'>\n                " . $stat["seconds"] . "</font></b> [" . $stat["query"] . "]<br>";
    }
    return "<div class='query_stat'>" . $r . "</div>";
}
开发者ID:SjayLiFe,项目名称:CTRev,代码行数:15,代码来源:functions_smarty.php


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