本文整理汇总了PHP中settings类的典型用法代码示例。如果您正苦于以下问题:PHP settings类的具体用法?PHP settings怎么用?PHP settings使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了settings类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
include dirname(__FILE__) . '/settings_path.php';
$settings = new settings();
// load the settings
$this->options = $settings->settings();
}
示例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;
}
示例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;
}
示例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();
}
示例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);
}
}
示例6: getInstance
public static function getInstance() {
if(!self::$me) {
$class = new settings();
self::$me=$class;
}
return self::$me;
}
示例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'));
}
}
示例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());
}
}
示例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();
}
示例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;
}
示例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;
}
示例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/');
}
}
示例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();
}
示例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;
}
示例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;
}
}