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


PHP Option::get方法代码示例

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


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

示例1: get

 /**
  * Get menu
  *
  * @param string $category Category name
  */
 public static function get($category = '')
 {
     // Get menu table
     $menu = new Table('menu');
     // Display view
     View::factory('box/menu/views/frontend/index')->assign('items', $menu->select('[category="' . $category . '"]', 'all', null, array('id', 'name', 'link', 'target', 'order', 'category'), 'order', 'ASC'))->assign('uri', Uri::segments())->assign('defpage', Option::get('defaultpage'))->display();
 }
开发者ID:rowena-altastratus,项目名称:altastratus,代码行数:12,代码来源:menu.plugin.php

示例2: __construct

 private function __construct()
 {
     $this->_path = $this->setPath();
     $this->_routingTable = Option::getRoutingTable();
     $urlMode = Option::get('isurlrewrite');
     foreach ($this->_routingTable as $route) {
         if (!isset($route['reg_' . $urlMode])) {
             $reg = isset($route['reg']) ? $route['reg'] : $route['reg_0'];
         } else {
             $reg = $route['reg_' . $urlMode];
         }
         if (preg_match($reg, $this->_path, $matches)) {
             $this->_model = $route['model'];
             $this->_method = $route['method'];
             $this->_params = $matches;
             break;
         } elseif (preg_match($route['reg_0'], $this->_path, $matches)) {
             $this->_model = $route['model'];
             $this->_method = $route['method'];
             $this->_params = $matches;
             break;
         }
     }
     if (empty($this->_model)) {
         show_404_page();
     }
 }
开发者ID:flyysr,项目名称:emlog,代码行数:27,代码来源:dispatcher.php

示例3: getUsers

 function getUsers($page = null, $condition = '')
 {
     if ($page) {
         $perpage_num = Option::get('admin_perpage_num');
         $startId = ($page - 1) * $perpage_num;
         $condition .= " LIMIT {$startId}, " . $perpage_num;
     }
     $res = $this->db->query("SELECT * FROM " . DB_PREFIX . "viporg {$condition}");
     $users = array();
     while ($row = $this->db->fetch_array($res)) {
         //$row['name'] = htmlspecialchars($row['name']);
         //$row['company'] = htmlspecialchars($row['company']);
         if ($row['duty'] == 1) {
             $row['duty'] = '理事单位';
         }
         if ($row['duty'] == 2) {
             $row['duty'] = '常务理事单位';
         }
         if ($row['duty'] == 3) {
             $row['duty'] = '会员单位';
         }
         $users[] = $row;
     }
     return $users;
 }
开发者ID:szshenjian,项目名称:JIEWU,代码行数:25,代码来源:viporg_model.php

示例4: all

 /**
  * @param null $key
  * @return mixed
  */
 public static function all($key = null)
 {
     if (!$key) {
         $key = self::$key;
     }
     return Option::get($key);
 }
开发者ID:marcmascarell,项目名称:laravel-artificer,代码行数:11,代码来源:AdminOption.php

示例5: getTrackbacks

 /**
  * 获取trackbak
  *
  * @param unknown_type $page
  * @param unknown_type $blogId
  * @return unknown
  */
 function getTrackbacks($page = null, $blogId = null, $spot = 0)
 {
     $timezone = Option::get('timezone');
     $andQuery = '1=1';
     $andQuery .= $blogId ? " and a.gid={$blogId}" : '';
     $condition = '';
     if ($page) {
         $perpage_num = Option::get('admin_perpage_num');
         $startId = ($page - 1) * $perpage_num;
         $condition = "LIMIT {$startId}, " . $perpage_num;
     }
     if ($spot == 0) {
         $sql = "SELECT * FROM " . DB_PREFIX . "trackback as a where {$andQuery} ORDER BY a.tbid DESC {$condition}";
     } else {
         $sql = ROLE == 'admin' ? "SELECT * FROM " . DB_PREFIX . "trackback as a where {$andQuery} ORDER BY a.tbid DESC {$condition}" : "SELECT *,a.title FROM " . DB_PREFIX . "trackback as a, " . DB_PREFIX . "blog as b where {$andQuery} and a.gid=b.gid and b.author=" . UID . " ORDER BY a.tbid DESC {$condition}";
     }
     $ret = $this->db->query($sql);
     $trackbacks = array();
     while ($row = $this->db->fetch_array($ret)) {
         $row['title'] = htmlspecialchars($row['title']);
         $row['blog_name'] = htmlspecialchars($row['blog_name']);
         $row['date'] = gmdate("Y-m-d H:i", $row['date'] + $timezone * 3600);
         $row['url'] = htmlspecialchars($row['url']);
         $row['excerpt'] = htmlspecialchars($row['excerpt']);
         $trackbacks[] = $row;
     }
     return $trackbacks;
 }
