本文整理汇总了PHP中pwEscape函数的典型用法代码示例。如果您正苦于以下问题:PHP pwEscape函数的具体用法?PHP pwEscape怎么用?PHP pwEscape使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pwEscape函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Signfunc
function Signfunc($starttime, $currency)
{
global $db, $winduid, $windid, $onlineip, $groupid, $tdtime, $db_signgroup, $db_signmoney, $db_signcurtype, $credit;
if (!in_array($db_signcurtype, array('money', 'rvrc', 'credit', 'currency'))) {
return false;
}
$set_a = array();
require_once R_P . 'require/credit.php';
if (!$starttime) {
$set_a = array($tdtime, $db_signmoney);
} elseif (!$db_signmoney || strpos($db_signgroup, ",{$groupid},") === false) {
$db->update("UPDATE pw_memberdata SET starttime='0' WHERE uid=" . pwEscape($winduid));
} else {
$days = floor(($tdtime - $starttime) / 86400);
$cost = $days * $db_signmoney;
$cost < 0 && ($cost = 0);
if ($currency >= $cost) {
$set_a = array($tdtime, $cost);
} else {
$cost = $currency - $currency % $db_signmoney;
$cost < 0 && ($cost = 0);
$set_a = array(0, $cost);
}
}
if ($set_a) {
$credit->addLog('main_showsign', array($db_signcurtype => -$set_a[1]), array('uid' => $winduid, 'username' => $windid, 'ip' => $onlineip));
$credit->set($winduid, $db_signcurtype, -$set_a[1], false);
$credit->runsql();
$db->update("UPDATE pw_memberdata SET starttime=" . pwEscape($set_a[0], false) . " WHERE uid=" . pwEscape($winduid));
}
return true;
}
示例2: execute
function execute(&$postdata)
{
global $timestamp, $db_ptable, $onlineip;
$this->setPostData($postdata);
$pwSQL = pwSqlSingle(array('fid' => $this->data['fid'], 'icon' => $this->data['icon'], 'author' => $this->data['author'], 'authorid' => $this->data['authorid'], 'subject' => $this->data['title'], 'ifcheck' => $this->data['ifcheck'], 'type' => $this->data['w_type'], 'postdate' => $timestamp, 'lastpost' => $timestamp, 'lastposter' => $this->data['lastposter'], 'hits' => 1, 'replies' => 0, 'topped' => $this->data['topped'], 'digest' => $this->data['digest'], 'special ' => $this->data['special'], 'state' => 0, 'ifupload' => $this->data['ifupload'], 'ifmail' => $this->data['ifmail'], 'anonymous' => $this->data['anonymous'], 'ptable' => $db_ptable, 'ifmagic' => $this->data['ifmagic'], 'ifhide' => $this->data['hideatt'], 'tpcstatus' => $this->data['tpcstatus'], 'modelid' => $this->data['modelid']));
$this->db->update("INSERT INTO pw_threads SET {$pwSQL}");
$this->tid = $this->db->insert_id();
# memcache refresh
$threadList = L::loadClass("threadlist");
$threadList->updateThreadIdsByForumId($this->data['fid'], $this->tid);
$pw_tmsgs = GetTtable($this->tid);
if (is_object($postdata->tag)) {
$postdata->tag->insert($this->tid);
$this->data['tags'] .= "\t" . $postdata->tag->relate($this->data['title'], $this->data['content']);
}
if (is_object($this->att) && ($aids = $this->att->getAids())) {
$this->att->pw_attachs->updateById($aids, array('tid' => $this->tid));
}
$ipTable = L::loadClass('IPTable');
$pwSQL = pwSqlSingle(array('tid' => $this->tid, 'aid' => $this->data['aid'], 'userip' => $onlineip, 'ifsign' => $this->data['ifsign'], 'buy' => '', 'ipfrom' => $ipTable->getIpFrom($onlineip), 'tags' => $this->data['tags'], 'ifconvert' => $this->data['convert'], 'ifwordsfb' => $this->data['ifwordsfb'], 'content' => $this->data['content'], 'magic' => $this->data['magic']));
$this->db->update("INSERT INTO {$pw_tmsgs} SET {$pwSQL}");
if ($this->data['digest']) {
$this->db->update("UPDATE pw_memberdata SET digests=digests+1 WHERE uid=" . pwEscape($this->data['authorid']));
$this->post->user['digests']++;
}
$this->post->updateUserInfo($this->type, $this->creditSet(), $this->data['content']);
$this->afterpost();
}
示例3: vote
function vote($readvote)
{
global $db, $votetype, $ifview, $votedb, $votesum, $action, $viewvoter, $tid, $admincheck, $vote_close;
$votearray = unserialize($readvote['voteopts']);
$votetype = $readvote['multiple'] ? 'checkbox' : 'radio';
$votesum = 0;
$votedb = $voter = array();
$ifview = $viewvoter == 'yes' ? 'no' : 'yes';
foreach ($votearray as $key => $option) {
$votesum += $option[1];
}
if ($viewvoter == 'yes') {
$query = $db->query("SELECT username,vote FROM pw_voter WHERE tid=" . pwEscape($tid) . " LIMIT 500");
while ($rt = $db->fetch_array($query)) {
$voter[$rt['vote']] .= "<span class=bold>{$rt['username']}</span>" . ' ';
}
}
foreach ($votearray as $key => $value) {
$vote = array();
if ($readvote['previewable'] == 0 || $readvote['havevote'] || $vote_close) {
$vote['width'] = floor(500 * $value[1] / ($votesum + 1));
$vote['num'] = $value[1];
} else {
$vote['width'] = 0;
$vote['num'] = '*';
}
$vote['name'] = $value[0];
$vote['voter'] = $voter[$key];
$votedb[$key] = $vote;
}
}
示例4: alterName
function alterName($uid, $oldname, $username)
{
global $db_plist;
$this->db->update("UPDATE pw_threads SET author=" . pwEscape($username) . " WHERE authorid=" . pwEscape($uid));
$ptable_a = array('pw_posts');
if ($db_plist && count($db_plist) > 1) {
foreach ($db_plist as $key => $val) {
if ($key == 0) {
continue;
}
$ptable_a[] = 'pw_posts' . $key;
}
}
foreach ($ptable_a as $val) {
$this->db->update("UPDATE {$val} SET author=" . pwEscape($username) . " WHERE authorid=" . pwEscape($uid));
}
$this->db->update("UPDATE pw_cmembers SET username=" . pwEscape($username) . " WHERE uid=" . pwEscape($uid));
$this->db->update("UPDATE pw_colonys SET admin=" . pwEscape($username) . " WHERE admin=" . pwEscape($oldname));
$this->db->update("UPDATE pw_announce SET author=" . pwEscape($username) . " WHERE author=" . pwEscape($oldname));
$this->db->update("UPDATE pw_medalslogs SET awardee=" . pwEscape($username) . " WHERE awardee=" . pwEscape($oldname));
$query = $this->db->query("SELECT fid,forumadmin,fupadmin FROM pw_forums WHERE forumadmin LIKE " . pwEscape("%,{$oldname},%", false) . " OR fupadmin LIKE " . pwEscape("%,{$oldname},%", false));
while ($rt = $this->db->fetch_array($query)) {
$rt['forumadmin'] = str_replace(",{$oldname},", ",{$username},", $rt['forumadmin']);
$rt['fupadmin'] = str_replace(",{$oldname},", ",{$username},", $rt['fupadmin']);
$this->db->update("UPDATE pw_forums SET forumadmin=" . pwEscape($rt['forumadmin'], false) . ",fupadmin=" . pwEscape($rt['fupadmin'], false) . " WHERE fid=" . pwEscape($rt['fid'], false));
}
}
示例5: userApplist
/**
* 获取个人APP列表
*/
function userApplist($uids, $appids = '', $arrt = 0)
{
if (!$uids) {
return false;
}
if (is_numeric($uids)) {
$sql_uid = ' uid=' . pwEscape($uids);
} else {
$sql_uid = ' uid IN(' . pwImplode(explode(',', $uids)) . ')';
}
if (is_numeric($appids)) {
$sql_appid = ' AND appid=' . pwEscape($appids);
} elseif ($appids) {
$sql_appid = ' AND appid IN(' . pwImplode(explode(',', $appids)) . ')';
}
$query = $this->_db->query("SELECT uid,appid,appname FROM pw_userapp WHERE {$sql_uid} {$sql_appid}");
while ($rt = $this->_db->fetch_array($query)) {
if ($this->_appslist[$rt['appid']] && $this->_appslist[$rt['appid']]) {
if ($arrt == 1) {
$this->_app_array[$rt['appid']] = $rt['appname'];
} elseif ($arrt == 2) {
$this->_app_array[$rt['uid']][$rt['appid']] = $rt;
} else {
$this->_app_array[] = $rt;
}
}
}
if (!$this->_app_array || !$this->appifopen) {
$this->_app_array = array();
}
return $this->_app_array;
}
示例6: updataById
function updataById($tplid, $array)
{
$array = $this->_checkData($array);
if (!$array) {
return null;
}
$this->_db->update("UPDATE " . $this->_tableName . " SET " . pwSqlSingle($array, false) . " WHERE tplid=" . pwEscape($tplid));
}
示例7: getSEOSetForPage
/**
* 获得页面的SEO设置信息
* @param $mode
* @param $page
* @param $type
* @return String
*/
function getSEOSetForPage($mode, $page, $type)
{
$r = $this->_db->get_value("SElECT content FROM " . $this->_tableName . " WHERE mode = " . pwEscape($mode) . " AND page = " . pwEscape($page) . " AND type = " . pwEscape($type));
if (!$r && strpos($page, '_') === false) {
$r = $this->_db->get_value("SElECT content FROM " . $this->_tableName . " WHERE mode = " . pwEscape($mode) . " AND page = 'thread' AND type = " . pwEscape($type));
}
return $r;
}
示例8: deleteByAuthorId
function deleteByAuthorId($authorId)
{
if ($authorId < 1) {
return false;
}
$this->_db->update("DELETE FROM " . $this->_tableName . " WHERE authorid=" . pwEscape($authorId, false));
return $this->_db->affected_rows();
}
示例9: getDatasByInvokePiece
function getDatasByInvokePiece($invokePieceId)
{
$temp = array();
$query = $this->_db->query("SELECT * FROM " . $this->_tableName . " WHERE invokepieceid=" . pwEscape($invokePieceId));
while ($rt = $this->_db->fetch_array($query)) {
$temp[] = $rt;
}
return $temp;
}
示例10: isInstall
function isInstall($uid)
{
$appid = array();
$query = $this->db->query("SELECT appid FROM " . UC_DBTABLEPRE . "userapp WHERE uid=" . pwEscape($uid));
while ($rt = $this->db->fetch_array($query)) {
$appid[] = $rt['appid'];
}
return new ApiResponse($appid);
}
示例11: getDatasBySid
function getDatasBySid($sid)
{
$temp = array();
$query = $this->_db->query("SELECT * FROM pw_block WHERE sid=" . pwEscape($sid));
while ($rt = $this->_db->fetch_array($query)) {
$temp[] = $rt;
}
return $temp;
}
示例12: getImagesByTid
function getImagesByTid($tid)
{
global $db;
$temp = array();
$query = $db->query("SELECT attachurl FROM pw_attachs WHERE tid=" . pwEscape($tid, false) . " AND type='img' LIMIT 5");
while ($rt = $db->fetch_array($query)) {
$a_url = geturl($rt['attachurl'], 'show');
$temp[] = is_array($a_url) ? $a_url[0] : $a_url;
}
return $temp;
}
示例13: deleteDataByParam
function deleteDataByParam($mode, $scr = '', $fid = false)
{
$sqladd = '';
if ($scr) {
$sqladd = ' AND scr=' . pwEscape($scr);
}
if (is_numeric($fid)) {
$sqladd = ' AND fid=' . pwEscape($fid);
}
$this->_db->update("DELETE FROM " . $this->_tableName . " WHERE mode=" . pwEscape($mode) . $sqladd);
}
示例14: insertAppevent
function insertAppevent($uid, $appevent = array(), $appid)
{
//插入用户的单个应用信息
$rt = $this->db->get_one("SELECT uid FROM pw_userapp WHERE uid=" . pwEscape($uid) . " AND appid=" . pwEscape($appid));
if ($rt && $appevent) {
$appevent = serialize($appevent);
$this->db->update("UPDATE pw_userapp SET appevent=" . pwEscape($appevent) . "WHERE uid=" . pwEscape($uid) . " AND appid=" . pwEscape($appid));
return new ApiResponse(true);
}
return new ApiResponse(false);
}
示例15: getForumByFid
function getForumByFid($fid)
{
$fid = intval($fid);
if ($fid < 1) {
return $this->buildResponse(FORUM_INVALID_PARAMS);
}
$data = array();
$result = $GLOBALS['db']->get_one("SELECT f.fid,f.name as forumname,fdata.tpost as todaypost FROM pw_forums f LEFT JOIN pw_forumdata fdata ON f.fid = fdata.fid WHERE f.fid= " . pwEscape($fid) . " ORDER BY f.vieworder");
$result['forumname'] = strip_tags($result['forumname']);
return $this->buildResponse(0, array('forum' => $result));
}