本文整理汇总了PHP中pwImplode函数的典型用法代码示例。如果您正苦于以下问题:PHP pwImplode函数的具体用法?PHP pwImplode怎么用?PHP pwImplode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pwImplode函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:adi00,项目名称:wumaproject,代码行数:29,代码来源:class_User.php
示例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;
}
开发者ID:adi00,项目名称:wumaproject,代码行数:35,代码来源:appclient.class.php
示例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;
}
开发者ID:adi00,项目名称:wumaproject,代码行数:34,代码来源:postindex.php
示例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) . ')');
}
}
开发者ID:adi00,项目名称:wumaproject,代码行数:29,代码来源:updateforum.php
示例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);
}
开发者ID:adi00,项目名称:wumaproject,代码行数:8,代码来源:core.php
示例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'");
}
开发者ID:adi00,项目名称:wumaproject,代码行数:13,代码来源:ucuser.class.php
示例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) . ")");
}
}
开发者ID:adi00,项目名称:wumaproject,代码行数:15,代码来源:msg.php
示例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;
}
开发者ID:adi00,项目名称:wumaproject,代码行数:15,代码来源:pushdata.db.php
示例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;
}
开发者ID:adi00,项目名称:wumaproject,代码行数:18,代码来源:threadmanager.class.php
示例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);
}
开发者ID:adi00,项目名称:wumaproject,代码行数:43,代码来源:class_Forum.php
示例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;
}
开发者ID:adi00,项目名称:wumaproject,代码行数:19,代码来源:usercache.db.php
示例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;
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:24,代码来源:myspace.db.php
示例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);
}
开发者ID:adi00,项目名称:wumaproject,代码行数:21,代码来源:class_Friend.php
示例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();
}
开发者ID:adi00,项目名称:wumaproject,代码行数:39,代码来源:replypost.class.php
示例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) {
开发者ID:adi00,项目名称:wumaproject,代码行数:31,代码来源:modify.php
示例16: postDelete
function postDelete($tids, $uid)
{
global $db_recycle, $db_ifpwcache;
$tiddb = explode(',', $tids);
$delids = array();
foreach ($tiddb as $key => $value) {
if (is_numeric($value)) {
$delids[] = $value;
}
}
if (!$delids) {
return new ApiResponse(false);
}
foreach ($readdb as $key => $read) {
if ($read['authorid'] != $uid) {
return new ErrorMsg(API_THREAD_AUTHOR_ERROR, 'The author is not right');
}
}
$delarticle = L::loadClass('DelArticle');
$readdb = $delarticle->getTopicDb('tid ' . $delarticle->sqlFormatByIds($delids));
$delarticle->delTopic($readdb, 0);
if ($db_ifpwcache ^ 1) {
$this->db->update("DELETE FROM pw_elements WHERE type !='usersort' AND id IN(" . pwImplode($delids) . ')');
}
P_unlink(D_P . 'data/bbscache/c_cache.php');
return new ApiResponse(true);
}
开发者ID:adi00,项目名称:wumaproject,代码行数:27,代码来源:class_Thread.php
示例17: list
list($uploadcredit, $uploadmoney, $downloadmoney, $downloadimg) = explode("\t", $pwforum->forumset['uploadset']);
if ($groupid == 6 || getstatus($winddb['userstatus'], 1)) {
$pwSQL = '';
$flag = 0;
$bandb = $delban = array();
$query = $db->query("SELECT * FROM pw_banuser WHERE uid=" . pwEscape($winduid));
while ($rt = $db->fetch_array($query)) {
if ($rt['type'] == 1 && $timestamp - $rt['startdate'] > $rt['days'] * 86400) {
$delban[] = $rt['id'];
} elseif ($rt['fid'] == 0 || $rt['fid'] == $fid) {
$bandb[$rt['fid']] = $rt;
} else {
$flag = 1;
}
}
$delban && $db->update('DELETE FROM pw_banuser WHERE id IN(' . pwImplode($delban) . ')');
$groupid == 6 && !isset($bandb[0]) && ($pwSQL .= "groupid='-1',");
if (getstatus($winddb['userstatus'], 1) && !isset($bandb[$fid]) && !$flag) {
$pwSQL .= 'userstatus=userstatus&(~1),';
}
if ($pwSQL = rtrim($pwSQL, ',')) {
$db->update('UPDATE pw_members SET $pwSQL WHERE uid=' . pwEscape($winduid));
$_cache = getDatastore();
$_cache->delete('UID_' . $winduid);
}
if ($bandb) {
$bandb = current($bandb);
if ($bandb['type'] == 1) {
$s_date = get_date($bandb['startdate']);
$e_date = $bandb['startdate'] + $bandb['days'] * 86400;
$e_date = get_date($e_date);
开发者ID:adi00,项目名称:wumaproject,代码行数:31,代码来源:ajax.php
示例18: recycle
function recycle($ids)
{
global $db, $fid;
$delids = array();
foreach ($ids as $key => $value) {
if (is_numeric($value)) {
$delids[] = $value;
}
}
if ($delids) {
$delids = pwImplode($delids);
} else {
Showmsg('forumcp_recycle_nodata');
}
$query = $db->query("SELECT r.*,t.special,t.ifshield,t.ifupload,t.ptable,t.replies,t.fid AS ckfid FROM pw_recycle r LEFT JOIN pw_threads t ON r.tid=t.tid WHERE r.tid IN ({$delids}) AND r.pid='0' AND r.fid=" . pwEscape($fid));
$taid_a = $ttable_a = $ptable_a = array();
$delids = $pollids = $actids = $delaids = $rewids = $ids = array();
while (@extract($db->fetch_array($query))) {
$ids[] = $tid;
($ifshield != '2' || $replies == '0' || $ckfid == '0') && ($delids[] = $tid);
$special == 1 && ($pollids[] = $tid);
$special == 2 && ($actids[] = $tid);
$special == 3 && ($rewids[] = $tid);
if ($ifshield != '2' || $replies == '0' || $ckfid == '0') {
$ptable_a[$ptable] = 1;
$ttable_a[GetTtable($tid)][] = $tid;
}
if ($ifupload) {
$taid_a[GetTtable($tid)][] = $tid;
if ($ifshield != '2' || $replies == '0' || $ckfid == '0') {
$pw_posts = GetPtable($ptable);
$query2 = $db->query("SELECT aid FROM {$pw_posts} WHERE tid=" . pwEscape($tid) . " AND aid!=''");
while (@extract($db->fetch_array($query2))) {
if (!$aid) {
continue;
}
$attachs = unserialize(stripslashes($aid));
foreach ($attachs as $key => $value) {
is_numeric($key) && ($delaids[] = $key);
pwDelatt($value['attachurl'], $GLOBALS['db_ifftp']);
$value['ifthumb'] && pwDelatt("thumb/{$value['attachurl']}", $GLOBALS['db_ifftp']);
}
}
}
}
}
foreach ($taid_a as $pw_tmsgs => $value) {
$value = pwImplode($value);
$query = $db->query("SELECT aid FROM {$pw_tmsgs} WHERE tid IN({$value}) AND aid!=''");
while (@extract($db->fetch_array($query))) {
if (!$aid) {
continue;
}
$attachs = unserialize(stripslashes($aid));
foreach ($attachs as $key => $value) {
is_numeric($key) && ($delaids[] = $key);
pwDelatt($value['attachurl'], $GLOBALS['db_ifftp']);
$value['ifthumb'] && pwDelatt("thumb/{$value['attachurl']}", $GLOBALS['db_ifftp']);
}
}
}
if ($pollids) {
$pollids = pwImplode($pollids);
$db->update("DELETE FROM pw_polls WHERE tid IN({$pollids})");
}
if ($actids) {
$actids = pwImplode($actids);
$db->update("DELETE FROM pw_activity WHERE tid IN({$actids})");
$db->update("DELETE FROM pw_actmember WHERE actid IN({$actids})");
}
if ($rewids) {
$rewids = pwImplode($rewids);
$db->update("DELETE FROM pw_reward WHERE tid IN({$rewids})");
}
if ($delaids) {
$pw_attachs = L::loadDB('attachs');
$pw_attachs->delete($delaids);
}
$delids = pwImplode($delids);
if ($delids) {
# $db->update("DELETE FROM pw_threads WHERE tid IN($delids)");
# ThreadManager
$threadManager = L::loadClass("threadmanager");
$threadManager->deleteByThreadIds($fid, $delids);
}
foreach ($ttable_a as $pw_tmsgs => $val) {
$val = pwImplode($val);
$db->update("DELETE FROM {$pw_tmsgs} WHERE tid IN({$val})");
}
foreach ($ptable_a as $key => $val) {
$pw_posts = GetPtable($key);
$db->update("DELETE FROM {$pw_posts} WHERE tid IN({$delids})");
}
delete_tag($delids);
if ($ids) {
$ids = pwImplode($ids);
$db->update("DELETE FROM pw_recycle WHERE tid IN ({$ids})");
}
pwFtpClose($GLOBALS['ftp']);
}
开发者ID:adi00,项目名称:wumaproject,代码行数:100,代码来源:forumcp.php
示例19: elseif
} else {
$type = $share['type'] = 'web';
}
} elseif (preg_match("/\\.(mp3|wma)\$/i", $link)) {
$type = $share['type'] = 'music';
$f_hash = $share['link'];
} elseif (preg_match("/\\.swf\$/i", $link)) {
$type = $share['type'] = 'flash';
$f_hash = $share['link'];
} else {
$type = $share['type'] = 'web';
}
}
$content = serialize($share);
$arr = array($type, $winduid, $windid, $timestamp, $content, $ifhidden);
$db->update("INSERT INTO pw_share(type,uid,username,postdate,content,ifhidden) VALUES(" . pwImplode($arr) . ")");
if ($type == 'topic') {
$db->update("UPDATE pw_threads SET shares=shares+1 WHERE tid=" . pwEscape($id));
}
if (!$ifhidden) {
$f_id = $db->insert_id();
if ($type != 'web' && $f_hash) {
$share_code = '[share]' . ($type == 'video' ? $share['video']['host'] : $type) . ',' . $f_hash . ',' . $f_id . '[/share]';
} elseif ($type == 'user') {
$share_code = '[url=' . $share['link'] . '][img]' . $share['user']['image'] . '[/img][/url]';
$title = $share['user']['username'];
} elseif ($type == 'photo') {
$belong = getLangInfo('app', 'photo_belong');
$image_link = $link;
$share['link'] = $db_bbsurl . '/u.php?uid=' . $photo['ownerid'];
$title = $share['photo']['username'];
开发者ID:adi00,项目名称:wumaproject,代码行数:31,代码来源:m_sharelink.php
示例20: updatecache_postcate
updatecache_postcate();
adminmsg('operate_success', $basename);
}
} elseif ($action == 'postcatelist') {
InitGP(array('selid', 'vieworder'));
!is_array($selid) && ($selid = array());
$updatedb = array();
foreach ($selid as $key => $value) {
if (is_numeric($key)) {
$key = (int) $key;
$updatedb[] = $key;
}
}
if ($updatedb) {
$db->update("UPDATE pw_postcate SET ifable=1 WHERE pcid IN (" . pwImplode($updatedb) . ')');
$db->update("UPDATE pw_postcate SET ifable=0 WHERE pcid NOT IN (" . pwImplode($updatedb) . ')');
} else {
$db->update("UPDATE pw_postcate SET ifable=0");
}
foreach ($vieworder as $key => $value) {
$key && $db->update("UPDATE pw_postcate SET vieworder=" . pwEscape($value) . "WHERE pcid=" . pwEscape($key));
}
updatecache_postcate();
adminmsg('operate_success', $basename);
} elseif ($action == 'editmodel') {
if (!$_POST['step']) {
@(include_once D_P . 'data/bbscache/postcate_config.php');
$ajax_basename = EncodeUrl($basename);
$ajax_basename_edit = EncodeUrl($basename . "&action=editfield");
$ajax_basename_add = EncodeUrl($basename . "&action=addfield");
$ajax_basename_delfield = EncodeUrl($basename . "&action=delfield");
开发者ID:adi00,项目名称:wumaproject,代码行数:31,代码来源:postcate.php
注:本文中的pwImplode函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论