开发者ID:MikeCoder,项目名称:mblog,代码行数:35,代码来源:trackback_model.php

示例6: create

 /**
  * Create sitemap
  */
 public static function create()
 {
     // Get pages list
     $pages_list = Pages::getPages();
     // Create sitemap content
     $map = '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
     $map .= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . "\n";
     foreach ($pages_list as $page) {
         if ($page['parent'] != '') {
             $parent = $page['parent'] . '/';
             $priority = '0.5';
         } else {
             $parent = '';
             $priority = '1.0';
         }
         $map .= "\t" . '<url>' . "\n\t\t" . '<loc>' . Option::get('siteurl') . '/' . $parent . $page['slug'] . '</loc>' . "\n\t\t" . '<lastmod>' . date("Y-m-d", (int) $page['date']) . '</lastmod>' . "\n\t\t" . '<changefreq>weekly</changefreq>' . "\n\t\t" . '<priority>' . $priority . '</priority>' . "\n\t" . '</url>' . "\n";
     }
     // Get list of components
     $components = Sitemap::getComponents();
     // Add components to sitemap
     if (count($components) > 0) {
         foreach ($components as $component) {
             $map .= "\t" . '<url>' . "\n\t\t" . '<loc>' . Option::get('siteurl') . '/' . Text::lowercase($component) . '</loc>' . "\n\t\t" . '<lastmod>' . date("Y-m-d", time()) . '</lastmod>' . "\n\t\t" . '<changefreq>weekly</changefreq>' . "\n\t\t" . '<priority>1.0</priority>' . "\n\t" . '</url>' . "\n";
         }
     }
     // Close sitemap
     $map .= '</urlset>';
     // Save sitemap
     return File::setContent(ROOT . DS . 'sitemap.xml', $map);
 }
开发者ID:rowena-altastratus,项目名称:altastratus,代码行数:33,代码来源:sitemap.plugin.php

示例7: _helpsearch

    function _helpsearch($params)
    {
        $user = $params['user'];
        $channel = $params['channel'];
        $helpsearch = $params['helpsearch'];
        $server = Option::get('projectsdot', 'server');
        $pduser = Option::get('projectsdot', 'user');
        $pdpass = Option::get('projectsdot', 'pass');
        $database = Option::get('projectsdot', 'database');
        $site = Option::get('projectsdot', 'site');
        $db = new DB("mysql:host={$server->value};dbname={$database->value}", $pduser->value, $pdpass->value, 'projectsdot');
        $helplinks = $db->results("select n.nid, n.title, b.weight from node n, node_revisions r, book b where n.vid = r.vid and b.vid = n.vid and n.type = 'book' and r.body like CONCAT('%', :crit, '%');", array('crit' => $helpsearch));
        $title = 'Help Search';
        $body = 'The book topics on the left contained the search phrase "' . htmlspecialchars($helpsearch) . '".';
        foreach ($helplinks as $link) {
            $links .= '<li><a href="#' . $link->nid . '" onclick="send(\'/help ::' . $link->nid;
            if ($helpsearch != '') {
                $links .= ' ' . htmlspecialchars($helpsearch);
            }
            $links .= '\');return false;">' . $link->title . '</a></li>';
        }
        $msg = '<a href="#" class="close" onclick="return closedrawer({$drawer_id});">close this drawer</a><div id="helplinks" style="width:30%;float:left;height:200px;overflow-y:auto;overflow-x:hidden;"><ul>' . $links . '</ul></div>
<div id="helpbody" style="width:70%;height:200px;overflow:auto;float:left;"><h3>' . $title . '</h3>' . $body . '</div>';
        DB::get()->query("DELETE FROM drawers WHERE indexed = 'help' and user_id = :user_id;", array('user_id' => $user->id));
        DB::get()->query("INSERT INTO drawers (user_id, message, indexed, cssclass) VALUES (:user_id, :msg, 'help', 'help');", array('user_id' => $user->id, 'msg' => $msg));
        $msg = 'Removed the "' . htmlspecialchars($name) . '" calendar.';
        $obj = new StdClass();
        $obj->laststatus = 0;
        $obj->js = "refreshDrawers();";
        echo json_encode($obj);
        die;
        return true;
    }
开发者ID:amitchouhan004,项目名称:barchat,代码行数:33,代码来源:help.php

示例8: kl_album_callback_do

