本文整理汇总了PHP中param类的典型用法代码示例。如果您正苦于以下问题:PHP param类的具体用法?PHP param怎么用?PHP param使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了param类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
parent::__construct();
//if (!module_exists(ROUTE_M)) showmessage(L('module_not_exists'));
$this->username = param::get_cookie('admin_username');
$this->db = pc_base::load_model('announce_model');
}
示例2: url
function url($action = 'check') {
$modules = '';
$site = getcache('sitelist','commons');
$sitename = $site['1']['name'];
$siturl = $site['1']['domain'];
foreach ($site as $list) $sitelist .= $list['domain'].',';
$pars = array(
'action'=>$action,
'ZLCMS_username'=>'',
'sitename'=>$sitename,
'siteurl'=>$siturl,
'charset'=>CHARSET,
'version'=>PC_VERSION,
'release'=>PC_RELEASE,
'os'=>PHP_OS,
'php'=>phpversion(),
'mysql'=>mysql_get_server_info(),
'browser'=>urlencode($_SERVER['HTTP_USER_AGENT']),
'username'=>urlencode(param::get_cookie('admin_username')),
'email'=> urlencode(param::get_cookie('admin_email')),
'modules'=>ROUTE_M,
'sitelist'=>urlencode($sitelist),
'uuid'=>urlencode($this->uuid),
);
$data = http_build_query($pars);
$verify = md5($this->uuid);
if($s = $this->module()) {
$p = '&p='.$s;
}
return $this->update_url.'?'.$data.'&verify='.$verify.$p;
}
示例3: publish
/**
* ***************************************
* 发表留言外部暴露接口
* ***************************************
*/
public function publish()
{
extract($this->setting);
//是否允许游客发表评论
if (!$allow_guest_post) {
if (!param::get_cookie('_userid') && !$_SESSION['userid']) {
showmessage('您需要登录才可以发表留言', HTTP_REFERER);
}
}
//是否启用了验证码
if ($use_code) {
if (isset($_POST['code'])) {
$code = isset($_POST['code']) && trim($_POST['code']) ? trim($_POST['code']) : showmessage('请输入验证码', HTTP_REFERER);
if ($_SESSION['code'] != strtolower($code)) {
showmessage('验证码错误', HTTP_REFERER);
}
}
}
$r = $this->api->add();
if (false !== $r) {
showmessage('发表成功', HTTP_REFERER);
} else {
showmessage('发表失败', HTTP_REFERER);
}
}
示例4: init
public function init()
{
$page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1;
$userid = param::get_cookie('_userid');
$sql = " `userid` = '{$userid}'";
if (isset($_GET['dosubmit'])) {
$type = isset($_GET['type']) && intval($_GET['type']) ? intval($_GET['type']) : '';
$endtime = isset($_GET['endtime']) && trim($_GET['endtime']) ? strtotime(trim($_GET['endtime'])) : '';
$starttime = isset($_GET['starttime']) && trim($_GET['starttime']) ? strtotime(trim($_GET['starttime'])) : '';
if (!empty($starttime) && empty($endtime)) {
$endtime = SYS_TIME;
}
if (!empty($starttime) && !empty($endtime) && $endtime < $starttime) {
showmessage(L('wrong_time_over_time_to_time_less_than'));
}
if (!empty($starttime)) {
$sql .= $sql ? " AND `creat_at` BETWEEN '{$starttime}' AND '{$endtime}' " : " `creat_at` BETWEEN '{$starttime}' AND '{$endtime}' ";
}
if (!empty($type)) {
$sql .= $sql ? " AND `type` = '{$type}' " : " `type` = '{$type}'";
}
}
$list = $this->spend_db->listinfo($sql, '`id` desc', $page);
$pages = $this->spend_db->pages;
include template('pay', 'spend_list');
}
示例5: editor
function editor($field, $value, $fieldinfo) {
$grouplist = getcache('grouplist','member');
$_groupid = param::get_cookie('_groupid');
$grouplist = $grouplist[$_groupid];
extract($fieldinfo);
extract(string2array($setting));
$disabled_page = isset($disabled_page) ? $disabled_page : 0;
if(!$height) $height = 300;
$allowupload = defined('IN_ADMIN') ? 1 : $grouplist['allowattachment'] ? 1: 0;
if(!$value) $value = $defaultvalue;
if($minlength || $pattern) $allow_empty = '';
if($minlength) $this->formValidator .= '$("#'.$field.'").formValidator({'.$allow_empty.'onshow:"",onfocus:"'.$errortips.'"}).functionValidator({
fun:function(val,elem){
var oEditor = CKEDITOR.instances.'.$field.';
var data = oEditor.getData();
if($(\'#islink\').attr(\'checked\')){
return true;
} else if(($(\'#islink\').attr(\'checked\')==false) && (data==\'\')){
return "'.$errortips.'";
} else if (data==\'\' || $.trim(data)==\'\') {
return "'.$errortips.'";
}
return true;
}
});';
return "<div id='{$field}_tip'></div>".'<textarea name="info['.$field.']" id="'.$field.'" boxid="'.$field.'">'.$value.'</textarea>'.form::editor($field,$toolbar,'content',$this->catid,'',$allowupload,1,'',$height,$disabled_page);
}
示例6: get
function get($data = array())
{
$_roleid = param::get_cookie('_roleid');
$_groupid = param::get_cookie('_groupid');
$this->data = $data;
if (isset($data['id'])) {
$this->id = $data['id'];
}
$info = array();
foreach ($this->fields as $field => $v) {
if (defined('IN_ADMIN')) {
if ($v['disabled'] || $v['iscore'] || check_in($_roleid, $v['unsetroleids']) || check_in($_groupid, $v['unsetgroupids'])) {
continue;
}
} else {
if ($v['disabled'] || $v['iscore'] || !$v['isadd'] || check_in($_roleid, $v['unsetroleids']) || check_in($_groupid, $v['unsetgroupids'])) {
continue;
}
}
$func = $v['formtype'];
$value = isset($data[$field]) ? new_html_special_chars($data[$field]) : '';
if ($func == 'pages' && isset($data['maxcharperpage'])) {
$value = $data['paginationtype'] . '|' . $data['maxcharperpage'];
}
if (!method_exists($this, $func)) {
continue;
}
$form = $this->{$func}($field, $value, $v);
if ($form !== false) {
$star = $v['minlength'] || $v['pattern'] ? 1 : 0;
$info[$field] = array('name' => $v['name'], 'tips' => $v['tips'], 'form' => $form, 'star' => $star, 'isbase' => $v['isbase'], 'isomnipotent' => $v['isomnipotent'], 'formtype' => $v['formtype']);
}
}
return $info;
}
示例7: manage
function manage() {
$tree = pc_base::load_sys_class('tree');
$tree->icon = array(' │ ',' ├─ ',' └─ ');
$tree->nbsp = ' ';
$userid = $_SESSION['userid'];
$admin_username = param::get_cookie('admin_username');
$result = $this->db->select('','*','','listorder ASC,id DESC');
foreach($result as $r) {
$r['cname'] = L($r['name'], '', 'member_menu');
$r['str_manage'] = '<a href="?m=member&c=member_menu&a=edit&id='.$r['id'].'&menuid='.$_GET['menuid'].'">'.L('edit').'</a> | <a href="javascript:confirmurl(\'?m=member&c=member_menu&a=delete&id='.$r['id'].'&menuid='.$_GET['menuid'].'\',\''.L('confirm',array('message'=>$r['cname'])).'\')">'.L('delete').'</a> ';
$array[] = $r;
}
$str = "<tr>
<td align='center'><input name='listorders[\$id]' type='text' size='3' value='\$listorder' class='input-text-c'></td>
<td align='center'>\$id</td>
<td >\$spacer\$cname</td>
<td align='center'>\$str_manage</td>
</tr>";
$tree->init($array);
$categorys = $tree->get_tree(0, $str);
include $this->admin_tpl('member_menu');
}
示例8: vote
function vote($id, $pid)
{
$M = getcache('ask', 'commons');
$M = $M[1];
$_username = param::get_cookie('_username');
$_userid = param::get_cookie('_userid');
$id = intval($id);
$pid = intval($pid);
$userid = intval($_userid);
if (!$id || !$pid || !$userid) {
return false;
}
$r = $this->db->get_one("count(voteid) AS num", $this->db_tablepre . "ask_vote", "askid={$id} AND userid={$userid}");
if ($r['num'] > 0) {
return false;
}
$a = $this->db->get_one('catid', $this->db_tablepre . "ask", "askid={$id} AND siteid=" . $this->siteid);
//检测表
$posts_table_name = $this->posts_table($a['catid']);
$this->table_name = $posts_table_name;
$this->update(array('votecount' => '+=1'), "pid={$pid}");
if ($M['vote_give_credit']) {
$maxnum = floor($M['vote_max_credit'] / $M['vote_give_credit']);
if ($r['num'] <= $maxnum) {
$this->credit->update_credit($_userid, $_username, $M['vote_give_credit'], 1);
pc_base::load_app_class('receipts', 'pay', 0);
receipts::point($M['vote_give_credit'], $_userid, $_username, $flag, 'selfincome', L('votes_the_reward_integral'), $_username);
}
}
$posts['askid'] = $id;
$posts['pid'] = $pid;
$posts['userid'] = $userid;
$posts['addtime'] = SYS_TIME;
return $this->db->insert($posts, $this->db_tablepre . "ask_vote");
}
示例9: __construct
function __construct()
{
$this->db = pc_base::load_model('content_model');
$this->_userid = param::get_cookie('_userid');
$this->_username = param::get_cookie('_username');
$this->_groupid = param::get_cookie('_groupid');
}
示例10: get
function get($data = array())
{
$_groupid = param::get_cookie('_groupid');
$this->data = $data;
if (isset($data['id'])) {
$this->id = $data['id'];
}
$info = array();
$info = array();
if (is_array($this->fields)) {
foreach ($this->fields as $field => $v) {
$func = $v['formtype'];
$value = isset($data[$field]) ? new_html_special_chars($data[$field]) : '';
if ($func == 'pages' && isset($data['maxcharperpage'])) {
$value = $data['paginationtype'] . '|' . $data['maxcharperpage'];
}
if (!method_exists($this, $func)) {
continue;
}
$form = $this->{$func}($field, $value, $v);
if ($form !== false) {
$star = $v['minlength'] || $v['pattern'] ? 1 : 0;
$info[$field] = array('name' => $v['name'], 'tips' => $v['tips'], 'form' => $form, 'star' => $star, 'isomnipotent' => $v['isomnipotent'], 'formtype' => $v['formtype']);
}
}
}
return $info;
}
示例11: __construct
function __construct()
{
$admin_username = param::get_cookie('admin_username');
$userid = $_SESSION['userid'];
$this->db = pc_base::load_model('badword_model');
parent::__construct();
}
示例12: __construct
function __construct() {
$this->userid = param::get_cookie('_userid');
if(!$this->userid) {
header("Location: index.php?m=member&c=index&a=login&forward=".urlencode(get_url()));
exit;
}
$this->username = param::get_cookie('_username');
}
示例13: __construct
function __construct() {
$this->db_config = pc_base::load_config('database');
$this->db_setting = 'default';
$this->table_name = 'message';
$this->_username = param::get_cookie('_username');
$this->_userid = param::get_cookie('_userid');
parent::__construct();
}
示例14: __construct
public function __construct() {
$this->message_db = pc_base::load_model('message_model');
$this->message_group_db = pc_base::load_model('message_group_model');
$this->message_data_db = pc_base::load_model('message_data_model');
$this->_username = param::get_cookie('_username');
$this->_userid = param::get_cookie('_userid');
$this->_groupid = get_memberinfo($this->_userid,'groupid');
}
示例15: check_member
/**
* 判断用户是否已经登陆
*/
public final function check_member()
{
$phpcms_auth = param::get_cookie('auth');
if (ROUTE_M == 'member' && ROUTE_C == 'index' && in_array(ROUTE_A, array('login', 'register', 'mini', 'send_newmail'))) {
if ($phpcms_auth && ROUTE_A != 'mini') {
showmessage(L('login_success', '', 'member'), 'index.php?m=member&c=index');
} else {
return true;
}
} else {
//判断是否存在auth cookie
if ($phpcms_auth) {
$auth_key = $auth_key = md5(pc_base::load_config('system', 'auth_key') . $_SERVER['HTTP_USER_AGENT']);
list($userid, $password) = explode("\t", sys_auth($phpcms_auth, 'DECODE', $auth_key));
//验证用户,获取用户信息
$this->memberinfo = $this->db->get_one(array('userid' => $userid));
//获取用户模型信息
$this->db->set_model($this->memberinfo['modelid']);
$this->_member_modelinfo = $this->db->get_one(array('userid' => $userid));
$this->_member_modelinfo = $this->_member_modelinfo ? $this->_member_modelinfo : array();
$this->db->set_model();
if (is_array($this->memberinfo)) {
$this->memberinfo = array_merge($this->memberinfo, $this->_member_modelinfo);
}
if ($this->memberinfo && $this->memberinfo['password'] === $password) {
if (!defined('SITEID')) {
define('SITEID', $this->memberinfo['siteid']);
}
if ($this->memberinfo['groupid'] == 1) {
param::set_cookie('auth', '');
param::set_cookie('_userid', '');
param::set_cookie('_username', '');
param::set_cookie('_groupid', '');
showmessage(L('userid_banned_by_administrator', '', 'member'), 'index.php?m=member&c=index&a=login');
} elseif ($this->memberinfo['groupid'] == 7) {
param::set_cookie('auth', '');
param::set_cookie('_userid', '');
param::set_cookie('_groupid', '');
//设置当前登录待验证账号COOKIE,为重发邮件所用
param::set_cookie('_regusername', $this->memberinfo['username']);
param::set_cookie('_reguserid', $this->memberinfo['userid']);
param::set_cookie('_reguseruid', $this->memberinfo['phpssouid']);
param::set_cookie('email', $this->memberinfo['email']);
showmessage(L('need_emial_authentication', '', 'member'), 'index.php?m=member&c=index&a=register&t=2');
}
} else {
param::set_cookie('auth', '');
param::set_cookie('_userid', '');
param::set_cookie('_username', '');
param::set_cookie('_groupid', '');
}
unset($userid, $password, $phpcms_auth, $auth_key);
} else {
$forward = isset($_GET['forward']) ? urlencode($_GET['forward']) : urlencode(get_url());
showmessage(L('please_login', '', 'member'), 'index.php?m=member&c=index&a=login&forward=' . $forward);
}
}
}