本文整理汇总了PHP中uc_addslashes函数的典型用法代码示例。如果您正苦于以下问题:PHP uc_addslashes函数的具体用法?PHP uc_addslashes怎么用?PHP uc_addslashes使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了uc_addslashes函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onsendpm
function onsendpm($arr)
{
@extract($arr, EXTR_SKIP);
//fromuid, msgto, subject, message, replypmid, isusername
if ($fromuid) {
$user = $_ENV['user']->get_user_by_uid($fromuid);
$user = uc_addslashes($user, 1);
if (!$user) {
return 0;
}
$this->user['uid'] = $user['uid'];
$this->user['username'] = $user['username'];
} else {
$this->user['uid'] = 0;
$this->user['username'] = '';
$replypmid = 0;
}
if ($replypmid) {
$isusername = 1;
$pms = $_ENV['pm']->get_pm_by_pmid($this->user['uid'], $replypmid);
if ($pms[0]['msgfromid'] == $this->user['uid']) {
$user = $_ENV['user']->get_user_by_uid($pms[0]['msgtoid']);
$msgto = $user['username'];
} else {
$msgto = $pms[0]['msgfrom'];
}
}
$msgto = array_unique(explode(',', $msgto));
$isusername && ($msgto = $_ENV['user']->name2id($msgto));
$blackls = $_ENV['pm']->get_blackls($this->user['uid'], $msgto);
$lastpmid = 0;
foreach ($msgto as $uid) {
if (!$fromuid || !in_array('{ALL}', $blackls[$uid])) {
$blackls[$uid] = $_ENV['user']->name2id($blackls[$uid]);
if (!$fromuid || isset($blackls[$uid]) && !in_array($this->user['uid'], $blackls[$uid])) {
$lastpmid = $_ENV['pm']->sendpm($subject, $message, $this->user, $uid, $replypmid);
}
}
}
return $lastpmid;
}
示例2: uc_api_mysql
function uc_api_mysql($model, $action, $args = array())
{
global $uc_controls;
if (empty($uc_controls[$model])) {
include_once UC_ROOT . './lib/db.class.php';
include_once UC_ROOT . './model/base.php';
include_once UC_ROOT . "./control/{$model}.php";
eval("\$uc_controls['{$model}'] = new {$model}control();");
}
if ($action[0] != '_') {
$args = uc_addslashes($args, 1, TRUE);
$action = 'on' . $action;
$uc_controls[$model]->input = $args;
return $uc_controls[$model]->{$action}($args);
} else {
return '';
}
}
示例3: sendpm
function sendpm($subject, $message, $msgfrom, $msgto, $related = 0)
{
$_CACHE = $this->base->cache('badwords');
if ($_CACHE['badwords']['findpattern']) {
$subject = @preg_replace($_CACHE['badwords']['findpattern'], $_CACHE['badwords']['replace'], $subject);
$message = @preg_replace($_CACHE['badwords']['findpattern'], $_CACHE['badwords']['replace'], $message);
}
$subject = trim($subject);
if ($subject == '' && !$related) {
$subject = $this->base->cutstr(trim($message), 50);
if ($subject == '') {
return 0;
}
} else {
$subject = $this->base->cutstr(trim($subject), 75, '');
}
$new = 1;
if (!$related) {
$this->db->query("INSERT INTO " . UC_DBTABLEPRE . "pms (msgfrom,msgfromid,msgtoid,folder,new,subject,dateline,related,message) VALUES\r\n\t\t\t\t('" . $msgfrom['username'] . "','" . $msgfrom['uid'] . "','{$msgto}','inbox','{$new}','{$subject}','" . $this->base->time . "','0','{$message}')");
$lastpmid = $related = $this->db->insert_id();
} else {
$arr = $this->db->fetch_all("SELECT * FROM " . UC_DBTABLEPRE . "pms WHERE pmid='{$related}' AND related='0'");
$arr = $arr[0];
if ($arr['message'][0] != "\t") {
$arr = uc_addslashes($arr, 1);
$this->db->query("UPDATE " . UC_DBTABLEPRE . "pms SET message='\t" . $this->removecode($arr['message'], 200) . "', related='0' WHERE pmid='{$related}'");
$this->db->query("INSERT INTO " . UC_DBTABLEPRE . "pms (msgfrom, msgfromid, msgtoid, folder, new, subject, dateline, message, delstatus, related)\r\n\t\t\t\t\tVALUES ('{$arr['msgfrom']}', '{$arr['msgfromid']}', '{$arr['msgtoid']}', '{$arr['folder']}', '{$arr['new']}', '{$arr['subject']}', '{$arr['dateline']}', '{$arr['message']}', '{$arr['delstatus']}', '{$related}')");
}
$this->db->query("INSERT INTO " . UC_DBTABLEPRE . "pms (msgfrom,msgfromid,msgtoid,folder,new,subject,dateline,related,message) VALUES\r\n\t\t\t\t('" . $msgfrom['username'] . "','" . $msgfrom['uid'] . "','{$msgto}','inbox','{$new}','{$subject}','" . $this->base->time . "','{$related}','{$message}')");
$lastpmid = $this->db->insert_id();
$new = $arr['msgfromid'] == $msgfrom['uid'] ? 1 : 2;
}
$new = $msgto ? $new : 0;
$this->db->query("UPDATE " . UC_DBTABLEPRE . "pms SET delstatus='0', new='{$new}', dateline='" . $this->base->time . "' WHERE pmid='{$related}'", 'UNBUFFERED');
$this->db->query("REPLACE INTO " . UC_DBTABLEPRE . "newpm (uid) VALUES ('{$msgto}')");
return $lastpmid;
}
示例4: check_adminuser
function check_adminuser($username, $password, $email)
{
include ROOT_PATH . CONFIG_UC;
include ROOT_PATH . './uc_client/client.php';
$error = '';
$ucresult = uc_user_login($username, $password);
list($tmp['uid'], $tmp['username'], $tmp['password'], $tmp['email']) = uc_addslashes($ucresult);
$ucresult = $tmp;
if ($ucresult['uid'] <= 0) {
$uid = uc_user_register($username, $password, $email);
if ($uid == -1 || $uid == -2) {
$error = 'admin_username_invalid';
} elseif ($uid == -4 || $uid == -5 || $uid == -6) {
$error = 'admin_email_invalid';
} elseif ($uid == -3) {
$error = 'admin_exist_password_error';
}
} else {
$uid = $ucresult['uid'];
$email = $ucresult['email'];
$password = $ucresult['password'];
}
if (!$error && $uid > 0) {
$password = md5($password);
uc_user_addprotected($username, '');
} else {
$uid = 0;
$error = empty($error) ? 'error_unknow_type' : $error;
}
return array('uid' => $uid, 'username' => $username, 'password' => $password, 'email' => $email, 'error' => $error);
}
示例5: name2id
function name2id($usernamesarr)
{
$usernamesarr = uc_addslashes($usernamesarr, 1, TRUE);
$usernames = $this->base->implode($usernamesarr);
$query = $this->db->query("SELECT uid FROM " . UC_DBTABLEPRE . "members WHERE username IN({$usernames})");
$arr = array();
while ($user = $this->db->fetch_array($query)) {
$arr[] = $user['uid'];
}
return $arr;
}
示例6: check_adminuser
function check_adminuser($username, $password, $email)
{
@(include ROOT_PATH . './config.inc.php');
include ROOT_PATH . './uc_client/client.php';
$error = '';
$uid = uc_user_register($username, $password, $email);
/*
-1 : 用户名不合法
-2 : 包含不允许注册的词语
-3 : 用户名已经存在
-4 : email 格式有误
-5 : email 不允许注册
-6 : 该 email 已经被注册
>1 : 表示成功,数值为 UID
*/
if ($uid == -1 || $uid == -2) {
$error = 'admin_username_invalid';
} elseif ($uid == -4 || $uid == -5 || $uid == -6) {
$error = 'admin_email_invalid';
} elseif ($uid == -3) {
$ucresult = uc_user_login($username, $password);
list($tmp['uid'], $tmp['username'], $tmp['password'], $tmp['email']) = uc_addslashes($ucresult);
$ucresult = $tmp;
if ($ucresult['uid'] <= 0) {
$error = 'admin_exist_password_error';
} else {
$uid = $ucresult['uid'];
$email = $ucresult['email'];
$password = $ucresult['password'];
}
}
if (!$error && $uid > 0) {
$password = md5($password);
uc_user_addprotected($username, '');
} else {
$uid = 0;
$error = empty($error) ? 'error_unknow_type' : $error;
}
return array('uid' => $uid, 'username' => $username, 'password' => $password, 'email' => $email, 'error' => $error);
}
示例7: check_adminuser
function check_adminuser($username, $password, $email)
{
@(include ROOT_PATH . './config.inc.php');
include ROOT_PATH . './uc_client/client.php';
$error = '';
$uid = uc_user_register($username, $password, $email);
/*vot comments:
-1 : The user name is not valid
-2 : Contains not allowed words
-3 : User name already exists
-4 : Email format is wrong
-5 : THis Email is not allowed for registration
-6 : This email is not registered
>1 : the UID is successfully identified
*/
if ($uid == -1 || $uid == -2) {
$error = 'admin_username_invalid';
} elseif ($uid == -4 || $uid == -5 || $uid == -6) {
$error = 'admin_email_invalid';
} elseif ($uid == -3) {
$ucresult = uc_user_login($username, $password);
list($tmp['uid'], $tmp['username'], $tmp['password'], $tmp['email']) = uc_addslashes($ucresult);
$ucresult = $tmp;
if ($ucresult['uid'] <= 0) {
$error = 'admin_exist_password_error';
} else {
$uid = $ucresult['uid'];
$email = $ucresult['email'];
$password = $ucresult['password'];
}
}
if (!$error && $uid > 0) {
$password = md5($password);
uc_user_addprotected($username, '');
} else {
$uid = 0;
$error = empty($error) ? 'error_unknow_type' : $error;
}
return array('uid' => $uid, 'username' => $username, 'password' => $password, 'email' => $email, 'error' => $error);
}
示例8: _uc_get_user_full
private function _uc_get_user_full($username, $isuid = 0)
{
global $uc_controls;
if (empty($uc_controls['user'])) {
require_once DOKU_INC . '/uc_client/lib/db.class.php';
require_once DOKU_INC . '/uc_client/model/base.php';
require_once DOKU_INC . '/uc_client/control/user.php';
$uc_controls['user'] = new usercontrol();
}
$args = uc_addslashes(array('username' => $username, 'isuid' => $isuid), 1, TRUE);
$uc_controls['user']->input = $args;
$uc_controls['user']->init_input();
$username = $uc_controls['user']->input('username');
if (!$uc_controls['user']->input('isuid')) {
$status = $_ENV['user']->get_user_by_username($username);
} else {
$status = $_ENV['user']->get_user_by_uid($username);
}
if ($status) {
// do not return salt.
return array('uid' => $status['uid'], 'username' => $status['username'], 'grps' => $this->_get_user_group($status['uid'], 1), 'password' => $status['password'], 'email' => $status['email'], 'regip' => $status['regip'], 'regdate' => $status['regdate'], 'lastloginip' => $status['lastloginip'], 'lastlogintime' => $status['lastlogintime']);
} else {
return 0;
}
}