function kl_album_callback_do($hide)
{
    global $CACHE;
    $DB = Database::getInstance();
    $kl_album_config = Option::get('kl_album_config');
    if (is_null($kl_album_config)) {
        $DB->query("INSERT INTO " . DB_PREFIX . "options(option_name, option_value) VALUES('kl_album_config', '{$kl_album_config}')");
        $CACHE->updateCache('options');
    }
    $isExists = false;
    $Navi_Model = new Navi_Model();
    $navis = $Navi_Model->getNavis();
    foreach ($navis as $navi) {
        if ($navi['url'] == '?plugin=kl_album' && $navi['isdefault'] == 'y') {
            $Navi_Model->updateNavi(array('hide' => $hide), $navi['id']);
            $CACHE->updateCache('navi');
            $isExists = true;
            break;
        }
    }
    if (!$isExists) {
        $DB->query("insert into " . DB_PREFIX . "navi (naviname,url,newtab,hide,taxis,isdefault) values('相册','?plugin=kl_album', 'n', '{$hide}', 4, 'y')");
        $CACHE->updateCache('navi');
    }
}
开发者ID:MikeCoder,项目名称:mblog,代码行数:25,代码来源:kl_album_callback.php

示例9: _alarm

 function _alarm($params)
 {
     $user = $params['user'];
     $channel = $params['channel'];
     $event = $params['event'];
     $time = $params['time'];
     $repeat = $params['repeat'];
     $adata = DB::get()->assoc("SELECT value FROM options WHERE user_id = :user_id AND name = 'alarmdata' AND grouping = 'Alarms'", array('user_id' => $user->id));
     if ($adata == '') {
         $alarms = array();
     } else {
         $alarms = unserialize($adata);
     }
     $time = strtotime($time);
     $output = '<div class="slash">' . htmlspecialchars($params['matches'][0]) . '</div>';
     if ($time == 0) {
         $output .= 'Specified alarm time is <em>invalid</em>.';
     } else {
         $newalarm = array('event' => $event, 'time' => $time - intval((string) Option::get('Time', 'Zone Offset')) * 3600, 'repeat' => $repeat);
         $alarms[] = $newalarm;
         DB::get()->query("DELETE FROM options WHERE user_id = :user_id AND name = 'alarmdata' AND grouping = 'Alarms'", array('user_id' => $user->id));
         DB::get()->query("INSERT INTO options (grouping, name, user_id, value) VALUES('Alarms', 'alarmdata', :user_id, :value)", array('user_id' => $user->id, 'value' => serialize($alarms)));
         $output .= 'Alarm added for ' . date('M j, Y h:ia', $time) . '.';
     }
     DB::get()->query("INSERT INTO presence (data, user_id, type, cssclass, user_to, channel) VALUES (:msg, :user_id, 'system', 'ok', :user_to, '')", array('msg' => $output, 'user_id' => 0, 'user_to' => $user->id));
     return true;
 }
开发者ID:amitchouhan004,项目名称:barchat,代码行数:27,代码来源:alarm.php

示例10: JA_content_f

function JA_content_f($arr)
{
    $blogname = Option::get('blogname');
    //$url = BLOG_URL."?post=".$arr['logid'];
    $url = Url::log($arr['logid']);
    $name = "<a style=\"color:red;\" href=\"" . BLOG_URL . "\">" . $blogname . "</a>";
    ?>
  <p>
  版权所有:《<?php 
    echo $name;
    ?>
》 => 《<a href="<?php 
    echo $url;
    ?>
"><?php 
    echo $arr['log_title'];
    ?>
</a>》<br />
  本文地址:<a href="<?php 
    echo $url;
    ?>
"><?php 
    echo $url;
    ?>
</a><br />
  除非注明,文章均为 《<?php 
    echo $name;
    ?>
》 原创,欢迎转载!转载请注明本文地址,谢谢。<br />
  </p>
  <?php 
}
开发者ID:MikeCoder,项目名称:mblog,代码行数:32,代码来源:JA_content.php

示例11: remove

 /**
  * Remove a role
  */
 public function remove()
 {
     $role = Role::getById($this->roleId);
     if ($role && $role->isRemovable()) {
         User::getDbInstance()->update(User::getTable(), new DBExample(array('roleId' => $role->id)), array('roleId' => Option::get('roles.default-role')));
         $role->delete();
     }
 }
开发者ID:elvyrra,项目名称:hawk,代码行数:11,代码来源:RoleController.php

