function resetInfo($tid, $atcdb) { $reset = array(); @extract($this->db->get_one("SELECT cbtype,catype FROM pw_reward WHERE tid=" . S::sqlEscape($tid))); $reset['b_select'] = "<option value=\"{$cbtype}\">" . pwCreditNames($cbtype) . '</option>'; $reset['a_select'] = "<option value=\"{$catype}\">" . pwCreditNames($catype) . '</option>'; return $reset; }
function getCtype() { $sel = ''; $ctype = pwCreditNames(); foreach ($this->allowcredit as $key => $val) { $sel .= "<option value=\"{$val}\">" . $ctype[$val] . "</option>"; } return $sel; }
function initVars() { $this->vars = L::config(); $this->vars['imgpath'] = $GLOBALS['imgpath']; $this->vars['db_bbstitle'] = $this->vars['db_bbstitle']['other']; $this->vars['db_bbsname_a'] = addslashes($this->vars['db_bbsname']); //模版内用到 $this->vars['wind_version'] = $GLOBALS['wind_version']; $this->vars['db_userurl'] = $GLOBALS['db_userurl']; $this->vars['creditnames'] = pwCreditNames(); if (!is_array($this->vars['db_union'])) { $this->vars['db_union'] = explode("\t", stripslashes($this->vars['db_union'])); $this->vars['db_union'][0] && ($this->vars['db_hackdb'] = array_merge((array) $this->vars['db_hackdb'], (array) unserialize($this->vars['db_union'][0]))); } list($this->vars['_Navbar']) = pwNavBar(); }
function update_markinfo($fid, $tid, $pid) { global $db; $perpage = 10; $pid = intval($pid); $creditnames = pwCreditNames(); $whereStr = " fid=" . S::sqlEscape($fid) . " AND tid=" . S::sqlEscape($tid) . " AND pid=" . S::sqlEscape($pid) . " AND ifhide=0 "; $count = 0; $creditCount = array(); $query = $db->query("SELECT COUNT(*) AS count,name,SUM(point) AS sum FROM pw_pinglog WHERE {$whereStr} GROUP BY name"); while ($rt = $db->fetch_array($query)) { $count += $rt['count']; if (isset($creditnames[$rt['name']])) { $creditCount[$rt['name']] += $rt['sum']; } elseif (in_array($rt['name'], $creditnames)) { $key = array_search($rt['name'], $creditnames); $creditCount[$key] += $rt['sum']; } } $markInfo = ''; if ($count) { $query = $db->query("SELECT id FROM pw_pinglog WHERE {$whereStr} ORDER BY id DESC LIMIT 0,{$perpage}"); $ids = array(); while ($rt = $db->fetch_array($query)) { $ids[] = $rt['id']; } $markInfo = $count . ":" . implode(",", $ids); if ($creditCount) { $tmp = array(); foreach ($creditCount as $key => $value) { $tmp[] = $key . '=' . $value; } $markInfo .= ':' . implode(',', $tmp); } } if ($pid == 0) { //* $db->update("UPDATE $pw_tmsgs SET ifmark=" . S::sqlEscape($markInfo) . " WHERE tid=" . S::sqlEscape($tid)); $pw_tmsgs = GetTtable($tid); pwQuery::update($pw_tmsgs, 'tid=:tid', array($tid), array('ifmark' => $markInfo)); } else { $db->update("UPDATE " . GetPtable("N", $tid) . " SET ifmark=" . S::sqlEscape($markInfo) . " WHERE pid=" . S::sqlEscape($pid)); } return $markInfo; }
$aids = array(); if ($atcdb['attachs']) { $aids = attachment($atc_content); } $leaveword = $atcdb['leaveword'] ? leaveword($atcdb['leaveword']) : ''; $content = convert($postdata->data['content'] . $leaveword, $db_windpost); if (strpos($content, '[p:') !== false || strpos($content, '[s:') !== false) { $content = showface($content); } if ($atcdb['ifsign'] < 2) { $content = str_replace("\n", '<br />', $content); } if ($postdata->data['ifwordsfb'] == 0) { $content = addslashes(wordsConvert(stripslashes($content))); } $creditnames = pwCreditNames(); if ($aids) { if ($winduid == $atcdb['authorid'] || $pwpost->isGM || pwRights($pwpost->isBM, 'delattach')) { $dfadmin = 1; } else { $dfadmin = 0; } foreach ($atcdb['attachs'] as $at) { if (!in_array($at['aid'], $aids)) { continue; } $atype = ''; $rat = array(); if ($at['type'] == 'img' && $at['needrvrc'] == 0 && (!$downloadimg || !$downloadmoney || $_G['allowdownload'] == 2)) { $a_url = geturl($at['attachurl'], 'show'); if (is_array($a_url)) {
/** * 获取积分设置对应表 * 主要是给每个积分选项设置一个唯一的key,用于数据存储 * 系统默认的为负数,自定义的为其唯一的主键 * 同时提交某特定key的名称 * @return unknown */ function getCreditDefaultMap($creditKey = null) { $map = $this->_getCreditMap(); $creditNames = pwCreditNames(); $tmp = array(); foreach ($creditNames as $key => $value) { if (in_array($key, array_keys($map))) { $tmp[$map[$key]] = $value; continue; } $tmp[$key] = $value; } return array_key_exists($creditKey, $tmp) ? $tmp[$creditKey] : $tmp; }
if ($tooldb['type'] != 2) { Showmsg('tooluse_type_error'); // 判断道具类型是否设置错误 } $condition = unserialize($tooldb['conditions']); $lucktype = $condition['luck']['lucktype']; $num = $newcredit = ''; $userService = L::loadClass('UserService', 'user'); /* @var $userService PW_UserService */ $rt = $userService->get($winduid, false, true); //$lucktype $num = mt_rand($condition['luck']['range1'], $condition['luck']['range2']); $newluck = $rt[$lucktype] + $num; $credit->set($winduid, $lucktype, $num); if ($num != 0) { $creditType = $num > 0 ? 'hack_creditluckadd' : 'hack_creditluckdel'; $credit->addLog($creditType, array($lucktype => $num), array('uid' => $winduid, 'username' => $windid, 'ip' => $onlineip, 'operator' => $windid)); $credit->writeLog(); } $db->update("UPDATE pw_usertool SET nums=nums-1 WHERE uid=" . S::sqlEscape($winduid) . "AND toolid=" . S::sqlEscape($toolid)); $logdata = array('type' => 'use', 'descrip' => 'tool_15_descrip', 'uid' => $winduid, 'username' => $windid, 'ip' => $onlineip, 'time' => $timestamp, 'toolname' => $tooldb['name'], 'newluck' => $newluck); writetoollog($logdata); $msg = ''; if ($num > 0) { $msg = '祝贺您获得' . $num . '个' . pwCreditNames($lucktype); } elseif ($num < 0) { $msg = '不幸,您的' . pwCreditNames($lucktype) . '被扣除' . abs($num) . '个'; } elseif ($num == 0) { $msg = '波澜不惊,' . pwCreditNames($lucktype) . '没有发生变化'; } Showmsg($msg);
<?php !function_exists('adminmsg') && exit('Forbidden'); if ($uc_server != 1) { $db_adminrecord = 0; $basename = "javascript:parent.closeAdminTab(window);"; adminmsg('uc_server_set'); } require_once R_P . 'uc_client/class_core.php'; $uc = new UC(); $credittype = pwCreditNames(); if (empty($action)) { $ucApp = $uc->load('app'); $applist = $ucApp->applist(); include PrintEot('uccredit'); exit; } elseif ($action == 'create') { $ucApp = $uc->load('app'); $applist = $ucApp->applist(); if (empty($_POST['step'])) { $setv = ''; include PrintEot('uccredit'); exit; } else { S::gp(array('cid', 'ctype')); $basename .= '&action=create'; if (!$cid || !isset($credittype[$cid])) { adminmsg('uc_cname_empty'); } !$uc_syncredit && ($uc_syncredit = array()); if (isset($uc_syncredit[$cid])) {
function get() { return new ApiResponse(pwCreditNames()); }
function htmread($read, $start_limit) { global $tpc_author, $count, $timestamp, $db_onlinetime, $db_bbsurl, $attachdir, $attachpath, $_G, $tablecolor, $readcolorone, $readcolortwo, $lpic, $ltitle, $imgpath, $db_ipfrom, $db_showonline, $stylepath, $db_windpost, $db_windpic, $fid, $tid, $attachments, $aids, $db_signwindcode, $db_md_ifopen, $_MEDALDB, $db_shield; //* include_once pwCache::getPath(D_P.'data/bbscache/level.php'); extract(pwCache::getData(D_P . 'data/bbscache/level.php', false)); $read['lou'] = $start_limit; $start_limit == $count - 1 && ($read['jupend'] = '<a name=lastatc></a>'); $read['ifsign'] < 2 && ($read['content'] = str_replace("\n", "<br>", $read['content'])); $read['groupid'] == '-1' && ($read['groupid'] = $read['memberid']); $anonymous = $read['anonymous'] ? 1 : 0; if ($read['groupid'] != '' && $anonymous == 0) { !$lpic[$read['groupid']] && ($read['groupid'] = 8); $read['lpic'] = $lpic[$read['groupid']]; $read['level'] = $ltitle[$read['groupid']]; $read['regdate'] = get_date($read['regdate'], "Y-m-d"); $read['lastlogin'] = get_date($read['lastvisit'], "Y-m-d"); $read['aurvrc'] = floor($read['rvrc'] / 10); $read['author'] = $read['username']; $read['ontime'] = (int) ($read['onlinetime'] / 3600); $tpc_author = $read['author']; $read['face'] = showfacedesign($read['micon']); if ($db_ipfrom == 1) { $read['ipfrom'] = ' From:' . $read['ipfrom']; } if ($db_md_ifopen && $read['medals']) { $medals = ''; $md_a = explode(',', $read['medals']); foreach ($md_a as $key => $value) { if ($value) { $medals .= "<img src=\"{$_MEDALDB[$value][smallimage]}\" title=\"{$_MEDALDB[$value][name]}\" /> "; } } $read['medals'] = $medals . '<br />'; } else { $read['medals'] = ''; } if ($read['ifsign'] == 1 || $read['ifsign'] == 3) { global $sign; if (!$sign[$read['author']]) { global $db_signmoney, $db_signgroup, $tdtime; if (strpos($db_signgroup, ",{$read['groupid']},") !== false && $db_signmoney && (!getstatus($read['userstatus'], PW_USERSTATUS_SHOWSIGN) || (!$read['starttime'] || $read['currency'] < ($tdtime - $read['starttime']) / 86400 * $db_signmoney))) { $read['signature'] = ''; } else { if ($db_signwindcode && getstatus($read['userstatus'], PW_USERSTATUS_SIGNCHANGE)) { $read['signature'] = convert($read['signature'], $db_windpic, 2); } $read['signature'] = str_replace("\n", "<br>", $read['signature']); } $sign[$read['author']] = $read['signature']; } else { $read['signature'] = $sign[$read['author']]; } } else { $read['signature'] = ''; } } else { $read['face'] = "<br>"; $read['lpic'] = '8'; $read['level'] = $read['digests'] = $read['postnum'] = $read['money'] = $read['regdate'] = $read['lastlogin'] = $read['aurvrc'] = $read['credit'] = '*'; if ($anonymous) { $read['signature'] = $read['honor'] = $read['medals'] = $read['ipfrom'] = ''; $read['author'] = $GLOBALS['db_anonymousname']; $read['authorid'] = 0; foreach ($GLOBALS['customfield'] as $key => $val) { $field = "field_" . (int) $val['id']; $read[$field] = '*'; } } } $read['postdate'] = get_date($read['postdate']); $read['mark'] = ''; if ($read['ifmark']) { $markdb = explode("\t", $read['ifmark']); foreach ($markdb as $key => $value) { $read['mark'] .= "<li>{$value}</li>"; } } if ($read['icon']) { $read['icon'] = "<img src=\"{$imgpath}/post/emotion/{$read['icon']}.gif\" align=left border=0>"; } else { $read['icon'] = ''; } /** * 动态判断发帖是否需要转换 */ $tpc_shield = 0; if ($read['ifshield'] || $read['groupid'] == 6 && $db_shield) { $read['subject'] = $read['icon'] = ''; $read['content'] = shield($read['ifshield'] ? $read['ifshield'] == 1 ? 'shield_article' : 'shield_del_article' : 'ban_article'); $tpc_shield = 1; } $creditnames = pwCreditNames(); if (!$tpc_shield) { $attachs = $aids = array(); if ($read['aid'] && !$read['ifhide']) { $attachs = unserialize($read['aid']); if (is_array($attachs)) { $aids = attachment($read['content']); } } $wordsfb = L::loadClass('FilterUtil', 'filter'); if (!$wordsfb->equal($read['ifwordsfb'])) { $read['content'] = $wordsfb->convert($read['content']); } if ($read['ifconvert'] == 2) { $read['content'] = preg_replace("/\\[sell=(.+?)\\]/is", "", $read['content']); $read['content'] = preg_replace("/\\[hide=(.+?)\\]/is", "", $read['content']); $read['content'] = str_replace(array('[/hide]', '[/sell]', '[post]', '[/post]'), '', $read['content']); $read['content'] = convert($read['content'], $db_windpost); } else { strpos($read['content'], '[s:') !== false && ($read['content'] = showface($read['content'])); } if ($attachs && is_array($attachs) && !$read['ifhide']) { foreach ($attachs as $at) { $atype = ''; $rat = array(); if ($at['type'] == 'img' && $at['needrvrc'] == 0) { $a_url = geturl($at['attachurl'], 'show'); if (is_array($a_url)) { $atype = 'pic'; $dfurl = '<br>' . cvpic($a_url[0], 1, $db_windpost['picwidth'], $db_windpost['picheight'], $at['ifthumb']); $rat = array('aid' => $at['aid'], 'img' => $dfurl, 'dfadmin' => 0, 'desc' => $at['desc']); } elseif ($a_url == 'imgurl') { $atype = 'picurl'; $rat = array('aid' => $at['aid'], 'name' => $at['name'], 'dfadmin' => 0, 'verify' => md5("showimg{$tid}{$read[pid]}{$fid}{$at[aid]}{$GLOBALS[db_hash]}")); } } else { $atype = 'downattach'; if ($at['needrvrc'] > 0) { !$at['ctype'] && ($at['ctype'] = $at['special'] == 2 ? 'money' : 'rvrc'); $at['special'] == 2 && $GLOBALS['db_sellset']['price'] > 0 && ($at['needrvrc'] = min($at['needrvrc'], $GLOBALS['db_sellset']['price'])); } $rat = array('aid' => $at['aid'], 'name' => $at['name'], 'size' => $at['size'], 'hits' => $at['hits'], 'needrvrc' => $at['needrvrc'], 'special' => $at['special'], 'cname' => $creditnames[$at['ctype']], 'type' => $at['type'], 'dfadmin' => 0, 'desc' => $at['desc'], 'ext' => strtolower(substr(strrchr($at['name'], '.'), 1))); } if (!$atype) { continue; } if (in_array($at['aid'], $aids)) { $read['content'] = attcontent($read['content'], $atype, $rat); } else { $read[$atype][$at['aid']] = $rat; } } } } $GLOBALS['foruminfo']['copyctrl'] && ($read['content'] = preg_replace("/<br>/eis", "copyctrl('{$read['colour']}')", $read['content'])); $read['alterinfo'] && ($read['content'] .= "<br><br><br><font color=gray>[ {$read['alterinfo']} ]</font>"); return $read; }
$winduid = $winddb['uid']; $groupid = $winddb['groupid']; $userrvrc = floor($winddb['rvrc'] / 10); $windid = $winddb['username']; $_datefm = $winddb['datefm']; $_timedf = $winddb['timedf']; $credit_pop = $winddb['creditpop']; if ($credit_pop && $db_ifcredit) { //Credit Changes Tips $credit_pop = str_replace(array('<', '"', '>'), array('<', '"', '>'), $credit_pop); $creditdb = explode('|', $credit_pop); $credit_pop = Char_cv(GetCreditLang('creditpop', $creditdb['0'])); unset($creditdb['0']); foreach ($creditdb as $val) { list($credit_1, $credit_2) = explode(':', $val); $credit_pop .= '<span class="b st2 pdD w">' . pwCreditNames($credit_1) . ' <span class="f24">' . $credit_2 . '</span></span>'; } $db->update("UPDATE pw_memberdata SET creditpop='' WHERE uid=" . pwEscape($winduid)); } list($winddb['style'], $ifcustomstyle) = explode('|', $winddb['style']); $skin = $winddb['style'] ? $winddb['style'] : $db_defaultstyle; list($winddb['onlineip']) = explode('|', $winddb['onlineip']); $groupid == '-1' && ($groupid = $winddb['memberid']); $curvalue = $db_signcurtype == 'rvrc' ? $userrvrc : $winddb[$db_signcurtype]; if (getstatus($winddb['userstatus'], 10) && (!$winddb['starttime'] && $db_signmoney && strpos($db_signgroup, ",{$groupid},") !== false && $curvalue > $db_signmoney || $winddb['starttime'] && $winddb['starttime'] != $tdtime)) { require_once R_P . 'require/Signfunc.php'; Signfunc($winddb['starttime'], $curvalue); } unset($curvalue); } else { $skin = $db_defaultstyle;
if ($buymethod) { if ($forumset['sellprice'][$date]['rprice'] <= 0) { Showmsg('undefined_action'); } //* include_once pwCache::getPath(D_P.'data/bbscache/ol_config.php'); pwCache::getData(D_P . 'data/bbscache/ol_config.php'); if (!$ol_onlinepay) { Showmsg($ol_whycolse); } $order_no = '1' . str_pad($winduid, 10, "0", STR_PAD_LEFT) . get_date($timestamp, 'YmdHis') . num_rand(5); $db->update("INSERT INTO pw_clientorder SET " . S::sqlSingle(array('order_no' => $order_no, 'type' => 2, 'uid' => $winduid, 'paycredit' => $fid, 'price' => $forumset['sellprice'][$date]['rprice'], 'number' => 1, 'date' => $timestamp, 'state' => 0, 'extra_1' => $date))); if (!$ol_payto) { Showmsg('olpay_alipayerror'); } require_once R_P . 'require/onlinepay.php'; $olpay = new OnlinePay($ol_payto); ObHeader($olpay->alipayurl($order_no, $forumset['sellprice'][$date]['rprice'], 2)); } if ($forumset['sellprice'][$date]['cprice'] <= 0) { Showmsg('undefined_action'); } if ($credit->get($winduid, $f['forumsell']) < $forumset['sellprice'][$date]['cprice']) { $creditname = pwCreditNames($f['forumsell']); Showmsg('forumsell_price'); } $credit->addLog('main_forumsell', array($f['forumsell'] => -$forumset['sellprice'][$date]['cprice']), array('uid' => $winduid, 'username' => $windid, 'ip' => $onlineip, 'fname' => $forum[$fid]['name'], 'days' => $date)); $credit->set($winduid, $f['forumsell'], -$forumset['sellprice'][$date]['cprice']); $overdate = $timestamp + $date * 86400; $db->update("INSERT INTO pw_forumsell SET " . S::sqlSingle(array('fid' => $fid, 'uid' => $winduid, 'buydate' => $timestamp, 'overdate' => $overdate, 'credit' => $f['forumsell'], 'cost' => $forumset['sellprice'][$date]['cprice']), false)); refreshto("thread.php?fid={$fid}", 'operate_success'); }
} elseif ($order) { $sql = 'WHERE order_no=' . pwEscape($order); } !$sql && adminmsg('orderlist_none'); $rt = $db->get_one("SELECT c.*,m.username,m.groupid,m.groups FROM pw_clientorder c LEFT JOIN pw_members m USING(uid) {$sql}"); empty($rt) && adminmsg('orderlist_none'); if (empty($_POST['step'])) { $rt['fee'] = $rt['price'] * $rt['number']; $rt['date'] = get_date($rt['date']); $detail = ''; switch ($rt['type']) { case 0: $rmbrate = $db_creditpay[$rt['paycredit']]['rmbrate']; !$rmbrate && ($rmbrate = 10); $currency = round($rt['price'] * $rmbrate); $detail = getLangInfo('other', 'onlinepay_credit', array('cname' => pwCreditNames($rt['paycredit']), 'number' => $currency)); break; case 1: $tool = $db->get_one("SELECT name FROM pw_tools WHERE id=" . pwEscape($rt['paycredit'])); $detail = getLangInfo('other', 'onlinepay_tool', array('toolname' => $tool['name'], 'number' => $rt['number'])); break; case 2: $detail = getLangInfo('other', 'onlinepay_forum', array('fname' => $forum[$rt['paycredit']]['name'], 'number' => $rt['extra_1'])); break; case 3: $detail = getLangInfo('other', 'onlinepay_group', array('gname' => $ltitle[$rt['paycredit']], 'number' => $rt['number'])); break; case 4: $detail = getLangInfo('other', 'onlinepay_invite', array('number' => $rt['number'])); } include PrintEot('orderlist');
function getAttachConfig() { global $db_uploadfiletype, $db_sellset, $db_enhideset, $pwforum, $_G; $conf = array(); $conf['attachAllow'] = pwJsonEncode($db_uploadfiletype); $conf['imageAllow'] = pwJsonEncode(getAllowKeysFromArray($db_uploadfiletype, array('jpg', 'jpeg', 'gif', 'png', 'bmp'))); $sellCredit = $enhideCredit = array(); empty($db_sellset['type']) && ($db_sellset['type'] = array('money')); empty($db_enhideset['type']) && ($db_enhideset['type'] = array('rvrc')); foreach ($db_sellset['type'] as $key => $value) { $sellCredit[$value] = pwCreditNames($value); } foreach ($db_enhideset['type'] as $key => $value) { $enhideCredit[$value] = pwCreditNames($value); } list($conf['sellCredit'], $conf['enhideCredit']) = array(pwJsonEncode($sellCredit), pwJsonEncode($enhideCredit)); $conf['htmlsell'] = $pwforum->foruminfo['allowsell'] && $_G['allowsell'] ? '' : 'disabled'; $conf['htmlhide'] = $pwforum->forumset['allowencode'] && $_G['allowencode'] ? '' : 'disabled'; return $conf; }
function analyse(&$attach) { global $db_windpost, $db_sellset, $db_hash; $atype = ''; if ($attach['type'] == 'img' && $attach['needrvrc'] == 0 && $this->isImgShow) { $a_url = geturl($attach['attachurl'], 'show'); if (is_array($a_url)) { $atype = 'pic'; $attach += array('url' => $a_url[0], 'img' => cvpic($a_url[0] . '?' . $attach['size'], 1, $db_windpost['picwidth'], $db_windpost['picheight'], $attach['ifthumb'] & 1, $attach['descrip']), 'miniUrl' => attachShow::getMiniUrl($attach['attachurl'], $attach['ifthumb'], $a_url[1])); } elseif ($a_url == 'imgurl') { $atype = 'picurl'; $attach += array('verify' => md5("showimg{$attach[tid]}{$attach[pid]}{$attach[fid]}{$attach[aid]}{$db_hash}")); } } else { $atype = 'downattach'; if ($attach['needrvrc'] > 0) { !$attach['ctype'] && ($attach['ctype'] = $attach['special'] == 2 ? 'money' : 'rvrc'); if ($attach['type'] == 'img') { $a_url = geturl($attach['attachurl'], 'show'); $attach['img'] = cvpic($a_url[0] . '?' . $attach['size'], 1, $db_windpost['picwidth'], $db_windpost['picheight'], $attach['ifthumb'] & 1, $attach['descrip']); } if ($attach['special'] == 2) { $db_sellset['price'] > 0 && ($attach['needrvrc'] = min($attach['needrvrc'], $db_sellset['price'])); } } $attach += array('cname' => pwCreditNames($attach['ctype']), 'ext' => strtolower(substr(strrchr($attach['name'], '.'), 1))); } return $atype; }
function getPunchReward($reward) { global $credit, $winduid, $windid; $reward = S::isArray($reward) ? $reward : unserialize($reward); if (!$reward) { return array(false, ''); } !S::isObj($credit) && (require_once R_P . "require/credit.php"); $behaviorService = L::loadClass('behaviorservice', 'user'); list($continues) = $behaviorService->doBehavior($winduid, 'continue_punch', 0, true); $reward['step'] < 1 && ($reward['step'] = 1); $steps = $continues > 0 ? $continues - 1 : 0; $awardNum = $reward['min'] + $steps * $reward['step'] > $reward['max'] ? $reward['max'] : $reward['min'] + $steps * $reward['step']; $credit->addLog('other_finishpunch', array($reward['type'] => $awardNum), array('uid' => $winduid, 'username' => $windid, 'ip' => $GLOBALS['onlineip'])); $credit->set($winduid, $reward['type'], $awardNum); $unit = isset($credit->cUnit[$reward['type']]) ? $credit->cUnit[$reward['type']] : ''; return array(true, pwCreditNames($reward['type']) . '+' . $awardNum, $continues); }
function buildCountCategoryInfo($reward, $num = 1) { $reward = unserialize($reward); $category = $reward['category']; switch ($category) { case "credit": return "共获得 " . pwCreditNames($reward['type']) . " " . $reward['num'] * $num . " " . pwCreditUnits($reward['type']); break; case "tools": $tools = $this->getTools(); return "共获得道具 " . $tools[$reward['type']] . " " . $reward['num'] * $num . " 个"; break; case "medal": $medals = $this->getMedals(); return "共获得勋章 " . $medals[$reward['type']] . " 有效期 " . $reward['day'] * $num . " 天"; break; case "usergroup": list($result, $selects) = $this->getLevels(); return "成为 " . $selects[$reward['type']] . " 有效期 " . $reward['day'] * $num . " 天"; break; case "invitecode": return "共获得邀请注册码 " . $reward['num'] * $num . " 个"; break; default: return ""; break; } }
function getPingLogs($tid, $pingIdArr, $page = null) { if (empty($pingIdArr)) { return array(); } global $db, $fid; static $creditnames; is_array($creditnames) or $creditnames = pwCreditNames(); $pingIds = array(); $pingLogs = array(); if ($page) { $page = intval($page); if ($page < 1) { $page = 1; } } foreach ($pingIdArr as $pid => $markInfo) { list($count, $ids, $creditCount) = explode(":", $markInfo); $pingLogs[$pid]['count'] = $count; $pingLogs[$pid]['creditCount'] = $this->parseCreditCount($creditCount); $pingIds = array_merge($pingIds, explode(",", $ids)); $page && ($pingLogs[$pid]['pages'] = numofpage($count, $page, ceil($count / 10), "apps.php?q=ajax&a=pingpage&tid={$tid}&count={$count}&pid={$pid}&fid={$fid}&", null, 'ajaxPingcp')); } if (!count($pingIds) && !$page) { return array(); } $query = $this->db->query("SELECT a.*,b.uid FROM pw_pinglog a LEFT JOIN pw_members b ON a.pinger=b.username WHERE a.id IN (" . S::sqlImplode($pingIds) . ")"); while ($rt = $this->db->fetch_array($query)) { $rt['pid'] = $rt['pid'] ? $rt['pid'] : 'tpc'; list($rt['pingtime'], $rt['pingdate']) = getLastDate($rt['pingdate']); $rt['record'] = $rt['record'] ? $rt['record'] : "-"; if ($rt['point'] > 0) { $rt['point'] = "+" . $rt['point']; } //$tmp = showfacedesign($rt['icon'],true,'s'); //$rt['icon'] = $tmp[0]; isset($creditnames[$rt['name']]) && ($rt['name'] = $creditnames[$rt['name']]); $pingLogs[$rt['pid']]['data'][$rt['id']] = $rt; } foreach ($pingLogs as $pid => $data) { if (is_array($pingLogs[$pid]['data'])) { krsort($pingLogs[$pid]['data']); } } return $pingLogs; }
} if (is_numeric($winduid) && strlen($windpwd) >= 16) { $winddb = User_info(); list($winduid, $groupid, $userrvrc, $windid, $_datefm, $_timedf, $credit_pop) = array($winddb['uid'], $winddb['groupid'], floor($winddb['rvrc'] / 10), $winddb['username'], $winddb['datefm'], $winddb['timedf'], $winddb['creditpop']); if ($credit_pop && $db_ifcredit) { //Credit Changes Tips $credit_pop = str_replace(array('<', '"', '>'), array('<', '"', '>'), $credit_pop); list($tmpCreditPop, $creditOuterData) = array('', array()); $creditOuterData = explode(',', $credit_pop); foreach ($creditOuterData as $value) { $creditdb = explode('|', $value); $tmpCreditPop .= ($tmpCreditPop ? '<br/>' : '') . S::escapeChar(GetCreditLang('creditpop', $creditdb['0'])); unset($creditdb['0']); foreach ($creditdb as $val) { list($credit_1, $credit_2) = explode(':', $val); $tmpCreditPop .= '<span class="st2">' . pwCreditNames($credit_1) . ' <span class="f24">' . $credit_2 . '</span></span>'; } } $credit_pop = $tmpCreditPop; $userService = L::loadClass('UserService', 'user'); /* @var $userService PW_UserService */ $userService->update($winduid, array(), array('creditpop' => '')); } } $db_ifcredit && $credit_pop && (require PrintEot('credit_pop')); require_once PrintEot('read_addfloor'); // $output = ob_get_contents(); // $output = str_replace( // array("\r",'<!---->-->','<!--<!---->',"<!---->\n",'<!---->','<!-- -->',"<!--\n-->","\t\t",' ',"\n\t","\n\n","<!--","-->"), // array('','','','','','','','',"\n","\n","",""), // $output
} if (is_numeric($winduid) && strlen($windpwd) >= 16) { $winddb = User_info(); list($winduid, $groupid, $userrvrc, $windid, $_datefm, $_timedf, $credit_pop) = array($winddb['uid'], $winddb['groupid'], floor($winddb['rvrc'] / 10), $winddb['username'], $winddb['datefm'], $winddb['timedf'], $winddb['creditpop']); if ($credit_pop && $db_ifcredit) { //Credit Changes Tips $credit_pop = str_replace(array('<', '"', '>'), array('<', '"', '>'), $credit_pop); list($tmpCreditPop, $creditOuterData) = array('', array()); $creditOuterData = explode(',', $credit_pop); foreach ($creditOuterData as $value) { $creditdb = explode('|', $value); $tmpCreditPop .= ($tmpCreditPop ? '<br/>' : '') . S::escapeChar(GetCreditLang('creditpop', $creditdb['0'])); unset($creditdb['0']); foreach ($creditdb as $val) { list($credit_1, $credit_2) = explode(':', $val); $tmpCreditPop .= '<span class="w"><em class="mr5 b">' . pwCreditNames($credit_1) . '</em><span class="f20">' . $credit_2 . '</span></span>'; } } $credit_pop = $tmpCreditPop; $userService = L::loadClass('UserService', 'user'); /* @var $userService PW_UserService */ $userService->update($winduid, array(), array('creditpop' => '')); } list($winddb['style'], $ifcustomstyle) = explode('|', $winddb['style']); $skin = $winddb['style'] ? $winddb['style'] : $db_defaultstyle; list($winddb['onlineip']) = explode('|', $winddb['onlineip']); $groupid == '-1' && ($groupid = $winddb['memberid']); $winddb['lastpost'] < $tdtime && ($winddb['todaypost'] = 0); $curvalue = $db_signcurtype == 'rvrc' ? $userrvrc : $winddb[$db_signcurtype]; if (getstatus($winddb['userstatus'], PW_USERSTATUS_SHOWSIGN) && (!$winddb['starttime'] && $db_signmoney && strpos($db_signgroup, ",{$groupid},") !== false && $curvalue > $db_signmoney || $winddb['starttime'] && $winddb['starttime'] != $tdtime)) { require_once R_P . 'require/Signfunc.php';