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


PHP Options::Get方法代码示例

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


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

示例1: __construct

 public function __construct()
 {
     $this->_db = DB::getInstance();
     $this->_template = new TemplateRender();
     $this->_templateFolder = Options::Get("siteurl") . '/theme/default';
     $this->_templateFolderPath = ABSPATH . '/theme/default';
 }
开发者ID:andersoonluan,项目名称:PHP,代码行数:7,代码来源:template.php

示例2: registerPostType

 static function registerPostType()
 {
     Register_Post_Type(self::$post_type_name, array('labels' => array('name' => Glossary_Type::$type->label, 'singular_name' => I18n::t('Термін'), 'add_new' => I18n::t('Додати термін'), 'add_new_item' => I18n::t('Новий термін'), 'edit_item' => I18n::t('Редагувати термін'), 'view_item' => I18n::t('Показати термін'), 'search_items' => I18n::t('Пошук термінів'), 'not_found' => I18n::t('Термінів не знайдено'), 'not_found_in_trash' => I18n::t('У кошику Термінів не знайдено'), 'parent_item_colon' => ''), 'public' => True, 'show_ui' => True, 'menu_icon' => 'dashicons-welcome-learn-more', 'has_archive' => True, 'map_meta_cap' => True, 'hierarchical' => False, 'rewrite' => array('slug' => Glossary_Type::$type->slug, 'with_front' => False), 'supports' => array('title', 'editor', 'author', 'excerpt'), 'menu_position' => 20));
     # Add optionally post type support
     if (Options::Get('enable_custom_fields')) {
         Add_Post_Type_Support(self::$post_type_name, 'custom-fields');
     }
 }
开发者ID:andyUA,项目名称:kabmin-new,代码行数:8,代码来源:class.post-type.php

示例3: loadGlossaryType

 static function loadGlossaryType()
 {
     $type = Options::Get('glossary_type');
     $arr_types = self::getGlossaryTypes();
     if (isset($arr_types[$type])) {
         self::$type = $arr_types[$type];
     } else {
         self::$type = Reset($arr_types);
     }
 }
开发者ID:andyUA,项目名称:kabmin-new,代码行数:10,代码来源:class.glossary-type.php

示例4: send

 public static function send($sendTo, $subject, $message)
 {
     $header = "From: " . Options::Get('sitename') . " <no-reply@" . $_SERVER['HTTP_HOST'] . ">\r\n";
     $header .= "Content-type:text/html; charset=utf-8\r\n";
     try {
         mail($sendTo, $subject, $message, $header);
     } catch (Exception $ex) {
         throw new Exception($ex);
     }
 }
开发者ID:andersoonluan,项目名称:PHP,代码行数:10,代码来源:mail.php

示例5: Update

 public static function Update($params)
 {
     foreach ($params as $key => $value) {
         if (Options::Get($key) === false) {
             DB::getInstance()->INSERT("options", array('option' => $key, 'value' => $value));
         } else {
             DB::getInstance()->UPDATE("options", "option", $key, array('option' => $key, 'value' => $value));
         }
     }
 }
开发者ID:andersoonluan,项目名称:PHP,代码行数:10,代码来源:options.php

示例6: filterQuery

 static function filterQuery($query)
 {
     if (!$query->Get('suppress_filters') && Core::isGlossaryArchive($query) || Core::isGlossarySearch($query)) {
         # Order the terms in the backend by title, ASC.
         if (!$query->Get('order')) {
             $query->Set('order', 'asc');
         }
         if (!$query->Get('orderby')) {
             $query->Set('orderby', 'title');
         }
         # Take an eye on the filter
         if (!$query->Get('post_title_like') && !$query->Get('ignore_filter_request') && Get_Query_Var('filter')) {
             $query->Set('post_title_like', RawUrlDecode(Get_Query_Var('filter')) . '%');
         }
         # Change the number of terms per page
         if (!Is_Admin()) {
             $query->Set('posts_per_page', Options::Get('terms_per_page'));
         }
     }
 }