示例12: formComponent

 /**
  * Form Component
  */
 public static function formComponent()
 {
     $_templates = Themes::getTemplates();
     foreach ($_templates as $template) {
         $templates[basename($template, '.template.php')] = basename($template, '.template.php');
     }
     echo '<div class="col-xs-3">' . Form::open() . Form::hidden('csrf', Security::token()) . Form::label('sandbox_form_template', __('Sandbox template', 'sandbox')) . Form::select('sandbox_form_template', $templates, Option::get('sandbox_template'), array('class' => 'form-control')) . Html::br() . Form::submit('sandbox_component_save', __('Save', 'sandbox'), array('class' => 'btn btn-default')) . Form::close() . '</div>';
 }
开发者ID:rowena-altastratus,项目名称:altastratus,代码行数:11,代码来源:sandbox.admin.php

示例13: klUploadFile

function klUploadFile($filename, $errorNum, $tmpfile, $filesize, $filetype, $type, $isIcon = 0)
{
    $kl_album_config = unserialize(Option::get('kl_album_config'));
    $extension = strtolower(substr(strrchr($filename, "."), 1));
    $uppath = KL_UPLOADFILE_PATH . date("Ym") . "/";
    $fname = md5($filename) . date("YmdHis") . rand() . '.' . $extension;
    $attachpath = $uppath . $fname;
    if (!is_dir(KL_UPLOADFILE_PATH)) {
        umask(0);
        $ret = @mkdir(KL_UPLOADFILE_PATH, 0777);
        if ($ret === false) {
            return '创建文件上传目录失败';
        }
    }
    if (!is_dir($uppath)) {
        umask(0);
        $ret = @mkdir($uppath, 0777);
        if ($ret === false) {
            return "上传失败。文件上传目录(content/plugins/kl_album/upload)不可写";
        }
    }
    doAction('kl_album_upload', $tmpfile);
    //缩略
    $imtype = array('jpg', 'png', 'jpeg', 'gif');
    $thum = $uppath . "thum-" . $fname;
    $attach = in_array($extension, $imtype) && function_exists("ImageCreate") && klResizeImage($tmpfile, $filetype, $thum, $isIcon, KL_IMG_ATT_MAX_W, KL_IMG_ATT_MAX_H) ? $thum : $attachpath;
    $kl_album_compression_length = isset($kl_album_config['compression_length']) ? intval($kl_album_config['compression_length']) : 1024;
    $kl_album_compression_width = isset($kl_album_config['compression_width']) ? intval($kl_album_config['compression_width']) : 768;
    if ($kl_album_compression_length == 0 || $kl_album_compression_width == 0) {
        if (@is_uploaded_file($tmpfile)) {
            if (@(!move_uploaded_file($tmpfile, $attachpath))) {
                @unlink($tmpfile);
                return "上传失败。文件上传目录(content/plugins/kl_album/upload)不可写";
            } else {
                echo 'kl_album_successed';
            }
            chmod($attachpath, 0777);
        }
    } else {
        if (in_array($extension, $imtype) && function_exists("ImageCreate") && klResizeImage($tmpfile, $filetype, $attachpath, $isIcon, $kl_album_compression_length, $kl_album_compression_width)) {
            echo 'kl_album_successed';
        } else {
            if (@is_uploaded_file($tmpfile)) {
                if (@(!move_uploaded_file($tmpfile, $attachpath))) {
                    @unlink($tmpfile);
                    return "上传失败。文件上传目录(content/plugins/kl_album/upload)不可写";
                } else {
                    echo 'kl_album_successed';
                }
                chmod($attachpath, 0777);
            }
        }
    }
    $attach = substr($attach, 6, strlen($attach));
    return $attach;
}
开发者ID:MikeCoder,项目名称:mblog,代码行数:56,代码来源:kl_album.php

示例14: db_autodefine

/** Automatically selects the right DB handler from options
 * 
 * @param Option $obj_OptionHandler
 * 
 * @return dbHandler
 */
function db_autodefine($obj_OptionHandler)
{
    $str_DbType = $obj_OptionHandler->get('db_type');
    switch ($str_DbType) {
        case 'MySQL':
            require_once PHP_CLASSES_DIR . 'database/MySqlHandler.php';
            return new MySqlHandler();
            break;
    }
}
开发者ID:steromano87,项目名称:Gawain,代码行数:16,代码来源:autodefiners.php

示例15: chanbar_menu

 function chanbar_menu($add, $room, $roomtype)
 {
     $roomhtml = '';
     if ($roomtype == 'portal') {
         list($type, $name) = explode(':', $room->name, 2);
         $url = Option::get('portal', $name);
         $roomhtml .= '<li><a href="#" onclick="$(\'#portal_' . substr(md5($name), 6, 10) . '\').attr(\'src\', \'' . $url . '\');return false;">Reset</a></li>';
     }
     return $roomhtml;
 }
开发者ID:amitchouhan004,项目名称:barchat,代码行数:10,代码来源:portal.php


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