本文整理汇总了PHP中settings类的典型用法代码示例。如果您正苦于以下问题:PHP settings类的具体用法?PHP settings怎么用?PHP settings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了settings类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
include dirname(__FILE__) . '/settings_path.php';
$settings = new settings();
// load the settings
$this->options = $settings->settings();
}
开发者ID:laiello,项目名称:bz-owl,代码行数:7,代码来源:config.php
示例2: login
public static function login($user_id = null)
{
if ($user_id === null) {
$user_id = template_session::get_user_id();
}
if (!$user_id) {
return false;
}
$user = users::get($user_id);
if (!$user) {
return false;
}
template_session::set_user_id($user->id);
template_session::set_user_name($user->name);
$setting_popup = settings::get_popup($user->id);
template_session::set_use_popup($setting_popup->value);
switch ($user->role_id) {
case RUDE_ROLE_ADMIN:
template_session::set_authorized();
template_session::set_admin();
template_session::set_editor();
template_session::set_user();
break;
case RUDE_ROLE_EDITOR:
template_session::set_authorized();
template_session::set_editor();
template_session::set_user();
break;
case RUDE_ROLE_USER:
template_session::set_authorized();
template_session::set_user();
break;
}
return true;
}
开发者ID:ThisNameWasFree,项目名称:rude-univ,代码行数:35,代码来源:rude-template-session.php
示例3: listAction
public function listAction()
{
$NS = new Zend_Session_Namespace('Default');
$arrSort = array();
$params = array();
$page = $this->getRequest()->getParam('page');
$sort = $this->getRequest()->getParam('sort');
if (!empty($sort)) {
$arrSort[] = $this->SortingData($sort);
$arrSort[] = $sort;
}
$page = !empty($page) && is_numeric($page) ? $page : 1;
$params['search'][] = array('method' => 'andWhere', 'criteria' => "(c.customer_id = ? OR c.parent_id = ?)", 'value' => array($NS->customer['customer_id'], $NS->customer['customer_id']));
// $params['search'][] = array ('method' => 'whereIn', 'criteria' => "o.status_id", 'value' => array(Statuses::id('paid', 'orders'), Statuses::id('complete', 'orders')));
$data = $this->services->findAll("d.order_id, oid.relationship_id, d.description, CONCAT(dm.domain, '.', ws.tld) as domain, s.status as Status, DATE_FORMAT(d.date_start, '" . settings::getMySQLDateFormat() . "') as Creation_Date, DATEDIFF(d.date_end, CURRENT_DATE) as daysleft, DATE_FORMAT(d.date_end, '" . settings::getMySQLDateFormat() . "') as Expiring_Date, d.product_id", $page, $NS->recordsperpage, $arrSort, $params);
$data['currentpage'] = $page;
for ($i = 0; $i < count($data['records']); $i++) {
$data['records'][$i]['description'] = Shineisp_Commons_Utilities::truncate($data['records'][$i]['description'], 40);
$data['records'][$i]['daysleft'] = $data['records'][$i]['daysleft'] < 30 ? "<span class='label label-danger'>" . $data['records'][$i]['daysleft'] . "</span>" : "<span class='label label-success'>" . $data['records'][$i]['daysleft'] . "</span>";
}
$data['columns'][] = $this->translator->translate('Description');
$data['columns'][] = $this->translator->translate('Domain');
$data['columns'][] = $this->translator->translate('Status');
$data['columns'][] = $this->translator->translate('Creation Date');
$data['columns'][] = $this->translator->translate('Days left');
$data['columns'][] = $this->translator->translate('Expiry Date');
$this->view->mex = $this->getRequest()->getParam('mex');
$this->view->mexstatus = $this->getRequest()->getParam('status');
$this->view->title = $this->translator->translate("Services List");
$this->view->description = $this->translator->translate("List of all your own services subscribed");
$this->view->service = $data;
}
开发者ID:kokkez,项目名称:shineisp,代码行数:32,代码来源:ServicesController.php
示例4: save
function save()
{
settings::set('feedback', 'feedback_email', params::get('feedback_email'));
settings::set('feedback', 'feedback_subject', params::get('feedback_subject'));
settings::save('feedback');
headers::self();
}
开发者ID:rigidus,项目名称:ea,代码行数:7,代码来源:main.module.php
示例5: initialisePlugin
public static function initialisePlugin()
{
// NB Network activation will not upgrade a site
// do upgrade will check current upgrade script version and apply as necessary
upgrader::checkUpgrade();
// 2 is required for $file to be populated
add_filter('plugin_row_meta', array(__CLASS__, 'filter_plugin_row_meta'), 10, 2);
add_action('do_robots', array(__CLASS__, 'addRobotLinks'), 100, 0);
add_action('wp_head', array(__CLASS__, 'addRssLink'), 100);
// only include admin files when necessary.
if (is_admin()) {
include_once 'settings.php';
include_once 'postMetaData.php';
include_once 'categoryMetaData.php';
settings::addHooks();
categoryMetaData::addHooks();
postMetaData::addHooks();
}
if (!wp_get_schedule('xmsg_ping')) {
// ping in 2 hours from when setup.
wp_schedule_event(time() + 60 * 60 * 2, 'daily', 'xmsg_ping');
}
add_action('xmsg_ping', array(__CLASS__, 'doPing'));
// NB Network activation will not have set up the rules for the site.
// Check if they exist and then reactivate.
if (get_option(RULES_OPTION_NAME, null) != RULES_VERSION) {
add_action('wp_loaded', array(__CLASS__, 'activateRewriteRules'), 99999, 1);
}
}
开发者ID:wistel,项目名称:wordpress,代码行数:29,代码来源:core.php
示例6: getInstance
public static function getInstance() {
if(!self::$me) {
$class = new settings();
self::$me=$class;
}
return self::$me;
}
开发者ID:jiangsuei8,项目名称:public_php_shl,代码行数:7,代码来源:settings.php
示例7: showMCServer
public function showMCServer($id)
{
if (count(DB::table('mcservers')->where('mcs_id', '=', $id)->first())) {
$title = settings::get("siteName") . " - Servidor De Minecraft";
return View::make('index.MCServer')->with('title', $title)->with('id', $id);
} else {
return Redirect::to(URL::to('/minecraft'));
}
}
开发者ID:G4brym,项目名称:ServerList.pt,代码行数:9,代码来源:IndexController.php
示例8: genToken
public static function genToken()
{
try {
$code = str_random(30);
settings::set("securityToken", $code);
} catch (ParseException $e) {
printf("Can´t generate a new Token: %s", $e->getMessage());
}
}
开发者ID:G4brym,项目名称:ServerList.pt,代码行数:9,代码来源:settings.php
示例9: reply
public function reply()
{
include_once ROOT_DIR . 'lib/class/settings.class.php';
$setting = new settings();
$result_setttings = $setting->getMark('mblog_comment');
if (!empty($result_setttings) && $result_setttings['state']) {
$this->errorOutput('评论回复已关闭');
}
$userinfo = $this->mUser->verify_credentials();
if (!$userinfo['id']) {
$this->errorOutput(USENAME_NOLOGIN);
}
$status_id = intval($this->input['status_id']);
$cid = intval($this->input['cid']);
$text = urldecode($this->input['text']);
(!$status_id || !$text) && $this->errorOutput(OBJECT_NULL);
//点滴id为空就返回错误
$time = time();
$query_info = $this->db->query_first('SELECT member_id FROM ' . DB_PREFIX . 'status_comments WHERE id = ' . $cid);
!$query_info && $this->errorOutput(OBJECT_NULL);
$sql = 'INSERT INTO ' . DB_PREFIX . 'status_comments ( status_id , member_id , content , comment_time , reply_comment_id , reply_member_id )
VALUES(' . $status_id . ', ' . $userinfo['id'] . ', "' . $text . '" , "' . $time . '" , ' . $cid . ',' . $query_info['member_id'] . ')';
$this->db->query($sql);
$insert_id = $this->db->insert_id();
$query_info = $this->db->query_first('SELECT member_id FROM ' . DB_PREFIX . 'status_comments WHERE status_id = ' . $status_id . ' AND id = ' . $cid);
//将该条点滴的评论次数加1
$this->db->query('UPDATE ' . DB_PREFIX . 'status_extra SET comment_count = comment_count + 1 WHERE status_id = ' . $status_id);
$members = $this->mUser->getUserById($userinfo['id']);
$members = $members[0];
$status = $this->mStatus->show($status_id);
$return_array = array('id' => $insert_id, 'text' => $text, 'create_at' => $time, 'reply_member_id' => $query_info['member_id'], 'reply_comment_id' => $cid, 'status' => $status[0], 'user' => $members);
if ($userinfo['id'] != $query_info['member_id'] && $userinfo['id'] != $status[0]['user']['id']) {
$notify_userid = $query_info['member_id'] . ',' . $status[0]['user']['id'];
//加通知
include_once ROOT_PATH . 'lib/class/notify.class.php';
$notify = new notify();
$content = array('title' => '新回复', 'page_link' => SNS_MBLOG . 'all_comment.php');
$content = serialize($content);
$notyfy_arr = $notify->notify_send($notify_userid, $content, 2);
//发新评论通知
}
$this->addItem($return_array);
$this->output();
}
开发者ID:h3len,项目名称:Project,代码行数:44,代码来源:comment_reply.php
示例10: deal_upload
/**
* 上传处理
*/
public function deal_upload()
{
include_once ROOT_DIR . 'lib/class/settings.class.php';
$setting = new settings();
$result_setttings = $setting->getMark('video');
if (!empty($result_setttings) && $result_setttings['state']) {
echo '视频发布已关闭';
}
$video_path = $_FILES['videofile']['tmp_name'];
//视频的在本地的目录
$file_name = basename($_FILES['videofile']['name']);
//视频的文件
$file_size = $_FILES['videofile']['size'];
//视频的大小
$video_name = trim($this->input['video_name']);
//视频名称
$video_brief = trim($this->input['video_brief']);
//视频简介
$video_tags = trim($this->input['video_tags']);
//视频标签
$video_sort = $this->input['video_sort'];
//视频分类
$video_copyright = $this->input['video_copyright'];
//视频版权
include_once ROOT_PATH . 'lib/class/curl.class.php';
$this->curl = new curl();
$this->curl->setSubmitType('post');
$this->curl->setReturnFormat('json');
$this->curl->initPostData();
$this->curl->addRequestData('a', 'deal_upload');
$this->curl->addRequestData('video_path', $video_path);
$this->curl->addFile($_FILES);
$this->curl->addRequestData('file_name', $file_name);
$this->curl->addRequestData('file_size', $file_size);
$this->curl->addRequestData('video_name', $video_name);
$this->curl->addRequestData('video_brief', $video_brief);
$this->curl->addRequestData('video_tags', $video_tags);
$this->curl->addRequestData('video_sort', $video_sort);
$this->curl->addRequestData('video_copyright', $video_copyright);
$r = $this->curl->request('video/upload_video.php');
echo $r;
}
开发者ID:h3len,项目名称:Project,代码行数:45,代码来源:upload.php
示例11: setStatus
/**
* Устанавливает или проверяет статус дня рождения.
*
* @param integer $status статус
*
* @return integer 1 в случае успеха, 0 в случае ошибки
*/
public function setStatus($status)
{
if (pg_affected_rows(settings::SetVariable('birthday' . $this->year, 'status', $status))) {
return 1;
}
$sql = "INSERT INTO settings (id, module, variable, value) SELECT COALESCE(MAX(id),0)+1, 'birthday{$this->year}', 'status', '{$status}' FROM settings";
if (pg_query(DBConnect(), $sql)) {
return 1;
}
return 0;
}
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:18,代码来源:birthday.php
示例12: sendFeedback
function sendFeedback()
{
$mail_content = params::get('message');
$email = params::get('email');
if (!empty($mail_content) && !empty($email)) {
mail::from($email);
mail::html($mail_content);
mail::subject(settings::get('feedback', 'feedback_subject'));
mail::send(settings::get('feedback', 'feedback_email'));
headers::url('/contacts/success/');
}
}
开发者ID:rigidus,项目名称:ea,代码行数:12,代码来源:main.handler.php
示例13: save
function save()
{
settings::set('pages', 'global_page_keywords', params::get('global_page_keywords'));
settings::set('pages', 'global_page_description', params::get('global_page_description'));
settings::set('pages', 'global_page_keywords_check', params::isCheck('global_page_keywords_check'));
settings::set('pages', 'global_page_description_check', params::isCheck('global_page_description_check'));
settings::set('pages', 'redactor', params::isCheck('redactor'));
settings::set('pages', 'jip', params::isCheck('jip'));
settings::set('pages', 'global_page_title', params::get('global_page_title'));
settings::save('pages');
headers::self();
}
开发者ID:rigidus,项目名称:ea,代码行数:12,代码来源:settings.module.php
示例14: name
function name($id) {
$name = '';
$attr1 = settings::getInstance()->getrow(array('tag'=>'table-archive'));
if ($attr1['value'])
self::$var = @unserialize($attr1['value']);
else
self::$var = array();
preg_match_all('/\(([\d\w]+)\)(\S+)/is',self::$var['attr1'],$result,PREG_SET_ORDER);
$id_arr = explode(',',$id);
foreach($result as $v){
foreach($id_arr as $t_v){
if(in_array($t_v,$v))
$name .= $v[2].' / ';
}
}
return $name;
}
开发者ID:jiangsuei8,项目名称:public_php_shl,代码行数:17,代码来源:attr1.php
示例15: list_action
function list_action() {
chkpw('union_list');
$set1=settings::getInstance();
$sets1=$set1->getrow(array('tag'=>'table-'.$this->table));
$setsdata1=unserialize($sets1['value']);
$this->view->settings=$setsdata1;
$where=null;
$ordre='`userid` DESC';
$limit=((front::get('page') -1) * $this->_pagesize).','.$this->_pagesize;
$this->_view_table=$this->_table->getrows($where,$limit,$ordre,$this->_table->getcols('manage'));
$this->view->record_count=$this->_table->record_count;
$this->_view_user = new user;
foreach($this->_view_table as $key=>$val) {
$userunion = $this->_view_user->getrow(array('userid'=>$val['userid']));
$val['point'] = $userunion['point'];
$this->_view_table[$key] = $val;
}
}
开发者ID:jiangsuei8,项目名称:public_php_shl,代码行数:18,代码来源:union_admin.php
示例16: element
/**
* Create the HTML
*
* @param string $action Name of AJAX action to run.
* @param string|bool $atts Optional. Additional data-* to use in element. Each att must start with data-, unless it is whitelisted in the allow_without_data_prefix() method. "class" & 'data-action' can never be set here. The filter "baldrick_wp_front_end_html_attributes" gives you the ability to override those.
* @param string|bool $text Optional. Text to use for link trigger. If false, the default, there will be no trigger.
* *@param string|bool $api Optional. URL for AJAX API to process with. Default is WordPress' AJAX API
*
* @return string
*/
public static function element($action, $atts = false, $text = false, $api = false)
{
$atts['class'] = settings::$baldrick_class;
$atts['data-action'] = $action;
if (!isset($atts['data-request'])) {
if ($api && filter_var($api, FILTER_VALIDATE_URL)) {
$atts['data-request'] = $api;
} else {
$atts['data-request'] = settings::default_api();
}
}
$att_out = array();
foreach ($atts as $att => $value) {
if (0 !== strpos($att, 'data-')) {
if (self::allow_without_data_prefix($att)) {
$att = 'data-' . $att;
}
}
$att_out[] = esc_attr($att) . '="' . esc_attr($value) . '"';
}
/**
* Filter the attributes used to build the HTML element for the Baldrick trigger
*
* IMPORTANT: This filter runs <em>after</em> attributes are validated and sanitized. No further validation, sanitization, or escaping is provided after this point, other than ensuring it returns an array.
*
* @param array $att_out The array of attributes that will be used to build the HTML element
* @param string $action Current action being run.
* @param array $atts The attributes passed to method, before validation.
*/
$filter_atts = apply_filters('baldrick_wp_front_end_html_attributes', $att_out, $action, $atts);
if (is_array($filter_atts)) {
$att_out = $filter_atts;
}
$att_out = implode(' ', $att_out);
$out[] = '<a ';
$out[] = $att_out;
$out[] = ' >';
if ($text) {
$out[] = $text;
}
$out[] = '</a>';
return implode('', $out);
}
开发者ID:calderawp,项目名称:baldrick-wp-front-end,代码行数:53,代码来源:html.php
示例17: getTags
static function getTags() {
$data=array();
$data[0] = '请选择';
$otag = new tag();
$row = $otag->getrows('',0,'tagid ASC');
if(is_array($row)){
foreach ($row as $arr){
$data[$arr['tagname']] = $arr['tagname'];
}
}
//return $data;
$sets=settings::getInstance()->getrow(array('tag'=>'table-hottag'));
if (!is_array($sets)){
return $data;
}
$data1=unserialize($sets['value']);
preg_match_all('%\(([\d\w\/\.-]+)\)(\S+)%m',$data1['hottag'],$result,PREG_SET_ORDER);
foreach ($result as $res)
$data[$res[2]]=$res[2];
return $data;
}
开发者ID:jiangsuei8,项目名称:public_php_shl,代码行数:22,代码来源:tag.php
示例18: init
public static function init()
{
$username = get('username');
$password = get('password');
//$role_id = get('role_id');
if (!$username) {
exit('Пожалуйста, укажите имя для пользователя.');
}
if (!$password) {
exit('Пожалуйста, укажите пароль пользователю.');
}
if (string::length($password) < 6) {
exit('Ваш пароль должен быть длиной 6 или более символов.');
}
if (users::is_exists($username)) {
exit('Данный пользователь уже существует. Попробуйте указать другое имя.');
}
$user_id = users::add($username, $password, RUDE_ROLE_USER);
if (!$user_id) {
exit('Произошла непредвиденная ошибка. Пожалуйста, обратитесь к администратору сайта и расскажите после каких действий вы увидели данное сообщение.');
}
settings::add($user_id);
template_session::login($user_id);
}
开发者ID:ThisNameWasFree,项目名称:rude-univ,代码行数:24,代码来源:rude-ajax-registration.php
示例19: comment
public function comment()
{
include_once ROOT_DIR . 'lib/class/settings.class.php';
$setting = new settings();
$result_setttings = $setting->getMark('mblog_comment');
if (!empty($result_setttings) && $result_setttings['state']) {
$this->errorOutput('评论已关闭');
}
$userinfo = $this->mUser->verify_credentials();
if (!$userinfo['id']) {
$this->errorOutput(USENAME_NOLOGIN);
}
$id = $this->input['id'];
$content = urldecode($this->input['content']);
include_once ROOT_DIR . 'lib/class/banword.class.php';
$banword = new banword();
$status = 0;
$banwords = $banword->banword(urlencode($content));
if ($banwords && $banwords != 'null') {
$status = 1;
$banwords = implode(',', $banwords);
} else {
$banwords = '';
}
//此ID没有用处
$cid = intval($this->input['cid']);
$time = time();
!$cid ? $and = '' : ($and = ' , reply_comment_id = ' . $cid);
$sql = 'INSERT INTO ' . DB_PREFIX . 'status_comments SET status_id = ' . $id . ', flag = ' . $status . ',member_id = ' . $userinfo['id'] . ',content = "' . $content . '",comment_time = "' . $time . '",ip = "' . hg_getip() . '"';
$sql .= $and;
$this->setXmlNode('comments', 'comment');
/**
* 获取该条点滴的用户ID
*/
$this->curl->setSubmitType('post');
$this->curl->setReturnFormat('json');
$this->curl->addRequestData('status_id', $id);
$user_id = $this->curl->request('statuses/getUserIdByStatusId.php');
/**
* 获取该用户的权限
*/
$this->curl->setSubmitType('post');
$this->curl->setReturnFormat('json');
$this->curl->addRequestData('id', $user_id);
$tmp = $this->curl->request('users/get_authority.php');
$authority = $tmp[0];
//评论权限
$comment_authority = intval($authority[18]);
/**
* 获取与该用户的关系
*/
$this->curl->setSubmitType('post');
$this->curl->setReturnFormat('json');
$this->curl->addRequestData('source_id', $userinfo['id']);
$this->curl->addRequestData('target_id', $user_id);
$relation = $this->curl->request('friendships/show.php');
//任何人可评论
if ($comment_authority == 0) {
$this->db->query($sql);
}
//关注的人可评论
if ($comment_authority == 1) {
//关注
if ($relation == 3 || $relation == 1) {
$this->db->query($sql);
} else {
$this->errorOutput(NO_AUTHORITY);
}
}
//任何人不可评论
if ($comment_authority == 2) {
$this->errorOutput(NO_AUTHORITY);
}
// $this->db->query($sql);
$insert_id = $this->db->insert_id();
$members = $this->mUser->getUserById($userinfo['id']);
//评论者的信息数组
$members = $members[0];
//将点滴的评论次数加1
$sql_str = 'UPDATE ' . DB_PREFIX . 'status_extra SET comment_count = comment_count + 1 WHERE status_id = ' . $id;
$this->db->query($sql_str);
$status_info = $this->mStatus->show($id);
$return_array = array('id' => $insert_id, 'text' => $content, 'create_at' => $time, 'user' => $members, 'status' => $status_info[0]);
$this->addItem($return_array);
$this->output();
}
开发者ID:h3len,项目名称:Project,代码行数:86,代码来源:comment.php
示例20: array_merge
}
if (!isset($globalTransaction)) {
$settings = array_merge($settings, array('globalTransaction' => 'TRUE'));
}
// Set some defaults values...
if (!isset($globalAircraftImageSources)) {
$globalAircraftImageSources = array('ivaomtl', 'wikimedia', 'deviantart', 'flickr', 'bing', 'jetphotos', 'planepictures', 'planespotters');
$settings = array_merge($settings, array('globalAircraftImageSources' => $globalAircraftImageSources));
}
if (!isset($globalSchedulesSources)) {
$globalSchedulesSources = array('flightmapper', 'costtotravel', 'flightradar24', 'flightaware');
$settings = array_merge($settings, array('globalSchedulesSources' => $globalSchedulesSources));
}
$settings = array_merge($settings, array('globalInstalled' => 'TRUE'));
if ($error == '') {
settings::modify_settings($settings);
}
if ($error != '') {
print '<div class="info column">' . $error . '</div>';
require '../footer.php';
exit;
} else {
if (isset($_POST['waypoints'])) {
$_SESSION['waypoints'] = 1;
}
$_SESSION['install'] = 'database_import';
//require('../footer.php');
print '<div class="info column"><ul>';
if (isset($_POST['createdb'])) {
$_SESSION['done'] = array('Create database', 'Write configuration');
print '<li>Create database....<strong>SUCCESS</strong></li>';
开发者ID:kletellier,项目名称:FlightAirMap,代码行数:31,代码来源:index.php
注:本文中的settings类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论