开发者ID:andyUA,项目名称:kabmin-new,代码行数:20,代码来源:class.wp-query-extensions.php

示例7: exception_handler

|
*/
require_once COREPATH . "/template.php";
/*
|--------------------------------------------------------------------------
| Set default Exception handler if not in debug mode
|--------------------------------------------------------------------------
|
*/
if (!DEBUG_MODE) {
    function exception_handler($exception)
    {
        echo $exception->getMessage();
    }
    set_exception_handler('exception_handler');
}
/*
|--------------------------------------------------------------------------
| App fisrt run
|--------------------------------------------------------------------------
|
*/
require_once DIR_CORE . "/firstrun.php";
/*
|-------------------------------------------------
| Set Timezone 
|-------------------------------------------------
|
*/
$timeZone = Options::Get('timezone') ? Options::Get('timezone') : "UTC";
date_default_timezone_set($timeZone);
开发者ID:andersoonluan,项目名称:PHP,代码行数:31,代码来源:commoninit.php

示例8: User

 if ($validation->passed()) {
     $user = new User();
     $salt = Hash::salt(32);
     try {
         // Activation code
         $code = Token::generate();
         // Account activation
         $active = Options::Get('users_must_confirm_email') == "1" ? 0 : 1;
         $user->create(array('username' => Input::get('username'), 'password' => Hash::make(Input::get('password'), $salt), 'salt' => $salt, 'email' => Input::get('email'), 'roles' => '2', 'act_code' => $code, 'active' => $active, 'signup' => date('Y-m-d H:i:s')));
         // If the user is successfully registered
         if ($user->find(Input::get('username'))) {
             // Send confirmation email
             if ($active == 0) {
                 $registerMessage = "Hello " . Input::get('username') . ",<br /><br />";
                 $registerMessage .= "Thank you for registering with " . Options::get("sitename") . "! To complete your registration, please click on the link below or paste it into a browser to confirm your e-mail address.<br/>";
                 $registerMessage .= "<a href='" . Options::Get("siteurl") . "/confirmregistration.php?email=" . Input::Get("email") . "&code=" . $code . "' >" . Options::Get("siteurl") . "/confirmregistration.php?email=" . Input::Get("email") . "&code=" . $code . "</a>";
                 $registerMessage .= "<br/><br/><br/>Please do not reply to this message.<br/>" . Options::get("sitename");
                 Mail::Send(Input::Get("email"), Options::get("sitename") . ' Account activation', $registerMessage);
             }
             $registerSuccessMsg = lang('THANK_YOU_REGISTERING');
             if ($active == 0) {
                 $registerSuccessMsg .= "<br/>" . lang('THANK_YOU_REGISTERING_CONFIRMATION');
             }
             // User message after the signing up
             Session::flash("signin", "success", $registerSuccessMsg, true);
             Redirect::To("signin.php");
         }
     } catch (Exception $e) {
         echo "<div class='alert alert-danger alert-singnin' role='alert'>";
         echo lang("OPERATION_FAILED_TRY_AGAIN") . "<br/> " . $e->GetMessage();
         echo "</div>";
开发者ID:andersoonluan,项目名称:PHP,代码行数:31,代码来源:signup.php

示例9: array

    $hash = Cookie::get(Config::get('remember/cookie_name'));
    $hashCheck = DB::getInstance()->get('users_session', array('hash', '=', $hash));
    if ($hashCheck->count()) {
        $user = new User($hashCheck->first()->user_id);
        $user->login();
    }
}
/*
|--------------------------------------------------------------------------
| User must be signed in
|--------------------------------------------------------------------------
|
*/
$user = new user();
if (!$user->isLoggedIn()) {
    Redirect::to(Options::Get("siteurl") . 'signin.php');
    exit;
}
/*
|-------------------------------------------------
| Set Timezone for the current user
|-------------------------------------------------
|
*/
if (isset($user->Options()->timezone)) {
    if ($user->Options()->timezone) {
        date_default_timezone_set($user->Options()->timezone);
    }
}
/*
|------------------------------------
开发者ID:andersoonluan,项目名称:PHP,代码行数:31,代码来源:init.php

示例10: Validate

    ?>
</h3>
						</div>
						<div class="panel-body">
						<?php 
    if (Input::exists()) {
        if (Token::check(Input::get('token'))) {
            $validate = new Validate();
            $validation = $validate->check($_POST, array('email' => array('disp_text' => 'E-mail', 'required' => true, 'exists' => 'users')));
            if ($validation->passed()) {
                $code = Token::generate();
                try {
                    DB::GetInstance()->Query("UPDATE users set act_code = ? WHERE email = ? ", array($code, Input::Get("email")));
                    $recoverMessage = "You recently requested a new password<br /><br />";
                    $recoverMessage .= "Please click the link below to complete your request<br/>";
                    $recoverMessage .= "<a href='" . Options::Get("siteurl") . "/recover.php?email=" . Input::Get("email") . "&code=" . $code . "' >" . Options::Get("siteurl") . "recover.php?email=" . Input::Get("email") . "&code=" . $code . "</a>";
                    Mail::Send(Input::Get("email"), 'Account recovry request', $recoverMessage);
                    echo "<div class='alert alert-success' role='alert'>";
                    echo "<span class='glyphicon glyphicon-exclamation-sign' aria-hidden='true'></span>";
                    echo lang('RESET_PASSWORD_REQUEST_SENT') . "</br>";
                    echo "</div>";
                } catch (Exception $e) {
                    die($e->getMessage());
                }
            } else {
                foreach ($validation->errors() as $error) {
                    echo "<div class='alert alert-danger' role='alert'>";
                    echo "<a href='#' class='close' data-dismiss='alert' aria-label='close'>&times;</a>";
                    echo "<span class='glyphicon glyphicon-exclamation-sign' aria-hidden='true'></span>";
                    echo " " . $error . "</br>";
                    echo "</div>";
开发者ID:andersoonluan,项目名称:PHP,代码行数:31,代码来源:recover.php

示例11: lang

    echo $usersCanRegister;
    ?>
 />
									<label for="usersCanRegister"></label>
									<span class="input-text"><?php 
    echo lang('USERS_CAN_REGISTER');
    ?>
</span>
								</div>

								<div class="input-group">
								<?php 
    if (Input::Get("usersMustConfirmEmail")) {
        $usersMustConfirmEmail = Input::Get("usersMustConfirmEmail") == "on" ? "checked" : "";
    } else {
        $usersMustConfirmEmail = Options::Get("users_must_confirm_email") ? "checked" : "";
    }
    ?>
									<input type="checkbox" id="usersMustConfirmEmail" name="usersMustConfirmEmail"  class='checkbox-style' aria-label="New users must confirm their email address" <?php 
    echo $usersMustConfirmEmail;
    ?>
 />
									<label for="usersMustConfirmEmail" ></label>
									<span class="input-text"><?php 
    echo lang('USERS_MUST_CONFIRM_EMAIL');
    ?>
</span>
								</div>
						<?php 
}
// User has admin permission
开发者ID:andersoonluan,项目名称:PHP,代码行数:31,代码来源:settings.php

示例12: user

<?php

/*
|--------------------------------------------------------------------------
| Common init file
|--------------------------------------------------------------------------
|
*/
require_once "core/commoninit.php";
require_once "core/language/language.php";
$user = new user();
$template = new Template();
if ($user->isLoggedIn()) {
    Redirect::to(Options::Get("siteurl") . 'index.php');
    exit;
}
if (Options::Get('users_can_register') == "0") {
    Redirect::to(Options::Get("siteurl") . 'index.php');
    exit;
}
$template->signUp();
开发者ID:andersoonluan,项目名称:PHP,代码行数:21,代码来源:signup.php


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