本文整理汇总了PHP中pwImplode函数的典型用法代码示例。如果您正苦于以下问题:PHP pwImplode函数的具体用法?PHP pwImplode怎么用?PHP pwImplode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pwImplode函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getInfo
function getInfo($uids, $fields = array())
{
if (!$uids) {
return new ApiResponse(false);
}
if (is_numeric($uids)) {
$sql = ' uid=' . pwEscape($uids);
} else {
$sql = ' uid IN(' . pwImplode(explode(',', $uids)) . ')';
}
require_once R_P . 'require/showimg.php';
$users = array();
$query = $this->db->query("SELECT uid,username,icon,gender,location,bday FROM pw_members WHERE " . $sql);
while ($rt = $this->db->fetch_array($query)) {
list($rt['icon']) = showfacedesign($rt['icon'], 1, 'm');
if ($fields) {
$rt_a = array();
foreach ($fields as $field) {
if (isset($rt[$field])) {
$rt_a[$field] = $rt[$field];
}
}
} else {
$rt_a = $rt;
}
$users[$rt['uid']] = $rt_a;
}
return new ApiResponse($users);
}
示例2: 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;
}
示例3: getThreadsByReplies
/**
* @param $replies
* @param $order
* @param $isDesc
* @param $page
* @return unknown_type
*/
function getThreadsByReplies($replies, $page)
{
if (!$replies) {
return;
}
$sql = "SELECT p.tid FROM pw_postsfloor p GROUP BY p.tid ORDER BY p.tid DESC";
$query = $this->db->query($sql);
while ($rt = $this->db->fetch_array($query)) {
$tid[] = $rt['tid'];
}
if ($tid) {
$w_tid = " t.tid NOT IN ( " . pwImplode($tid) . " ) AND ";
}
$sql = "SELECT COUNT(*) AS sum FROM pw_threads t WHERE {$w_tid} t.replies > " . pwEscape($replies);
$rt = $this->db->get_one($sql);
(!is_numeric($page) || $page < 1) && ($page = 1);
$limit = pwLimit(($page - 1) * $this->db_perpage, $this->db_perpage);
$result['pages'] = numofpage($rt['sum'], $page, ceil($rt['sum'] / $this->db_perpage), $this->basename . "&sub=y&action=search&replies={$replies}&");
$sql = "SELECT t.tid, t.subject, t.replies, t.postdate, t.fid\r\n\t\t\t\tFROM pw_threads t\r\n\t\t\t\tWHERE {$w_tid} t.replies > " . pwEscape($replies) . " {$limit}";
$query = $this->db->query($sql);
while ($rt = $this->db->fetch_array($query)) {
list($lastDate) = PostIndexUtility::getLastDate($rt["postdate"]);
$rt["postdate"] = $lastDate;
$result['data'][] = $rt;
}
return $result;
}
示例4: updateForumCount
function updateForumCount($fid, $topic, $replies, $tpost = 0)
{
global $db, $db_fcachenum;
$fm = $db->get_one("SELECT fup,type,password,allowvisit,f_type FROM pw_forums WHERE fid=" . pwEscape($fid));
if ($fm['type'] == 'category') {
return false;
}
delfcache($fid, $db_fcachenum);
$topic = intval($topic);
$article = $topic + intval($replies);
$tpost = intval($tpost);
$lastpost = '';
$lt = $db->get_one("SELECT tid,author,postdate,lastpost,lastposter,subject FROM pw_threads WHERE fid=" . pwEscape($fid) . " AND topped='0' AND ifcheck='1' AND lastpost>0 ORDER BY lastpost DESC LIMIT 1");
if ($lt) {
if ($lt['postdate'] == $lt['lastpost']) {
$subject = substrs($lt['subject'], 26);
} else {
$subject = 'Re:' . substrs($lt['subject'], 26);
}
$lastpost = ",lastpost=" . pwEscape($subject . "\t" . $lt['lastposter'] . "\t" . $lt['lastpost'] . "\t" . "read.php?tid={$lt['tid']}&page=e#a");
}
$db->update("UPDATE pw_forumdata SET article=article+'{$article}',topic=topic+'{$topic}',tpost=tpost+'{$tpost}'{$lastpost} WHERE fid=" . pwEscape($fid));
if (($fm['type'] == 'sub' || $fm['type'] == 'sub2') && ($fids = getUpFids($fid))) {
if ($fm['password'] != '' || $fm['allowvisit'] != '' || $fm['f_type'] == 'hidden') {
$lastpost = '';
}
$db->update("UPDATE pw_forumdata SET article=article+'{$article}',subtopic=subtopic+'{$topic}',tpost=tpost+'{$tpost}'{$lastpost} WHERE fid IN(" . pwImplode($fids) . ')');
}
}
示例5: updateAreaStaticRefreshTime
function updateAreaStaticRefreshTime($timeToUpdate = 0)
{
global $db;
require_once R_P . 'admin/cache.php';
$update = array('area_static_next', 'string', $timeToUpdate, '');
$db->update("REPLACE INTO pw_hack VALUES (" . pwImplode($update) . ')');
updatecache_conf('area', true);
}
示例6: delUserByIds
function delUserByIds($uids)
{
if (!($delids = pwImplode($uids))) {
return;
}
$this->db->update("DELETE FROM pw_members WHERE uid IN ({$delids})");
$this->db->update("DELETE FROM pw_memberdata WHERE uid IN ({$delids})");
$this->db->update("DELETE FROM pw_memberinfo WHERE uid IN ({$delids})");
$this->db->update("DELETE FROM pw_banuser WHERE uid IN ({$delids})");
@extract($this->db->get_one("SELECT count(*) AS count FROM pw_members"));
@extract($this->db->get_one("SELECT username FROM pw_members ORDER BY uid DESC LIMIT 1"));
$this->db->update("UPDATE pw_bbsinfo SET newmember=" . pwEscape($username) . ',totalmember=' . pwEscape($count) . " WHERE id='1'");
}
示例7: delete_msgc
function delete_msgc($ids = null)
{
global $db;
if ($db->server_info() > '4') {
$GLOBALS['db']->update("DELETE " . ($db->server_info() > '4.1' ? 'mc' : 'pw_msgc') . " FROM pw_msgc mc LEFT JOIN pw_msg m ON mc.mid=m.mid LEFT JOIN pw_msglog ml ON mc.mid=ml.mid WHERE m.mid is NULL AND ml.mid is NULL" . ($ids ? " AND mc.mid IN({$ids})" : ''));
} else {
$delids = array();
$query = $db->query("SELECT mc.mid FROM pw_msgc mc LEFT JOIN pw_msg m ON mc.mid=m.mid LEFT JOIN pw_msglog ml ON mc.mid=ml.mid WHERE m.mid is NULL AND ml.mid is NULL" . ($ids ? " AND mc.mid IN({$ids})" : ''));
while ($rt = $db->fetch_array($query)) {
$delids[] = $rt['mid'];
}
//TODO SQL太长
!empty($delids) && $db->update("DELETE FROM pw_msgc WHERE mid IN(" . pwImplode($delids) . ")");
}
}
示例8: getHaveDelays
function getHaveDelays($invokepieces, $fid = 0)
{
global $timestamp;
if (!is_array($invokepieces) || !$invokepieces) {
return array();
}
$temp_invokepieces = array_keys($invokepieces);
$temp = array();
$query = $this->_db->query("SELECT invokepieceid,fid,loopid FROM pw_pushdata WHERE starttime>" . pwEscape($timestamp) . " AND fid = " . pwEscape($fid) . " AND invokepieceid IN(" . pwImplode($temp_invokepieces) . ") GROUP BY invokepieceid,fid,loopid");
while ($rt = $this->_db->fetch_array($query)) {
$key = md5($rt['invokepieceid'] . $rt['fid'] . $rt['loopid']);
$temp[$key] = $rt;
}
return $temp;
}
示例9: deleteByThreadIds
function deleteByThreadIds($forumId, $threadIds)
{
if (empty($threadIds)) {
return null;
}
if (is_array($threadIds)) {
$threads = L::loadClass('Threads');
$threads->delThreads($threadIds);
$threadIds = pwImplode($threadIds);
}
$this->_db->update("DELETE FROM " . $this->_tableName . " WHERE tid in(" . $threadIds . ")");
$result = $this->_db->affected_rows();
if ($result && $this->_memcache) {
$threadList = $this->_getThreadList();
$threadList->refreshThreadIdsByForumId($forumId);
}
return $result;
}
示例10: insertApp
function insertApp($fids, $appid, $appinfo = '')
{
//更新版块APP信息
if (!$fids) {
return new ApiResponse(false);
}
if (is_numeric($fids)) {
$sql = ' fid=' . pwEscape($fids);
} else {
$sql = ' fid IN(' . pwImplode(explode(",", $fids)) . ')';
}
$query = $this->db->query("SELECT fid,appinfo FROM pw_forumsextra WHERE appinfo!=''");
while ($rt = $this->db->fetch_array($query)) {
$appdb = array();
$appdb = unserialize($rt['appinfo']);
unset($appdb[$appid]);
$appdb = serialize($appdb);
$this->db->update("UPDATE pw_forumsextra SET appinfo=" . pwEscape($appdb) . " WHERE fid=" . pwEscape($rt['fid']));
}
$oldfids = array();
$query = $this->db->query("SELECT fid,appinfo FROM pw_forumsextra WHERE {$sql}");
while ($rt = $this->db->fetch_array($query)) {
$appdb = array();
$appdb = unserialize($rt['appinfo']);
$appdb[$appid] = $appinfo;
$appdb = serialize($appdb);
$oldfids[$rt['fid']] = $rt['fid'];
$this->db->update("UPDATE pw_forumsextra SET appinfo=" . pwEscape($appdb) . " WHERE fid=" . pwEscape($rt['fid']));
}
$forumset = array('lock' => 0, 'cutnums' => 0, 'threadnum' => 0, 'readnum' => 0, 'newtime' => 0, 'orderway' => 'lastpost', 'asc' => 'DESC', 'allowencode' => 0, 'anonymous' => 0, 'rate' => 0, 'dig' => 0, 'inspect' => 0, 'watermark' => 0, 'commend' => 0, 'autocommend' => 0, 'commendlist' => '', 'commendnum' => 0, 'commendlength' => 0, 'commendtime' => 0, 'addtpctype' => 0, 'ifrelated' => 0, 'relatednums' => 0, 'relatedcon' => 'ownpost', 'relatedcustom' => array(), 'rvrcneed' => 0, 'moneyneed' => 0, 'creditneed' => 0, 'postnumneed' => 0, 'sellprice' => array(), 'uploadset' => 'money 0', 'rewarddb' => '', 'allowtime' => '');
$forumset = serialize($forumset);
foreach (explode(",", $fids) as $key => $value) {
if (!$oldfids[$value]) {
$appdb = array();
$appdb[$appid] = $appinfo;
$appdb = serialize($appdb);
$this->db->update("INSERT INTO pw_forumsextra SET " . pwSqlSingle(array('fid' => $value, 'forumset' => $forumset, 'appinfo' => $appdb)));
}
}
require_once R_P . 'admin/cache.php';
updatecache_f();
return new ApiResponse(true);
}
示例11: getByUid
function getByUid($uids)
{
#$uids array|int
$data = array();
if (is_array($uids)) {
$query = $this->_db->query("SELECT uid,type,value,typeid FROM " . $this->_tableName . " WHERE uid IN (" . pwImplode($uids, false) . ") AND expire>" . pwEscape($this->now, false));
while ($rt = $this->_db->fetch_array($query)) {
$value = $this->_unserialize($rt['value']);
$data[$rt['uid']][$rt['type']] = array('value' => $value, 'id' => $rt['typeid']);
}
} else {
$query = $this->_db->query("SELECT type,value,typeid FROM " . $this->_tableName . " WHERE uid=" . pwEscape($uids, false));
while ($rt = $this->_db->fetch_array($query)) {
$value = $this->_unserialize($rt['value']);
$data[$rt['type']] = array('value' => $value, 'id' => $rt['typeid']);
}
}
return $data;
}
示例12: getFavsByUser
/**
* @param $uid 用户ID
* @param $page 当前页数
* @return unknown_type 返回类型
*/
function getFavsByUser($uid, $page = 1)
{
$uid = (int) $uid;
if (!$uid) {
return array();
}
$result = array();
(int) $page < 1 && ($page = 1);
$start = ($page - 1) * $this->perPage;
$_favs = $this->db->get_one("SELECT tids FROM pw_favors WHERE uid=" . pwEscape($uid));
$_tids = explode(',', trim($_favs['tids'], ','));
$_count = count($_tids);
$tids = array_slice($_tids, $start, $this->perPage);
if ($tids) {
$sql = "SELECT fid,tid,subject,postdate,author,authorid,replies,hits,topped,digest,ifupload FROM pw_threads \r\n\t\t\t\t\tWHERE tid IN(" . pwImplode($tids) . ") ORDER BY postdate DESC";
$result = $this->_query($sql, $start, 'fav');
}
return $result;
}
示例13: getAppUsers
function getAppUsers($appid, $uid, $num, $start = 0)
{
if ($num == 'all') {
$num = 500;
} elseif (!is_numeric($num) || $num < 1) {
$num = 20;
} elseif ($num > 500) {
$num = 500;
}
(!is_numeric($start) || $start < 0) && ($start = 0);
$users = $appusers = array();
$query = $this->db->query("SELECT friendid FROM pw_friends WHERE status='0' AND uid=" . pwEscape($uid) . pwLimit($start, $num));
while ($rt = $this->db->fetch_array($query)) {
$users[] = $rt['friendid'];
}
$query = $this->db->query("SELECT uid FROM pw_userapp WHERE uid IN (" . pwImplode($users) . ") AND appid=" . pwEscape($appid));
while ($rt = $this->db->fetch_array($query)) {
$appusers[] = $rt['uid'];
}
return new ApiResponse($appusers);
}
示例14: execute
function execute($postdata)
{
global $timestamp, $db_ptable, $onlineip, $db_plist;
$this->setPostData($postdata);
if ($db_plist && count($db_plist) > 1) {
$this->db->update("INSERT INTO pw_pidtmp(pid) VALUES('')");
$pid = $this->db->insert_id();
} else {
$pid = '';
}
$ipTable = L::loadClass('IPTable');
$pwSQL = pwSqlSingle(array('pid' => $pid, 'fid' => $this->data['fid'], 'tid' => $this->tid, 'aid' => $this->data['aid'], 'author' => $this->data['author'], 'authorid' => $this->data['authorid'], 'icon' => $this->data['icon'], 'postdate' => $timestamp, 'subject' => $this->data['title'], 'userip' => $onlineip, 'ifsign' => $this->data['ifsign'], 'ipfrom' => $ipTable->getIpFrom($onlineip), 'ifconvert' => $this->data['convert'], 'ifwordsfb' => $this->data['ifwordsfb'], 'ifcheck' => $this->data['ifcheck'], 'content' => $this->data['content'], 'anonymous' => $this->data['anonymous'], 'ifhide' => $this->data['hideatt']));
$pw_posts = GetPtable($this->tpcArr['ptable']);
$this->db->update("INSERT INTO {$pw_posts} SET {$pwSQL}");
!$pid && ($pid = $this->db->insert_id());
$this->tpcArr['openIndex'] && $this->setPostFloor($pid);
$this->pid = $pid;
if (is_object($this->att) && ($aids = $this->att->getAids())) {
$this->db->update("UPDATE pw_attachs SET " . pwSqlSingle(array('tid' => $this->tid, 'pid' => $this->pid)) . ' WHERE aid IN(' . pwImplode($aids) . ')');
}
if ($this->data['ifcheck'] == 1) {
$sqladd1 = '';
$sqladd = array('lastposter' => $this->data['lastposter']);
$this->tpcArr['locked'] < 3 && $this->tpcArr['lastpost'] < $timestamp && ($sqladd['lastpost'] = $timestamp);
$this->data['ifupload'] && ($sqladd['ifupload'] = $this->data['ifupload']);
$ret = $this->sendMail();
if ($ret & 2) {
$sqladd['ifmail'] = 4;
} elseif ($ret & 1) {
$sqladd1 = "ifmail=ifmail-1,";
}
$this->db->update("UPDATE pw_threads SET {$sqladd1}replies=replies+1,hits=hits+1," . pwSqlSingle($sqladd) . " WHERE tid=" . pwEscape($this->tid));
if (getstatus($this->tpcArr['tpcstatus'], 1)) {
$this->db->update("UPDATE pw_argument SET lastpost=" . pwEscape($timestamp) . ' WHERE tid=' . pwEscape($this->tid));
}
}
$this->post->updateUserInfo($this->type, $this->creditSet(), $this->data['content']);
$this->afterReply();
}
示例15: elseif
} elseif ($_POST['step'] == '4') {
PostCheck();
InitGP(array('selid'));
if ($selid && is_array($selid)) {
$arr = array();
$query = $db->query("SELECT u2.uid FROM pw_userbinding u1 LEFT JOIN pw_userbinding u2 ON u1.id=u2.id WHERE u1.uid=" . pwEscape($winduid));
while ($rt = $db->fetch_array($query)) {
$arr[] = $rt['uid'];
}
if ($delarr = array_intersect($arr, $selid)) {
$db->update("DELETE FROM pw_userbinding WHERE uid IN(" . pwImplode($delarr) . ')');
$tmp = $delarr + array($winduid);
if (count(array_unique($tmp)) == count($arr)) {
$delarr = $tmp;
}
$db->update("UPDATE pw_members SET userstatus=userstatus&~(1<<11) WHERE uid IN (" . pwImplode($delarr) . ')');
}
}
refreshto("profile.php?action=modify&info_type=binding", 'operate_success', 2, true);
}
function Getcustom($data, $unserialize = true, $strips = null)
{
global $db_union;
$customdata = array();
if (!$data || ($unserialize ? !is_array($data = unserialize($data)) : !is_array($data))) {
$data = array();
} elseif (!is_array($custominfo = unserialize($db_union[7]))) {
$custominfo = array();
}
if (!empty($data) && !empty($custominfo)) {
foreach ($data as $key => $value) {