• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP uc_addslashes函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;
 }
开发者ID:jn7163,项目名称:ShopNC,代码行数:41,代码来源:pm.php


示例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 '';
    }
}
开发者ID:armebayelm,项目名称:thinksns-vietnam,代码行数:18,代码来源:client.php


示例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;
 }
开发者ID:ablozhou,项目名称:hairnet,代码行数:37,代码来源:pm.php


示例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);
}
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:install_function.php


示例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;
 }
开发者ID:fishling,项目名称:chatPro,代码行数:11,代码来源:user.php


示例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);
}
开发者ID:h3len,项目名称:Project,代码行数:40,代码来源:func.inc.php


示例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);
}
开发者ID:v998,项目名称:discuzx-en,代码行数:40,代码来源:func.inc.php


示例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;
     }
 }
开发者ID:spoonysonny,项目名称:dokuwiki_ucenter,代码行数:25,代码来源:uc.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP uc_api_input函数代码示例发布时间:2022-05-23
下一篇:
PHP ucWords函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap