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=" . S::sqlEscape($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=" . S::sqlEscape($fid) . " AND specialsort='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=" . S::sqlEscape($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=" . S::sqlEscape($fid)); Perf::gatherInfo('changeForumData', array('fid' => $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(" . S::sqlImplode($fids) . ')'); Perf::gatherInfo('changeForumData', array('fid' => $fids)); } }
/** *加入多条学校数据 * @param array $data数据 * @return array $schoolIds学校id */ function addSchools($data) { if (!S::isArray($data)) { return false; } $fieldData = array(); $schoolNames = array(); $schoolDb = $this->_getSchoolDao(); foreach ($data as $value) { $value['areaid'] = intval($value['areaid']); $value['schoolname'] = trim($value['schoolname']); $value['schoolname'] = trim(substrs($value['schoolname'], 32, 'N'), ' '); $schoolNames[] = trim($value['schoolname']); $value['type'] = $value['type'] ? intval($value['type']) : 1; if (!$value['schoolname'] || $value['areaid'] < 0 || $value['type'] < 0) { continue; } $fieldData[] = $value; } $schoolIds = $schoolDb->checkSchoolNames((int) $value['areaid'], $value['type'], $schoolNames); if ($schoolIds > 0) { return $schoolIds; } return $schoolDb->addSchools($fieldData); }
function topicPost($tid, $postdata) { global $timestamp, $winduid, $windid; if (!$this->info) { return false; } $this->_db->update("INSERT INTO pw_argument SET " . S::sqlSingle(array('tid' => $tid, 'cyid' => $this->info['id'], 'postdate' => $timestamp, 'lastpost' => $timestamp))); if ($postdata['ifcheck'] > 0) { require_once R_P . 'u/require/core.php'; //tnum加一 //* $this->_db->update("UPDATE pw_colonys SET tnum=tnum+'1',pnum=pnum+'1',todaypost=todaypost+'1' WHERE id=" . S::sqlEscape($this->cyid)); $this->_db->update(pwQuery::buildClause("UPDATE :pw_table SET tnum=tnum+1,pnum=pnum+1,todaypost=todaypost+1 WHERE id=:id", array('pw_colonys', $this->cyid))); $this->info['tnum']++; $this->info['pnum']++; updateGroupLevel($this->cyid, $this->info); if ($this->info['ifopen']) { $weiboService = L::loadClass('weibo', 'sns'); /* @var $weiboService PW_Weibo */ $weiboContent = substrs(stripWindCode($postdata['content']), 125); $weiboExtra = array('cyid' => $this->cyid, 'title' => stripslashes($postdata['title']), 'cname' => $this->info['cname']); $weiboService->send($winduid, $weiboContent, 'group_article', $tid, $weiboExtra); } } //更新群成员表里面的最后发言时间 $this->_db->update("UPDATE pw_cmembers SET lastpost=" . S::sqlEscape($timestamp) . " WHERE uid=" . S::sqlEscape($winduid)); }
function getSourceData($sourceId) { $data = $this->_getThreadData($sourceId); if (!$data || $this->_checkIfDelete($data)) { return array(); } $data['content'] = preg_replace("/\\[attachment=[0-9]+\\]/is", '', $data['content']); $data['descrip'] = substrs(stripWindCode($data['content']), 100); $data['frominfo'] = 'ÂÛ̳'; return $data; }
function getSourceData($sourceId) { $data = $this->_getDiaryData($sourceId); if (!$data) { return array(); } $data['descrip'] = substrs(stripWindCode($data['content']), 100); $data['frominfo'] = 'хуж╬'; $data['author'] = $data['username']; return $data; }
function _cookData($data) { global $db_bbsurl; $data['url'] = $db_bbsurl . '/apps.php?q=group&cyid=' . $data['id']; $data['title'] = $data['cname']; $data['image'] = $this->_getGroupImage($data['cnimg']); $data['descrip'] = substrs(strip_tags(stripWindCode($data['descrip'])), 100); if ($data['credit']) { $data['credit'] = (int) $data['credit']; } return $data; }
/** * @param $_summary the $_summary to set */ function set_summary($_summary, $convert) { if ($_summary) { $_summary = stripWindCode($_summary); $_summary = strip_tags($_summary); $_summary = str_replace(array('"', "\n", "\r", ' ', '&', '<', '', ' '), '', $_summary); $_summary = substrs($_summary, 255); if ($convert) { $wordsfb = L::loadClass('FilterUtil'); $_summary = $wordsfb->convert($_summary); } $this->_summary = trim($_summary); } }
function writelog($log) { global $db, $db_moneyname, $db_rvrcname, $db_bbsurl; $log['username1'] = S::escapeChar($log['username1']); $log['username2'] = S::escapeChar($log['username2']); $log['field1'] = S::escapeChar($log['field1']); $log['field2'] = S::escapeChar($log['field2']); $log['field3'] = S::escapeChar($log['field3']); if (!$log['subject']) { $log['subject'] = substrs($db_bbsurl . '/read.php?tid=' . $log['tid'], 28); } $log['descrip'] = S::escapeChar(getLangInfo('log', $log['descrip'], $log)); $db->update("INSERT INTO pw_adminlog" . " SET " . S::sqlSingle(array('type' => $log['type'], 'username1' => $log['username1'], 'username2' => $log['username2'], 'field1' => $log['field1'], 'field2' => $log['field2'], 'field3' => $log['field3'], 'descrip' => $log['descrip'], 'timestamp' => $log['timestamp'], 'ip' => $log['ip']), false)); }
/** * 调取指定个数和指定用户的的道具信息 * @param $uid 调取的用户 * @param $num 调取的个数 * @return array */ function getToolsByUidAndNum($uid, $num) { $tools = array(); $query = $this->_db->query("SELECT u.*,t.name,t.price,t.creditype,t.stock,t.descrip,t.type,t.logo FROM pw_usertool u LEFT JOIN pw_tools t ON t.id=u.toolid WHERE u.uid=" . S::sqlEscape($uid) . " AND u.nums>0 LIMIT " . intval($num)); while ($rt = $this->_db->fetch_array($query)) { if (empty($rt['logo'])) { $rt['logo'] = $GLOBALS['imgpath'] . '/nopic.gif'; } else { $rt['logo'] = "u/images/toolcenter/tool/{$rt['toolid']}.gif"; } $rt['subdescrip'] = substrs($rt['descrip'], 20); $tools[] = $rt; } return $tools; }
function getOneInfo($uid) { global $db; $uid = (int) $uid; if (!$uid) { Showmsg('undefined_action'); } $oneinfo = $db->get_one("SELECT m.uid,m.username,m.email,m.groupid,m.memberid,m.icon,m.gender,m.regdate,m.honor,m.bday,m.medals,m.userstatus,md.thisvisit,md.onlinetime,md.postnum,md.digests,md.rvrc,md.money,md.credit,md.lastvisit,md.lastpost,md.todaypost,md.f_num FROM pw_members m LEFT JOIN pw_memberdata md ON m.uid=md.uid WHERE m.uid=" . pwEscape($uid)); if ($oneinfo) { require_once R_P . 'require/showimg.php'; list($oneinfo['face']) = showfacedesign($oneinfo['icon'], 1); $oneinfo['honor'] = substrs($oneinfo['honor'], 90); return $oneinfo; } else { return false; } }
/** * 格式化输出结果 * @param unknown_type $data * @return unknown */ function _cookData($data) { global $db_bbsurl, $db_windpost; $data['url'] = $data['url'] ? $data['url'] : $db_bbsurl . '/notice.php?fid=' . $data['fid'] . '#' . $data['aid']; $data['title'] = convert($data['subject'], $db_windpost); if ($data['author']) { $userService = L::loadClass('userService', 'user'); $userId = $userService->getUserIdByUserName($data['author']); $data['authorurl'] = 'u.php?uid=' . $userId; } else { $data['authorurl'] = ''; } $data['content'] = convert($data['content'], $db_windpost); $data['descrip'] = substrs(strip_tags($data['content']), 100); $data['postdate'] = $data['startdate']; return $data; }
function getOneInfo($uid) { global $db; $uid = (int) $uid; if (!$uid) { Showmsg('undefined_action'); } $userService = L::loadClass('UserService', 'user'); /* @var $userService PW_UserService */ $oneinfo = $userService->get($uid, true, true); if ($oneinfo) { require_once R_P . 'require/showimg.php'; list($oneinfo['face']) = showfacedesign($oneinfo['icon'], 1); $oneinfo['honor'] = substrs($oneinfo['honor'], 90); return $oneinfo; } else { return false; } }
require_once R_P . 'require/functions.php'; $customdes = getLangInfo('other', 'invite_custom_des'); $tmpUrlAdd .= '&a=invite'; if ($type == 'groupactive') { $invite_url = $db_bbsurl . '/u.php?a=invite&type=groupactive&id=' . $id . '&uid=' . $winduid . '&hash=' . appkey($winduid, $type); $activeArray = $db->get_one("SELECT * FROM pw_active WHERE id=" . S::sqlEscape($id)); $objectName = $activeArray['title']; $objectDescrip = substrs($activeArray['content'], 30); $activeId = $activeArray['id']; $emailContent = getLangInfo('email', 'email_groupactive_invite_content'); } else { $id = $cyid; $type = 'group'; $invite_url = $db_bbsurl . '/u.php?a=invite&type=group&id=' . $cyid . '&uid=' . $winduid . '&hash=' . appkey($winduid, $type); $objectName = $colony['cname']; $objectDescrip = substrs($colony['descrip'], 30); $emailContent = getLangInfo('email', 'email_group_invite_content'); } if (empty($_POST['step'])) { S::gp("id", null, 2); //* @include_once pwCache::getPath(D_P.'data/bbscache/o_config.php'); pwCache::getData(D_P . 'data/bbscache/o_config.php'); $friend = getFriends($winduid) ? getFriends($winduid) : array(); foreach ($friend as $key => $value) { $frienddb[$value['ftid']][] = $value; } $query = $db->query("SELECT * FROM pw_friendtype WHERE uid=" . S::sqlEscape($winduid) . " ORDER BY ftid"); $friendtype = array(); while ($rt = $db->fetch_array($query)) { $friendtype[$rt['ftid']] = $rt; }
function getmco($c, $i, $n = 0, $r = 0) { $m = 200; return ($r > 0 && strstr($c, "\r") ? '<br/>' : '') . (strlen($c) > $m ? mbookencode(substrs($c, $m - 5)) . '<br/><a href="?m=list&id=' . $i . ($n > 0 ? '#reply-' . $n : '') . '">查看全部 >></a>' : mbookencode($c)); }
} !$rt['pid'] && ($rt['pid'] = 'tpc'); $rt['fname'] = $forum[$rt['fid']]['name']; $showdb[$key] = $rt; } require_once PrintEot('show'); footer(); } else { $pw_attachs = L::loadDB('attachs', 'forum'); $rt = $pw_attachs->get($aid); if ($rt && $rt['tid'] && $rt['fid']) { $pw_tmsgs = GetTtable($rt['tid']); $rtinfo = $db->get_one("SELECT t.fid,t.subject,t.ifcheck,t.ifshield,tm.content,m.username\r\n\t\t\tFROM pw_threads t LEFT JOIN {$pw_tmsgs} tm ON tm.tid=t.tid\r\n\t\t\tLEFT JOIN pw_members m ON m.uid=t.authorid\r\n\t\t\tWHERE t.tid=" . S::sqlEscape($rt['tid'], false)); if (in_array($rtinfo['fid'], $fidoff) || $rtinfo['ifshield'] == '2' || $groupid != '3' && $groupid != '4' && ($rtinfo['needrvrc'] > $userrvrc || !$rtinfo['ifcheck'] || $rtinfo['ifshield'] || strpos($rtinfo['content'], "[post]") !== false && strpos($rtinfo['content'], "[/post]") !== false || strpos($rtinfo['content'], "[hide") !== false && strpos($rtinfo['content'], "[/hide]") !== false || strpos($rtinfo['content'], "[sell") !== false && strpos($rtinfo['content'], "[/sell]") !== false)) { Showmsg('pic_not_exists'); } $rt['subject'] = $rtinfo['subject']; $rt['username'] = $rtinfo['username']; $a_url = geturl($rt['attachurl'], 'show'); $rt['a_url'] = is_array($a_url) ? $a_url[0] : $a_url; $uid = $rt['uid']; $type = 1; $owner = $rt['username']; !$rt['pid'] && ($rt['pid'] = 'tpc'); !$rt['descrip'] && ($rt['descrip'] = substrs(stripWindCode($rtinfo['content']), 120)); } else { Showmsg('pic_not_exists'); } require_once PrintEot('show'); footer(); }
</li> <li> <label> 推荐人: </label> <i><?php echo $r['uname']; ?> </i> </li> </ul> </dd> <label>推荐理由:</label><span style="width:170px;"><?php echo substrs($r['why'], 48, 0, 1); ?> </span> </dl> <?php } } ?> <div style="clear: both;width:86px;height:58px;"> </div> </div> </div> </div>
function buildApplied($list) { $list['title'] = substrs($list['title'], 56); $html = ''; $html .= '<div id="applied_' . $list[id] . '">'; $html .= '<div class="jobpop_h current"><a href="javascript:;" class="menu_tasksA_title" hidefocus="true"><b></b>' . $list[title] . ' <span>' . $list[gain] . '</span></a></div>'; $html .= ' <dl class="cc taskA_dl" style="display:none;">'; $html .= ' <dt><img src="' . $list[icon] . '" /></dt>'; $html .= ' <dd>'; $html .= ' <table width="100%" style="table-layout:fixed;">'; $html .= ' <tr class="vt">'; $html .= ' <td width="80">完成条件:</td>'; $html .= ' <td id="job_condition_' . $list[id] . '">' . $list[condition] . '</td>'; $html .= ' </tr>'; $html .= ' <tr class="vt">'; $html .= ' <td>完成奖励:</td>'; $html .= ' <td class="s2">' . $list[reward] . '</td>'; $html .= ' </tr>'; $html .= ' <tr class="vt">'; $html .= ' <td>任务描述:</td>'; $html .= ' <td>' . $list[description] . '</td>'; $html .= ' </tr>'; $html .= ' <tr class="vt">'; $html .= ' <td></td>'; $html .= ' <td><span class="fr">' . $list[btn] . '</span></td>'; $html .= ' </tr>'; $html .= ' </table>'; $html .= ' </dd>'; $html .= ' </dl>'; $html .= '</div>'; return $html; }
} $delarticle = L::loadClass('DelArticle', 'forum'); /* @var $delarticle PW_DelArticle */ foreach ($dpids as $dtid => $pids) { $pw_tmsgs = GetTtable($dtid); $dfid = $dtids[$dtid]; $threaddb = $db->get_one("SELECT t.tid,t.fid,t.author,t.authorid,t.postdate,t.subject,t.topped,t.anonymous,t.ifshield,t.ptable,t.ifcheck,tm.aid FROM pw_threads t LEFT JOIN {$pw_tmsgs} tm ON tm.tid=t.tid WHERE t.tid='{$dtid}'"); if (!$threaddb) { continue; } $pw_posts = GetPtable($threaddb['ptable']); $pids = S::sqlImplode($pids); $query = $db->query("SELECT pid,fid,tid,aid,author,authorid,postdate,subject,content,anonymous,ifcheck FROM {$pw_posts} WHERE tid='{$dtid}' AND fid='{$dfid}' AND pid IN({$pids})"); $replydb = array(); while ($result = $db->fetch_array($query)) { !$result['subject'] && ($result['subject'] = substrs($rt['content'], 35)); $result['postdate'] = get_date($result['postdate']); $result['ptable'] = $threaddb['ptable']; $replydb[] = $result; } /*删除回复*/ $delarticle->delReply($replydb, false); /*删除静态*/ $htmurl = $db_htmdir . '/' . $dfid . '/' . get_date('ym', $threaddb['postdate']) . '/' . $dtid . '.html'; if (file_exists(R_P . $htmurl)) { P_unlink(R_P . $htmurl); } } //* P_unlink(D_P.'data/bbscache/c_cache.php'); pwCache::deleteData(D_P . 'data/bbscache/c_cache.php'); adminmsg('operate_success', "{$admin_file}?adminjob=superdel&admintype=article&action={$action}&fid={$_POST['fid']}&tid={$_POST['tid']}&pstart={$pstart}&pend={$pend}&author=" . rawurlencode($author) . "&keyword=" . rawurlencode($keyword) . "&userip={$userip}&tcounts={$tcounts}&counts={$counts}&nums={$nums}&ptable={$ptable}&page={$page}");
/* 删除操作 */ } elseif ($type == 'del') { define('AJAX', 1); S::gp(array('id'), '', 1); $id = (int) $id; if ($id < 1) { adminmsg('operate_error', "{$basename}&action=user"); } require_once PrintApp('admin_user'); ajax_footer(); /* 删除操作 */ } elseif ($type == 'deldo') { define('AJAX', 1); S::gp(array('id', 'descrip')); $id = (int) $id; $descrip = substrs($descrip, 200); if ($id < 1) { adminmsg('operate_error', "{$basename}&action=user"); } $awardMedalInfo = $medalService->getAwardMedalById($id); $medal = $medalService->getMedal($awardMedalInfo['medal_id']); //获取medal信息 if ($medal['type'] == 1) { adminmsg('medal_error'); } $result = $medalService->recoverMedal($id, $descrip); //摘除操作 if (is_array($result)) { adminmsg($result[1], "{$basename}&action=user"); } else { adminmsg('medal_ajax_operate_success');
function updatecommend($fid, $forumset) { global $db, $timestamp; $forumset['commendnum'] < 1 && ($forumset['commendnum'] = 10); $commend = array(); $commendlist = ''; if ($forumset['commendlist']) { $commendlist = pwImplode(explode(',', $forumset['commendlist'])); $query = $db->query("SELECT tid,authorid,author,subject FROM pw_threads WHERE tid IN({$commendlist}) AND fid=" . pwEscape($fid)); while ($rt = $db->fetch_array($query)) { if ($forumset['commendlength'] && strlen($rt['subject']) > $forumset['commendlength']) { $rt['subject'] = substrs($rt['subject'], $forumset['commendlength']); } $commend[] = $rt; } } $count = count($commend); if ($forumset['autocommend'] && $count < $forumset['commendnum']) { $limit = pwLimit($forumset['commendnum'] - $count); switch ($forumset['autocommend']) { case '1': $orderby = 'postdate'; break; case '2': $orderby = 'lastpost'; break; case '3': $orderby = 'hits'; break; case '4': $orderby = 'replies'; break; default: $orderby = 'digest'; break; } $sql = $forumset['commendlist'] ? " AND tid NOT IN({$commendlist})" : ''; $query = $db->query("SELECT tid,authorid,author,subject FROM pw_threads WHERE fid=" . pwEscape($fid) . " AND topped='0' {$sql} ORDER BY {$orderby} DESC {$limit}"); while ($rt = $db->fetch_array($query)) { if ($forumset['commendlength'] && strlen($rt['subject']) > $forumset['commendlength']) { $rt['subject'] = substrs($rt['subject'], $forumset['commendlength']); } $commend[] = $rt; } } $forumset['ifcommend'] = $timestamp; $forumsetdb = addslashes(serialize($forumset)); $commend = $commend ? addslashes(serialize($commend)) : ''; $db->update("UPDATE pw_forumsextra" . " SET " . pwSqlSingle(array('forumset' => $forumsetdb, 'commend' => $commend)) . ' WHERE fid=' . pwEscape($fid)); require_once R_P . 'admin/cache.php'; updatecache_forums($fid); }
function payto($code) { global $imgpath, $stylepath, $db_bbsurl, $db_charset, $pwServer, $timestamp, $winduid; $tmp = substr($code, strpos($code, '(seller)') + 8); $seller = str_replace(array('[email]', '[/email]'), '', substr($tmp, 0, strpos($tmp, '(/seller)'))); $tmp = substr($code, strpos($code, '(subject)') + 9); $subject = substr($tmp, 0, strpos($tmp, '(/subject)')); $tmp = substr($code, strpos($code, '(body)') + 6); $body = substr($tmp, 0, strpos($tmp, '(/body)')); $tmp = substr($code, strpos($code, '(price)') + 7); $price = substr($tmp, 0, strpos($tmp, '(/price)')); $tmp = substr($code, strpos($code, '(ordinary_fee)') + 14); $ordinary_fee = substr($tmp, 0, strpos($tmp, '(/ordinary_fee)')); $tmp = substr($code, strpos($code, '(express_fee)') + 13); $express_fee = substr($tmp, 0, strpos($tmp, '(/express_fee)')); $tmp = substr($code, strpos($code, '(contact)') + 9); $contact = substr($tmp, 0, strpos($tmp, '(/contact)')); $tmp = substr($code, strpos($code, '(demo)') + 6); $demo = substr($tmp, 0, strpos($tmp, '(/demo)')); $tmp = substr($code, strpos($code, '(method)') + 8); $method = substr($tmp, 0, strpos($tmp, '(/method)')); $body = str_replace('\\"', '"', $body); $str = '<br>'; $seller && ($str .= getLangInfo('bbscode', 'seller') . $seller . '<br><br>'); $subject && ($str .= getLangInfo('bbscode', 'subject') . $subject . '<br><br>'); $body && ($str .= getLangInfo('bbscode', 'body') . $body . '<br><br>'); $price && ($str .= getLangInfo('bbscode', 'price') . $price . '<br><br>'); if (($ordinary_fee || $express_fee) && $method == '2') { $str .= getLangInfo('bbscode', 'postage'); $ordinary_fee && ($str .= getLangInfo('bbscode', 'ordinary_fee') . $ordinary_fee . ' '); $express_fee && ($str .= getLangInfo('bbscode', 'express_fee') . $express_fee); $str .= '<br><br>'; } else { $str .= getLangInfo('bbscode', 'postage_seller') . '<br><br>'; } $contact && ($str .= getLangInfo('bbscode', 'contact') . $contact . '<br><br>'); $demo && ($str .= getLangInfo('bbscode', 'demo') . $demo . '<br><br>'); $body = substrs(str_replace('<br>', "\n", $body), 100); if ($method == 1) { $str .= "<a href='https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=" . rawurlencode(str_replace('.', '.', $seller)) . "&item_name=" . rawurlencode($subject) . "&item_number=phpw*&amount={$price}&no_shipping=0&no_note=1¤cy_code=CNY¬ify_url=http://pay.phpwind.net/pay/stats.php?date=" . $pwServer['HTTP_HOST'] . get_date(time(), '-YmdHis') . "&bn=phpwind&charset={$db_charset}' target='_blank'><img src='{$imgpath}/post/paypal.gif'></a>"; } elseif ($method == 2) { if ($ordinary_fee || $express_fee) { if ($ordinary_fee && $express_fee) { $urladd = "logistics_type=POST&logistics_fee={$ordinary_fee}&logistics_payment=BUYER_PAY&logistics_type_1=EXPRESS&logistics_fee_1={$express_fee}&logistics_payment_1=BUYER_PAY"; } elseif ($ordinary_fee) { $urladd = "logistics_type=POST&logistics_fee={$ordinary_fee}&logistics_payment=BUYER_PAY"; } else { $urladd = "logistics_type=EXPRESS&logistics_fee={$express_fee}&logistics_payment=BUYER_PAY"; } } else { $urladd = "logistics_type=EXPRESS&logistics_fee=10&logistics_payment=SELLER_PAY"; } $order_no = $method - 1 . str_pad($winduid, 10, "0", STR_PAD_LEFT) . get_date($timestamp, 'YmdHis') . num_rand(5); $str .= "<a href='http://pay.phpwind.net/pay/create_payurl.php?_input_charset={$db_charset}&service=trade_create_by_buyer&subject=" . rawurlencode($subject) . "&body=" . rawurlencode($body) . "&out_trade_no={$order_no}&price={$price}&quantity=1&payment_type=1&{$urladd}&seller_email={$seller}' target='_blank'><img src='{$imgpath}/post/alipay.gif'></a>"; } elseif ($method == 3) { $str .= "<a href=\"https://www.99bill.com/website/paylink/pay.htm?payto=" . rawurlencode(str_replace('.', '.', $seller)) . "\" target=\"_blank\"><img src=\"{$imgpath}/post/99bill.gif\"></a>"; } elseif ($method == 4) { if ($ordinary_fee || $express_fee) { $urladd = "fee_payer=1&fee1={$ordinary_fee}&fee2={$express_fee}"; } else { $urladd = 'fee_payer=0'; } $str .= "<a href='http://pay.phpwind.net/pay/create_payurl.php?cmdno=11&seller={$seller}&mch_name=" . rawurlencode($subject) . "&mch_price={$price}&{$urladd}&mch_desc=" . rawurlencode($body) . "&mch_type=1' target='_blank'><img src='{$imgpath}/post/tenpay.gif' /></a>"; } return $str; }
if ($db_siteappkey && ($db_apps_list['17']['status'] == 1 || is_array($db_threadconfig))) { $appclient = L::loadClass('appclient'); if (is_array($db_threadconfig)) { $threadright = array(); $threadright = $appclient->getThreadRight(); } } /*The app client*/ $newpic = (int) GetCookie('newpic'); $query = $db->query("SELECT f.fid,f.logo,f.name, f.descrip,f.forumadmin,f.password,f.allowvisit,f.f_type,f.ifcms,fd.tpost,fd.topic,fd.article,fd.subtopic,fd.lastpost FROM pw_forums f LEFT JOIN pw_forumdata fd USING(fid) WHERE f.fup=" . S::sqlEscape($fid) . "ORDER BY f.vieworder"); while ($child = $db->fetch_array($query)) { if (empty($child['allowvisit']) || strpos($child['allowvisit'], ',' . $groupid . ',') !== false) { list($f_a, $child['au'], $f_c, $child['ft']) = explode("\t", $child['lastpost']); $child['pic'] = $newpic < $f_c && $f_c + 172800 > $timestamp ? 'new' : 'old'; $child['newtitle'] = get_date($f_c); $child['t'] = substrs($f_a, 21); } else { if ($child['f_type'] === 'hidden') { continue; } $child['pic'] = "lock"; } $child['topics'] = $child['topic'] + $child['subtopic']; if ($db_indexfmlogo == 1 && file_exists("{$imgdir}/{$stylepath}/forumlogo/{$child['fid']}.gif")) { $child['logo'] = "{$imgpath}/{$stylepath}/forumlogo/{$child['fid']}.gif"; } elseif ($db_indexfmlogo == 2) { if (!empty($child['logo']) && strpos($child['logo'], 'http://') === false) { list($child['logo']) = geturl($child['logo'], 'lf'); } if (!empty($child['logo'])) { $child['pic'] = '';
function getReadContent() { $readdb = array(); $pw_tmsgs = GetTtable($this->tid); $read = $this->db->get_one("SELECT t.*,tm.*,m.uid,m.username,m.oicq,m.groupid,m.memberid,m.icon AS micon ,m.hack,m.honor,m.signature,m.regdate,m.medals,m.userstatus,md.onlinetime,md.postnum,md.digests,md.rvrc,md.money,md.credit,md.currency,md.starttime,md.thisvisit,md.lastvisit,mb.* FROM pw_threads t LEFT JOIN {$pw_tmsgs} tm ON t.tid=tm.tid LEFT JOIN pw_members m ON m.uid=t.authorid LEFT JOIN pw_memberdata md ON md.uid=t.authorid {$this->tablaadd} WHERE t.tid=" . S::sqlEscape($this->tid)); if (!$read || $read['special'] || !$read['ifcheck']) { return false; } $this->fid = $read['fid']; $this->datedir = date('ym', $read['postdate']); if (file_exists(R_P . "{$this->htmdir}/{$this->fid}/{$this->datedir}/{$this->tid}.html")) { P_unlink(R_P . "{$this->htmdir}/{$this->fid}/{$this->datedir}/{$this->tid}.html"); } if (!$this->initForum($this->fid)) { return false; } if ($this->isHideContent($read['content'])) { return false; } $this->setSeosetting(&$read); $this->vars['forumtitle'] = $this->forumtitle; $this->vars['msg_guide'] = $this->guidename . "<em>></em><a href=\"read.php?tid={$this->tid}\">{$read['subject']}</a>"; $this->vars['db_metakeyword'] = $read['subject'] . str_replace(array('|', ' - '), ',', $this->forumtitle) . 'phpwind'; $this->vars['subject'] = $read['subject']; $this->vars['titletop1'] = substrs('Re:' . str_replace(' ', ' ', $read['subject']), L::config('db_titlemax') - 2); $this->vars['hits'] = $read['hits']; $this->vars['replies'] = $read['replies']; $this->vars['tid'] = $this->tid; $this->vars['fid'] = $this->fid; $this->vars['pwforum'] = $this->forum; $this->vars['postUrl'] = 'post.php?fid=' . $this->fid; $_pids = array(); $read['aid'] && ($_pids[] = 0); $count = $read['replies'] + 1; $this->vars['pages'] = numofpage($count, 1, ceil($count / $this->perpage), "{$GLOBALS['db_bbsurl']}/read.php?tid={$this->tid}&"); $read['pid'] = 'tpc'; $readdb[] = $read; if ($read['replies'] > 0) { $readnum = $this->perpage - 1; $pw_posts = GetPtable($read['ptable']); $query = $this->db->query("SELECT t.*,m.uid,m.username,m.oicq,m.groupid,m.memberid,m.icon AS micon,m.hack,m.honor,m.signature,m.regdate,m.medals,m.userstatus,md.onlinetime,md.postnum,md.digests,md.rvrc,md.money,md.credit,md.currency,md.starttime,md.thisvisit,md.lastvisit, mb.* FROM {$pw_posts} t LEFT JOIN pw_members m ON m.uid=t.authorid LEFT JOIN pw_memberdata md ON md.uid=t.authorid {$this->tablaadd} WHERE t.tid=" . S::sqlEscape($this->tid) . " AND ifcheck='1' ORDER BY postdate LIMIT 0,{$readnum}"); while ($read = $this->db->fetch_array($query)) { if ($this->isHideContent($read['content'])) { return false; } $read['aid'] && ($_pids[] = $read['pid']); $readdb[] = $read; } $this->db->free_result($query); } if ($_pids) { $this->attachShow = new attachShow(false); $this->attachShow->init($this->tid, $_pids); } $this->vars['db_menuinit'] = "'td_post' : 'menu_post','td_post1' : 'menu_post','td_hack' : 'menu_hack'"; $bandb = $this->forum->forumBan($readdb); $authorids = array($read['authorid']); $start_limit = 0; foreach ($readdb as $key => $read) { isset($bandb[$read['authorid']]) && ($read['groupid'] = 6); $authorids[] = $read['authorid']; $readdb[$key] = $this->htmread($read, $start_limit++); $this->vars['db_menuinit'] .= ",'td_read_" . $read['pid'] . "':'menu_read_" . $read['pid'] . "'"; } if (L::config('db_showcustom')) { $this->vars['customdb'] = $this->getCustomdb($authorids); } return $readdb; }
$db->update("UPDATE pw_tools SET stock=stock-" . S::sqlEscape($nums) . " WHERE id=" . S::sqlEscape($id)); $db->pw_update("SELECT uid FROM pw_usertool WHERE uid=" . S::sqlEscape($winduid) . " AND toolid=" . S::sqlEscape($id), "UPDATE pw_usertool SET nums=nums+" . S::sqlEscape($nums) . " WHERE uid=" . S::sqlEscape($winduid) . " AND toolid=" . S::sqlEscape($id), "INSERT INTO pw_usertool SET " . S::sqlSingle(array('nums' => $nums, 'uid' => $winduid, 'toolid' => $id, 'sellstatus' => $sell_status))); require_once R_P . 'require/tool.php'; $logdata = array('type' => 'buy', 'nums' => $nums, 'money' => $price, 'descrip' => 'buy_descrip', 'uid' => $winduid, 'username' => $windid, 'ip' => $onlineip, 'time' => $timestamp, 'toolname' => $toolinfo['name'], 'from' => ''); writetoollog($logdata); procUnLock('tool_buy', $winduid); } refreshto("profile.php?action=toolcenter", 'operate_success'); } } elseif ($job == 'use' || $job == 'ajax') { $toolid = (int) S::getGP('toolid'); if (!$toolid) { $tooldb = array(); $query = $db->query("SELECT * FROM pw_usertool u LEFT JOIN pw_tools t ON t.id=u.toolid WHERE u.uid=" . S::sqlEscape($winduid) . "ORDER BY vieworder"); while ($rt = $db->fetch_array($query)) { $rt['descrip'] = substrs($rt['descrip'], 45); $tooldb[] = $rt; } if (!$tooldb) { Showmsg('no_tool'); } require_once uTemplate::PrintEot('profile_toolcenter'); pwOutPut(); } $tooldb = $db->get_one("SELECT u.nums,t.name,t.filename,t.state,t.type,t.conditions FROM pw_usertool u LEFT JOIN pw_tools t ON t.id=u.toolid WHERE u.uid=" . S::sqlEscape($winduid) . "AND u.toolid=" . S::sqlEscape($toolid)); !$db_toolifopen && Showmsg('toolcenter_close'); if (!$tooldb || $tooldb['nums'] <= 0) { Showmsg('nothistool'); } if ($tooldb['type'] == 1) { !$tid && Showmsg('illegal_tid');
$psot_sta = 'reply'; //control the faster reply $titletop1 = substrs('Re:' . str_replace(' ', ' ', $subject), $db_titlemax - 2); $fastpost = 'fastpost'; $db_forcetype = 0; if (!allowcheck($foruminfo['allowrp'], $groupid, $winddb['groups'], $fid, $winddb['reply'])) { $fastpost = ''; } else { $fastpost = 'fastpost'; } !$foruminfo['allowrp'] && $_G['allowrp'] && ($fastpost = 'fastpost'); } elseif ($groupid == 'guest' && !$tpc_locked) { //显示快速回复表单 $fastpost = 'fastpost'; $psot_sta = 'reply'; $titletop1 = substrs('Re:' . str_replace(' ', ' ', $subject), $db_titlemax - 2); $db_forcetype = 0; if (!$_G['allowrp'] && !$foruminfo['allowrp'] || $foruminfo['allowrp']) { $anonymity = true; } } $postUrl = 'post.php?fid=' . $fid; if ($readdb[0]['cyid']) { $db_menuinit .= ",'td_admin' : 'menu_admin'"; $postUrl .= '&cyid=' . $readdb[0]['cyid']; } else { $db_menuinit .= ",'td_post' : 'menu_post','td_post1' : 'menu_post','td_admin' : 'menu_admin'"; } //allowtype onoff if ($foruminfo['allowtype'] && ($foruminfo['allowtype'] & 1 || $foruminfo['allowtype'] & 2 && $_G['allownewvote'] || $foruminfo['allowtype'] & 4 && $_G['allowactive'] || $foruminfo['allowtype'] & 8 && $_G['allowreward'] || $foruminfo['allowtype'] & 16 || $foruminfo['allowtype'] & 32 && $_G['allowdebate'])) { $N_allowtypeopen = true;
function getLastThread($limit = 10) { $openforum = array(); require_once R_P . 'require/bbscode.php'; $openforum = $this->_getOpenforums(); $service = L::loadClass('threads', 'forum'); $data = $service->getLatestThreads($openforum, '', '', 0, $limit); if (!S::isArray($data)) { return array(); } foreach ($data as $v) { if ($v['ifhide']) { $v['content'] = "[内容已隐藏]"; } if ($v['anonymous']) { $v['author'] = '匿名用户'; $v['authorid'] = 0; } if ($v['locked'] == 2) { $v['content'] = "主题已被关闭"; $v['subject'] = "主题已被关闭"; } $v['content'] = $this->_replace($v['content']); //$v['content'] = convert($v['content'],'','post'); $v['content'] = substrs($v['content'], 160, 'Y'); list($v['postdate'], $v['postdate_s']) = getLastDate($v['postdate']); $arr[] = array('tid' => $v['tid'], 'fid' => $v['fid'], 'author' => $v['author'], 'authorid' => $v['authorid'], 'subject' => $v['subject'], 'postdate' => $v['postdate'], 'content' => $v['content'], 'anonymous' => $v['anonymous'], 'url' => "read.php?tid=" . $v['tid']); $uids[] = $v['authorid']; } $usersInfo = $this->_getUserInfo($uids, true); if (empty($arr)) { return array(); } foreach ($arr as $k => $value) { !is_array($usersInfo[$value['authorid']]) && ($usersInfo[$value['authorid']] = array()); $arr[$k]['icon'] = $usersInfo[$value['authorid']]['icon']; } return $arr; }
if ($album['ownerid'] != $winduid && $album['private'] == 2 && $groupid != 3) { Showmsg('mode_o_photos_private_2'); } $viewpwd && ($viewpwd = md5($viewpwd)); if ($album['ownerid'] != $winduid && $album['private'] == 3 && $viewpwd != $album['albumpwd'] && $groupid != 3) { Showmsg('mode_o_photos_private_3'); } if ($album['photonum']) { list($pages, $limit) = pwLimitPages($album['photonum'], $page, "{$basename}a={$a}&aid={$aid}&"); $query = $db->query("SELECT c.pid,c.path,c.ifthumb,c.uptime,m.groupid,c.pintro,c.c_num FROM pw_cnphoto c LEFT JOIN pw_members m ON c.uploader=m.username WHERE c.aid=" . pwEscape($aid) . " ORDER BY c.pid {$limit}"); while ($rt = $db->fetch_array($query)) { $rt['path'] = getphotourl($rt['path'], $rt['ifthumb']); if ($rt['groupid'] == 6 && $db_shield && $groupid != 3) { $rt['path'] = $pwModeImg . '/banuser.gif'; } $rt['sub_pintro'] = substrs($rt['pintro'], 25); $rt['uptime'] = get_date($rt['uptime']); $cnpho[] = $rt; } } $u = $album['ownerid']; $username = $album['owner']; } elseif ($a == 'view') { InitGP(array('pid')); $db->update("UPDATE pw_cnphoto SET hits=hits+1 WHERE pid=" . pwEscape($pid)); //$photo = $db->get_one("SELECT p.pid,p.aid,p.pintro,p.path as basepath,p.uploader,p.uptime,p.hits,p.c_num,p.ifthumb,a.aname,a.private, a.ownerid,a.owner,a.photonum,m.groupid FROM pw_cnphoto p LEFT JOIN pw_cnalbum a ON p.aid=a.aid LEFT JOIN pw_members m ON p.uploader=m.username WHERE p.pid=" . pwEscape($pid) . " AND a.atype='0'"); # album photos $nearphoto = array(); $register = array('db_shield' => $db_shield, "groupid" => $groupid, "pwModeImg" => $pwModeImg); require_once R_P . 'lib/showpicture.class.php'; $sp = new PW_ShowPicture($register);
} foreach ($_tmpForums as $forums) { if ($forums['type'] === 'forum') { if ($forums['showsub'] && $forums['childid']) { $showsub[$forums['fid']] = ''; } $forums['topics'] = $forums['topic'] + $forums['subtopic']; $article += $forums['article']; $topics += $forums['topics']; $tposts += $forums['tpost']; $forums['au'] = $forums['admin'] = ''; if (S::inArray($windid, $manager) || !$forums['password'] && (!$forums['allowvisit'] || allowcheck($forums['allowvisit'], $groupid, $winddb['groups'], $forums['fid'], $winddb['visit']))) { list($forums['t'], $forums['au'], $forums['newtitle'], $forums['ft']) = explode("\t", $forums['lastpost']); $forums['pic'] = $newpic < $forums['newtitle'] && $forums['newtitle'] + $db_newtime > $timestamp ? 'new' : 'old'; $forums['newtitle'] = get_date($forums['newtitle']); $forums['t'] = substrs($forums['t'], 26); } elseif ($forum[$forums['fid']]['f_type'] === 'hidden') { if ($forums['password'] && allowcheck($forums['allowvisit'], $groupid, $winddb['groups'], $forums['fid'], $winddb['visit'])) { $forums['pic'] = 'lock'; } else { if (!S::inArray($windid, $manager)) { continue; } } } else { $forums['pic'] = 'lock'; } $forums['allowhtm'] == 1 && ($c_htm = 1); if ($db_indexfmlogo == 2) { if (!empty($forums['logo']) && strpos($forums['logo'], 'http://') !== false) { $forums['logo'] = $forums[logo];
$db->update("UPDATE pw_threads SET " . pwSqlSingle($pwSQL, false) . " WHERE tid=" . pwEscape($tid)); # memcache reflesh $threadList = L::loadClass("threadlist"); $threadList->updateThreadIdsByForumId($fid, $tid); $db->update("UPDATE {$pw_tmsgs} SET " . pwSqlSingle(array('aid' => $rt['aid'], 'userip' => $rt['userip'], 'ifsign' => $rt['ifsign'], 'ipfrom' => $rt['ipfrom'], 'alterinfo' => $rt['alterinfo'], 'ifconvert' => $rt['ifconvert'], 'content' => $rt['content']), false) . " WHERE tid=" . pwEscape($tid)); } $msg_delrvrc = abs($creditset['Delete']['rvrc']); $msg_delmoney = abs($creditset['Delete']['money']); $credit->addLog('topic_Delete', $creditset['Delete'], array('uid' => $authorid, 'username' => $author, 'ip' => $onlineip, 'fname' => strip_tags($forum[$fid]['name']), 'operator' => $windid)); $credit->sets($authorid, $creditset['Delete'], false); if ($thread_tpcstatus && getstatus($thread_tpcstatus, 1)) { $db->update("DELETE FROM pw_argument WHERE tid=" . pwEscape($tid)); } } else { $deltype = 'delrp'; $deltitle = $subject ? substrs($subject, 28) : substrs($content, 28); $db->update("DELETE FROM {$pw_posts} WHERE pid=" . pwEscape($pid)); $db->update("UPDATE pw_threads SET replies=replies-1 WHERE tid=" . pwEscape($tid)); $msg_delrvrc = abs($creditset['Deleterp']['rvrc']); $msg_delmoney = abs($creditset['Deleterp']['money']); $credit->addLog('topic_Deleterp', $creditset['Deleterp'], array('uid' => $authorid, 'username' => $author, 'ip' => $onlineip, 'fname' => strip_tags($forum[$fid]['name']), 'operator' => $windid)); $credit->sets($authorid, $creditset['Deleterp'], false); } $credit->setMdata($authorid, 'postnum', -1); $credit->runsql(); if ($db_guestread) { require_once R_P . 'require/guestfunc.php'; clearguestcache($tid, $rs['replies']); } P_unlink(D_P . 'data/bbscache/c_cache.php'); require_once R_P . 'require/updateforum.php';
PostCheck(); S::gp(array('title1', 'title2', 'title3', 'title4', 'nextto', 'ifmsg', 'timelimit')); if ($title1 && !preg_match('/#[0-9A-F]{6}/is', $title1)) { Showmsg('mawhole_nodata'); } !$selids && Showmsg('mawhole_nodata'); $titlefont = S::escapeChar("{$title1}~{$title2}~{$title3}~{$title4}~{$title5}~{$title6}~"); $ifedit = !$title1 && !$title2 && !$title3 && !$title4 ? 0 : 1; $toolfield = $timelimit > 0 && $ifedit ? $timelimit * 86400 + $timestamp : ''; $msgdb = $logdb = array(); $query = $db->query("SELECT a.tid,a.postdate,t.author,t.authorid,t.subject,a.toolfield FROM pw_argument a LEFT JOIN pw_threads t ON a.tid=t.tid WHERE a.tid IN(" . S::sqlImplode($selids) . ")"); while ($rt = $db->fetch_array($query)) { if ($ifmsg) { $msgdb[] = array('toUser' => $rt['author'], 'title' => getLangInfo('writemsg', $ifedit ? 'highlight_title' : 'unhighlight_title'), 'content' => getLangInfo('writemsg', $ifedit ? 'highlight_content' : 'unhighlight_content', array('manager' => $windid, 'fid' => $fid, 'tid' => $rt['tid'], 'subject' => $rt['subject'], 'postdate' => get_date($rt['postdate']), 'forum' => strip_tags($forum[$fid]['name']), 'admindate' => get_date($timestamp), 'reason' => stripslashes($atc_content)))); } $logdb[] = array('type' => 'highlight', 'username1' => $rt['author'], 'username2' => $windid, 'field1' => $fid, 'field2' => $rt['tid'], 'field3' => '', 'descrip' => $ifedit ? 'highlight_descrip' : 'unhighlight_descrip', 'timestamp' => $timestamp, 'ip' => $onlineip, 'tid' => $rt['tid'], 'subject' => substrs($rt['subject'], 28), 'forum' => $forum[$fid]['name'], 'reason' => stripslashes($atc_content)); if ($toolfield || $rt['toolfield']) { $t = explode(',', $rt['toolfield']); $rt['toolfield'] = $t[0] . ',' . $toolfield; $db->update("UPDATE pw_argument SET titlefont=" . S::sqlEscape($titlefont) . ',toolfield=' . S::sqlEscape($rt['toolfield']) . ' WHERE tid=' . S::sqlEscape($rt['tid'])); } else { $tids[] = $rt['tid']; } } sendMawholeMessages($msgdb); foreach ($logdb as $key => $val) { writelog($val); } if ($tids) { $db->update("UPDATE pw_argument SET titlefont=" . S::sqlEscape($titlefont) . " WHERE tid IN(" . S::sqlImplode($tids) . ")"); }