function space_open($uid, $username, $gid = 0, $email = '') { global $_SGLOBAL, $_SCONFIG; if (empty($uid) || empty($username)) { return array(); } //验证空间是否被管理员删除 $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('spacelog') . " WHERE uid='{$uid}' AND flag='-1'"); if ($value = $_SGLOBAL['db']->fetch_array($query)) { showmessage('the_space_has_been_closed'); } $space = array('uid' => $uid, 'username' => $username, 'dateline' => $_SGLOBAL['timestamp'], 'groupid' => $gid); inserttable('space', $space, 0, true); inserttable('spacefield', array('uid' => $uid, 'email' => $email), 0, true); //发送PM if ($_SGLOBAL['supe_uid'] && $_SGLOBAL['supe_uid'] != $uid) { include_once S_ROOT . './uc_client/client.php'; uc_pm_send($_SGLOBAL['supe_uid'], $uid, cplang('space_open_subject'), cplang('space_open_message', array(getsiteurl())), 1, 0, 0); } //产生feed include_once S_ROOT . './source/function_cp.php'; $_uid = $_SGLOBAL['supe_uid']; $_username = $_SGLOBAL['supe_username']; $_SGLOBAL['supe_uid'] = $uid; $_SGLOBAL['supe_username'] = addslashes($username); feed_add('profile', cplang('feed_space_open')); $_SGLOBAL['supe_uid'] = $_uid; $_SGLOBAL['supe_username'] = $_username; return $space; }
function admincp_show_simple($setting) { global $_G, $lang, $medal; $medal['permission'] = is_array($medal['permission']) ? $medal['permission'] : unserialize($medal['permission']); $medal['usergroups'] = (array) $medal['permission']['usergroups']; $var = array(); $var['value'] = $medal['usergroups'] ? $medal['usergroups'] : $setting['usergroup']; $query = DB::query("SELECT type, groupid, grouptitle, radminid FROM " . DB::table('common_usergroup') . " ORDER BY (creditshigher<>'0' || creditslower<>'0'), creditslower, groupid"); $groupselect = array(); while ($group = DB::fetch($query)) { $group['type'] = $group['type'] == 'special' && $group['radminid'] ? 'specialadmin' : $group['type']; $groupselect[$group['type']] .= '<option value="' . $group['groupid'] . '"' . (@in_array($group['groupid'], $var['value']) ? ' selected' : '') . '>' . $group['grouptitle'] . '</option>'; } $var['type'] = '<select name="usergroup[]" size="10" multiple="multiple"><option value=""' . (@in_array('', $var['value']) ? ' selected' : '') . '>' . cplang('plugins_empty') . '</option>'; $var['type'] .= '<optgroup label="' . $lang['usergroups_member'] . '">' . $groupselect['member'] . '</optgroup>' . ($groupselect['special'] ? '<optgroup label="' . $lang['usergroups_special'] . '">' . $groupselect['special'] . '</optgroup>' : '') . ($groupselect['specialadmin'] ? '<optgroup label="' . $lang['usergroups_specialadmin'] . '">' . $groupselect['specialadmin'] . '</optgroup>' : '') . '<optgroup label="' . $lang['usergroups_system'] . '">' . $groupselect['system'] . '</optgroup></select>'; showsetting('用户组', '', '', $var['type'], '', '', '允许领取勋章的用户组,留空代表不限制'); }
function virtualdata_set() { global $head_url, $header_config; if (!submitcheck('submit')) { require_once libfile('function/forumlist'); $info = pick_common_get(); $info['vir_cache_time'] = $info['vir_cache_time'] ? $info['vir_cache_time'] : 10; $info['vir_data_forum'] = unserialize($info['vir_data_forum']); $info['vir_data_usergroup'] = unserialize($info['vir_data_usergroup']); $info['forumselect'] = '<select name="set[vir_data_forum][]" size="10" multiple="multiple"><option value="">' . cplang('plugins_empty') . '</option>' . forumselect(FALSE, 0, $info['vir_data_forum'], TRUE) . '</select>'; return $info; } else { $set = $_GET['set']; if (!$set['vir_data_forum'][0] && count($set['vir_data_forum']) == 1) { $set['vir_data_forum'] = ''; } pick_common_set($set); save_syscache('milu_pick_vir_postdata', ''); save_syscache('milu_pick_vir_data', ''); save_syscache('milu_pick_vir_online', ''); cpmsg(milu_lang('op_success'), PICK_GO . "virtual_data", 'succeed'); } }
//调用检查函数将@后的内容进行验证,为UID对应的姓名相同则返回@与姓名,不相同则继续判断下一个@,没有找到匹配的最终将返回false $ValidValue = getAtName($TmpString, $TmpName, $realname); $ValidValue = trim($ValidValue); $at_friend = "space.php?uid=" . $UserId; if ($ValidValue != false) { $Message = str_replace($ValidValue, "<a href={$at_friend}>@" . $realname . "</a> ", $Message); $UserIds[] = $UserId; } } } //Add by Add by am 2013-12-07 end $arr = array('tid' => intval($Commentid), "tagid" => intval($TagId), "uid" => intval($userid), "username" => getstr($username, 15, 1, 1, 1), "message" => getstr($Message, 5000, 1, 1, 1), "ip" => getonlineip(), 'dateline' => $_SGLOBAL['timestamp'], "isthread" => 0); $pid = inserttable('post', $arr, 1); //更新统计数据 $_SGLOBAL['db']->query("UPDATE " . tname('thread') . "\r\n\tSET replynum=replynum+1, lastpost='{$_SGLOBAL['timestamp']}', lastauthor='{$username}', lastauthorid='{$userid}'\r\n\tWHERE tid='{$Commentid}'"); //通知 $note = cplang('note_thread_reply') . " <a href=\"space.php?uid={$userid}&do=thread&id={$Commentid}&pid={$pid}\" target=\"_blank\">{$thread['subject']}</a>"; notification_add($userid, 'post', $note); //统计 updatestat('post'); if ($pid) { $arrs = array('flag' => 'success'); } else { $arrs = array('flag' => 'fail'); } } } $result = json_encode($arrs); $result = preg_replace("#\\\\u([0-9a-f]+)#ie", "iconv('UCS-2BE', 'UTF-8', pack('H4', '\\1'))", $result); echo $result; exit;
} else { $sharecount = 0; $query = DB::query("SELECT s.sid FROM " . DB::table('home_share') . " s WHERE 1 {$sql}"); while ($share = DB::fetch($query)) { $sids .= ',' . $share['sid']; $sharecount++; } $multi = ''; } if (!$sharecount) { $error = 'share_post_nonexistence'; } } showtagheader('div', 'postlist', $searchsubmit || $newlist); showformheader('share&frame=no', 'target="shareframe"'); showhiddenfields(array('sids' => authcode($sids, 'ENCODE'))); showtableheader(cplang('share_result') . ' ' . $sharecount . (empty($newlist) ? ' <a href="###" onclick="$(\'searchposts\').style.display=\'\';$(\'postlist\').style.display=\'none\';$(\'shareforum\').pp.value=\'\';$(\'shareforum\').page.value=\'\';" class="act lightlink normal">' . cplang('research') . '</a>' : ''), 'fixpadding'); if ($error) { echo "<tr><td class=\"lineheight\" colspan=\"15\">{$lang[$error]}</td></tr>"; } else { if ($detail) { showsubtitle(array('', 'author', 'share_title', 'share_body', 'share_type', 'time')); echo $shares; } } showsubmit('sharesubmit', 'delete', $detail ? 'del' : '', '', $multi); showtablefooter(); showformfooter(); echo '<iframe name="shareframe" style="display:none"></iframe>'; showtagfooter('div'); }
function emailcheck_send($uid, $email) { global $_SGLOBAL, $_SCONFIG; if($uid && $email) { $hash = authcode("$uid\t$email", 'ENCODE'); $url = getsiteurl().'do.php?ac=emailcheck&hash='.urlencode($hash); $mailsubject = cplang('active_email_subject'); $mailmessage = cplang('active_email_msg', array($url)); smail(0, $email, $mailsubject, $mailmessage); } }
function import_block($xmlurl, $clientid, $xmlkey = '', $signtype = '', $ignoreversion = 1, $update = 0) { global $_G, $importtxt; $_G['gp_importtype'] = $_G['gp_importtxt'] = ''; $xmlurl = strip_tags($xmlurl); $clientid = strip_tags($clientid); $xmlkey = strip_tags($xmlkey); $parse = parse_url($xmlurl); if (!empty($parse['host'])) { $queryarr = explode('&', $parse['query']); $para = array(); foreach ($queryarr as $value) { $k = $v = ''; list($k, $v) = explode('=', $value); if (!empty($k) && !empty($v)) { $para[$k] = $v; } } $para['clientid'] = $clientid; $para['op'] = 'getconfig'; $para['charset'] = CHARSET; $signurl = create_sign_url($para, $xmlkey, $signtype); $pos = strpos($xmlurl, '?'); $pos = $pos === false ? strlen($xmlurl) : $pos; $signurl = substr($xmlurl, 0, $pos) . '?' . $signurl; $importtxt = @dfsockopen($signurl); } else { $importtxt = @implode('', file($xmlurl)); } $blockarrays = getimportdata('Discuz! Block', 0); if (empty($blockarrays['name']) || empty($blockarrays['fields']) || empty($blockarrays['getsetting'])) { cpmsg(cplang('import_data_typeinvalid') . cplang($importtxt), '', 'error'); } if (empty($ignoreversion) && strip_tags($blockarrays['version']) != strip_tags($_G['setting']['version'])) { cpmsg(cplang('blockxml_import_version_invalid'), '', 'error', array('cur_version' => $blockarrays['version'], 'set_version' => $_G['setting']['version'])); } $data = array('name' => htmlspecialchars($blockarrays['name']), 'version' => htmlspecialchars($blockarrays['version']), 'url' => $xmlurl, 'clientid' => $clientid, 'key' => $xmlkey, 'signtype' => !empty($signtype) ? 'MD5' : '', 'data' => serialize($blockarrays)); $data = daddslashes($data); if (!$update) { DB::insert('common_block_xml', $data); } else { DB::update('common_block_xml', $data, "`id`='{$update}'"); } }
case 'album': $shareurl = "home.php?mod=space&uid={$share['fromuid']}&do=album&id={$share['itemid']}&modalbumkey={$share['modkey']}"; $sharetitle = lang('admincp', 'share_type_album'); break; case 'article': $shareurl = "portal.php?mod=view&aid={$share['itemid']}&modarticlekey={$share['modkey']}"; $sharetitle = lang('admincp', 'share_type_article'); break; } showtagheader('tbody', '', true, 'hover'); showtablerow("id=\"mod_{$share['sid']}_row1\"", array("id=\"mod_{$share['sid']}_row1_op\" rowspan=\"3\" class=\"rowform threadopt\" style=\"width:80px;\"", '', 'width="120"', 'width="120"', 'width="55"', 'width="55"'), array("<ul class=\"nofloat\"><li><input class=\"radio\" type=\"radio\" name=\"moderate[{$share['sid']}]\" id=\"mod_{$share['sid']}_1\" value=\"validate\" onclick=\"mod_setbg({$share['sid']}, 'validate');\"><label for=\"mod_{$share['sid']}_1\">{$lang['validate']}</label></li><li><input class=\"radio\" type=\"radio\" name=\"moderate[{$share['sid']}]\" id=\"mod_{$share['sid']}_2\" value=\"delete\" onclick=\"mod_setbg({$share['sid']}, 'delete');\"><label for=\"mod_{$share['sid']}_2\">{$lang['delete']}</label></li><li><input class=\"radio\" type=\"radio\" name=\"moderate[{$share['sid']}]\" id=\"mod_{$doing['doid']}_3\" value=\"ignore\" onclick=\"mod_setbg({$share['sid']}, 'ignore');\"><label for=\"mod_{$share['sid']}_3\">{$lang['ignore']}</label></li></ul>", "<h3><a href=\"javascript:;\" onclick=\"display_toggle({$share[sid]});\">{$short_desc} {$share_censor_text}</a></h3>", $sharetitle, "<p><a target=\"_blank\" href=\"" . ADMINSCRIPT . "?action=members&operation=search&uid={$share['uid']}&submit=yes\">{$share['username']}</a></p> <p>{$share['dateline']}</p>", "<a target=\"_blank\" href=\"{$shareurl}\">{$lang['view']}</a>")); showtablerow("id=\"mod_{$share['sid']}_row2\"", 'colspan="4" style="padding: 10px; line-height: 180%;"', '<div style="overflow: auto; overflow-x: hidden; max-height:120px; height:auto !important; height:100px; word-break: break-all;">' . $share['body_general'] . '</div>'); showtablerow("id=\"mod_{$share['sid']}_row3\"", 'class="threadopt threadtitle" colspan="4"', "<a href=\"?action=moderate&operation=shares&fast=1&sid={$share['sid']}&moderate[{$share['sid']}]=validate&page={$page}&frame=no\" target=\"fasthandle\">{$lang['validate']}</a> | <a href=\"?action=moderate&operation=shares&fast=1&sid={$share['sid']}&moderate[{$share['sid']}]=delete&page={$page}&frame=no\" target=\"fasthandle\">{$lang['delete']}</a> | <a href=\"?action=moderate&operation=shares&fast=1&sid={$share['sid']}&moderate[{$share['sid']}]=ignore&page={$page}&frame=no\" target=\"fasthandle\">{$lang['ignore']}</a>"); showtagfooter('tbody'); } showsubmit('modsubmit', 'submit', '', '<a href="#all" onclick="mod_setbg_all(\'validate\')">' . cplang('moderate_all_validate') . '</a> <a href="#all" onclick="mod_setbg_all(\'delete\')">' . cplang('moderate_all_delete') . '</a> <a href="#all" onclick="mod_setbg_all(\'ignore\')">' . cplang('moderate_all_ignore') . '</a> <a href="#all" onclick="mod_cancel_all();">' . cplang('moderate_all_cancel') . '</a>', $multipage, false); showtablefooter(); showformfooter(); } else { $moderation = array('validate' => array(), 'delete' => array(), 'ignore' => array()); $validates = $deletes = $ignores = 0; if (is_array($moderate)) { foreach ($moderate as $sid => $act) { $moderation[$act][] = $sid; } } if (!empty($moderation['validate'])) { require_once libfile('function/feed'); $validates = C::t('home_share')->update($moderation['validate'], array('status' => 0)); foreach (C::t('home_share')->fetch_all($moderation['validate']) as $share) { switch ($share['type']) {
function show_credit() { global $_SGLOBAL, $space; $showcredit = getcount('show', array('uid' => $space['uid']), 'credit'); if ($showcredit > 0) { if ($showcredit == 1) { //ᅬᅡᄚᅪ뛹 notification_add($space['uid'], 'show', cplang('note_show_out')); } $_SGLOBAL['db']->query("UPDATE " . tname('show') . " SET credit=credit-1 WHERE uid='{$space['uid']}' AND credit>0"); } }
} } $updo['id'] = intval($updo['id']); $updo['grade'] = intval($updo['grade']); $setarr = array('doid' => $updo['doid'], 'upid' => $updo['id'], 'uid' => $_SGLOBAL['supe_uid'], 'username' => $_SGLOBAL['supe_username'], 'dateline' => $_SGLOBAL['timestamp'], 'message' => $message, 'ip' => getonlineip(), 'grade' => $updo['grade'] + 1); //最多层级 if ($updo['grade'] >= 3) { $setarr['upid'] = $updo['upid']; //更母一个级别 } $newid = inserttable('docomment', $setarr, 1); //更新回复数 $_SGLOBAL['db']->query("UPDATE " . tname('doing') . " SET replynum=replynum+1 WHERE doid='{$updo['doid']}'"); //通知 if ($updo['uid'] != $_SGLOBAL['supe_uid']) { $note = cplang('note_doing_reply', array("space.php?do=doing&doid={$updo['doid']}&highlight={$newid}")); notification_add($updo['uid'], 'doing', $note); } $_POST['refer'] = preg_replace("/((\\#|\\&highlight|\\-highlight|\\.html).*?)\$/", '', $_POST['refer']); if (strexists($_POST['refer'], '?')) { $_POST['refer'] .= "&highlight={$newid}#dl{$updo[doid]}"; } else { $_POST['refer'] .= "-highlight-{$newid}.html#dl{$updo[doid]}"; } showmessage('do_success', $_POST['refer'], 0); } //删除 if ($_GET['op'] == 'delete') { if (submitcheck('deletesubmit')) { if ($id) { $allowmanage = checkperm('managedoing');
function searchgroups($submit) { global $_G; require_once libfile('function/group'); empty($_GET['selectgroupid']) && ($_GET['selectgroupid'] = array()); $groupselect = get_groupselect(0, $_GET['selectgroupid'], 0); $monthselect = $dayselect = $birthmonth = $birthday = ''; for ($m = 1; $m <= 12; $m++) { $m = sprintf("%02d", $m); $monthselect .= "<option value=\"{$m}\" " . ($birthmonth == $m ? 'selected' : '') . ">{$m}</option>\n"; } for ($d = 1; $d <= 31; $d++) { $d = sprintf("%02d", $d); $dayselect .= "<option value=\"{$d}\" " . ($birthday == $d ? 'selected' : '') . ">{$d}</option>\n"; } showtagheader('div', 'searchgroups', !$submit); echo '<script src="static/js/calendar.js" type="text/javascript"></script>'; showformheader("group&operation=manage"); showtableheader(); showsetting('groups_manage_name', 'srchname', $srchname, 'text'); showsetting('groups_manage_id', 'srchfid', $srchfid, 'text'); showsetting('groups_editgroup_category', '', '', '<select name="selectgroupid[]" multiple="multiple" size="10"><option value="all"' . (in_array('all', $_GET['selectgroupid']) ? ' selected' : '') . '>' . cplang('unlimited') . '</option>' . $groupselect . '</select>'); showsetting('groups_manage_membercount', array('memberlower', 'memberhigher'), array($_GET['memberlower'], $_GET['memberhigher']), 'range'); showsetting('groups_manage_threadcount', array('threadshigher', 'threadslower'), array($threadshigher, $threadslower), 'range'); showsetting('groups_manage_replycount', array('postshigher', 'postslower'), array($postshigher, $postslower), 'range'); showsetting('groups_manage_createtime', array('datelineafter', 'datelinebefore'), array($datelineafter, $datelinebefore), 'daterange'); showsetting('groups_manage_updatetime', array('lastupdateafter', 'lastupdatebefore'), array($lastupdateafter, $lastupdatebefore), 'daterange'); showsetting('groups_manage_founder', 'srchfounder', $srchfounder, 'text'); showsetting('groups_manage_founder_uid', 'srchfounderid', $srchfounderid, 'text'); showtagfooter('tbody'); showsubmit('submit'); showtablefooter(); showformfooter(); showtagfooter('div'); }
showtablerow('', array('class="vtop td24 lineheight"', 'class="lineheight team"'), array(cplang('home_dev_thanks'), '<a href="http://www.discuz.net/home.php?mod=space&uid=122246" class="lightlink2 smallfont" target="_blank">Heyond</a> <a href="http://www.discuz.net/home.php?mod=space&uid=632268" class="lightlink2 smallfont" target="_blank">JinboWang</a> <a href="http://www.discuz.net/home.php?mod=space&uid=15104" class="lightlink2 smallfont" target="_blank">Redstone</a> <a href="http://www.discuz.net/home.php?mod=space&uid=10407" class="lightlink2 smallfont" target="_blank">Qiang Liu</a> <a href="http://www.discuz.net/home.php?mod=space&uid=210272" class="lightlink2 smallfont" target="_blank">XiaoDunFang</a> <a href="http://www.discuz.net/home.php?mod=space&uid=86282" class="lightlink2 smallfont" target="_blank">Jianxieshui</a> <a href="http://www.discuz.net/home.php?mod=space&uid=9600" class="lightlink2 smallfont" target="_blank">Theoldmemory</a> <a href="http://www.discuz.net/home.php?mod=space&uid=2629" class="lightlink2 smallfont" target="_blank">Rain5017</a> <a href="http://www.discuz.net/home.php?mod=space&uid=26926" class="lightlink2 smallfont" target="_blank">Snow Wolf</a> <a href="http://www.discuz.net/home.php?mod=space&uid=17149" class="lightlink2 smallfont" target="_blank">Hehechuan</a> <a href="http://www.discuz.net/home.php?mod=space&uid=9132" class="lightlink2 smallfont" target="_blank">Pk0909</a> <a href="http://www.discuz.net/home.php?mod=space&uid=248" class="lightlink2 smallfont" target="_blank">feixin</a> <a href="http://www.discuz.net/home.php?mod=space&uid=675" class="lightlink2 smallfont" target="_blank">Laobing Jiuba</a> <a href="http://www.discuz.net/home.php?mod=space&uid=13877" class="lightlink2 smallfont" target="_blank">Artery</a> <a href="http://www.discuz.net/home.php?mod=space&uid=233" class="lightlink2 smallfont" target="_blank">Huli Hutu</a> <a href="http://www.discuz.net/home.php?mod=space&uid=122" class="lightlink2 smallfont" target="_blank">Lao Gui</a> <a href="http://www.discuz.net/home.php?mod=space&uid=159" class="lightlink2 smallfont" target="_blank">Tyc</a> <a href="http://www.discuz.net/home.php?mod=space&uid=177" class="lightlink2 smallfont" target="_blank">Stoneage</a> <a href="http://www.discuz.net/home.php?mod=space&uid=7155" class="lightlink2 smallfont" target="_blank">Gregry</a>')); /*vot*/ showtablerow('', array('class="vtop td24 lineheight"', 'class="lineheight"'), array('English version', '<a href="http://codersclub.org/discuzx/" class="lightlink2" target="_blank">Valery Votintsev at sources.ru</a>')); showtablerow('', array('class="vtop td24 lineheight"', 'class="lineheight"'), array(cplang('home_dev_links'), '<a href="http://www.comsenz.com" class="lightlink2" target="_blank">Website</a>, <a href="http://idc.comsenz.com" class="lightlink2" target="_blank">Web Hosting</a>, <a href="http://www.comsenz.com/category-51" class="lightlink2" target="_blank">Purchase</a>, <a href="http://www.discuz.com/" class="lightlink2" target="_blank">Discuz! Products</a>, <a href="http://www.comsenz.com/downloads/styles/discuz" class="lightlink2" target="_blank">Templates</a>, <a href="http://www.comsenz.com/downloads/plugins/discuz" class="lightlink2" target="_blank">Plugins</a>, <a href="http://faq.comsenz.com" class="lightlink2" target="_blank">Documentation</a>, <a href="http://www.discuz.net/" class="lightlink2" target="_blank">Forum</a>')); showtablefooter(); echo '</div>';
break; case 2: $order['orderstatus'] = '<b>' . $lang['ec_orders_search_status_auto_finished'] . '</b>'; break; case 3: $order['orderstatus'] = '<b>' . $lang['ec_orders_search_status_manual_finished'] . '</b><br />(<a href="home.php?mod=space&username='******'admin']) . '" target="_blank">' . $order['admin'] . '</a>)'; break; } $order['submitdate'] = dgmdate($order['submitdate']); $order['confirmdate'] = $order['confirmdate'] ? dgmdate($order['confirmdate']) : 'N/A'; list($orderid, $apitype) = explode("\t", $order['buyer']); $apitype = $apitype ? $apitype : 'alipay'; $orderid = '<a href="' . $orderurl[$apitype] . $orderid . '" target="_blank">' . $orderid . '</a>'; showtablerow('', '', array("<input class=\"checkbox\" type=\"checkbox\" name=\"validate[]\" value=\"{$order['orderid']}\" " . ($order['status'] != 1 ? 'disabled' : '') . ">", "{$order['orderid']}<br />{$orderid}", $order[orderstatus], "<a href=\"home.php?mod=space&uid={$order['uid']}\" target=\"_blank\">{$order['username']}</a>", "{$_G[setting][extcredits][$_G[setting][creditstrans]]['title']} {$order['amount']} {$_G[setting][extcredits][$_G[setting][creditstrans]]['unit']}", "{$lang['rmb']} {$order['price']} {$lang['rmb_yuan']}", $order[submitdate], $order[confirmdate])); } showsubmit('ordersubmit', 'submit', '<input type="checkbox" name="chkall" id="chkall" class="checkbox" onclick="checkAll(\'prefix\', this.form, \'validate\')" /><label for="chkall">' . cplang('ec_orders_validate') . '</label>', '<a href="#" onclick="$(\'orderlist\').style.display=\'none\';$(\'ordersearch\').style.display=\'\';">' . cplang('research') . '</a>', $multipage); showtablefooter(); showformfooter(); showtagfooter('div'); } } else { $numvalidate = 0; if ($_G['gp_validate']) { $orderids = $comma = ''; $confirmdate = dgmdate(TIMESTAMP); $query = DB::query("SELECT * FROM " . DB::table('forum_order') . " WHERE orderid IN ('" . implode('\',\'', $_G['gp_validate']) . "') AND status='1'"); while ($order = DB::fetch($query)) { updatemembercount($order['uid'], array($_G['setting']['creditstrans'] => $order['amount'])); $orderids .= "{$comma}'{$order['orderid']}'"; $comma = ','; $submitdate = dgmdate($order['submitdate']);
\tvar form = \$('cpform'); \tvar checkall = 'chkall'; \tfor(var i = 0; i < form.elements.length; i++) { \t\tvar e = form.elements[i]; \t\tif(e.type == 'radio') { \t\t\te.checked = ''; \t\t} \t} } </script> EOT; showformheader('moderate&operation=members&do=mod'); showtableheader('moderate_members', 'fixpadding'); showsubtitle(array('operation', 'members_edit_info', 'moderate_members_message', 'moderate_members_info', 'moderate_members_remark')); echo $members; showsubmit('modsubmit', 'submit', '', '<a href="#all" onclick="checkAll(\'option\', $(\'cpform\'), \'invalidate\');set_bg_all(\'invalidate\');">' . cplang('moderate_all_invalidate') . '</a> <a href="#all" onclick="checkAll(\'option\', $(\'cpform\'), \'validate\');set_bg_all(\'validate\');">' . cplang('moderate_all_validate') . '</a> <a href="#all" onclick="checkAll(\'option\', $(\'cpform\'), \'delete\');set_bg_all(\'delete\');">' . cplang('moderate_all_delete') . '</a> <a href="#all" onclick="checkAll(\'option\', $(\'cpform\'), \'ignore\');set_bg_all(\'ignore\');">' . cplang('moderate_all_ignore') . '</a> <a href="#all" onclick="cancelallcheck();set_bg_all(\'cancel\');">' . cplang('moderate_all_cancel') . '</a><input class="checkbox" type="checkbox" name="apply_all" id="chk_apply_all" value="1" disabled="disabled" />' . cplang('moderate_apply_all') . ' <input class="checkbox" type="checkbox" name="sendemail" id="sendemail" value="1" ' . $checksendemail . ' /><label for="sendemail"> ' . cplang('moderate_members_email') . '</label>', $multipage); showtablefooter(); showformfooter(); } else { $moderation = array('invalidate' => array(), 'validate' => array(), 'delete' => array(), 'ignore' => array()); $uids = array(); $uidsql = ''; if (!$_GET['apply_all']) { if (is_array($_GET['modtype'])) { foreach ($_GET['modtype'] as $uid => $act) { $uid = intval($uid); $uids[$uid] = $uid; $moderation[$act][$uid] = $uid; } $uidsql = 'v.uid IN (' . dimplode($uids) . ') AND'; }
$settings = array('mobilewechat' => serialize($setting)); C::t('common_setting')->update_batch($settings); } if (!submitcheck('settingsubmit')) { if ($setting['wsq_siteid']) { if (in_array('plugin', $_G['setting']['rewritestatus'])) { $url = $_G['siteurl'] . rewriteoutput('plugin', 1, 'wechat', 'access'); } else { $url = $_G['siteurl'] . 'plugin.php?id=wechat:access'; } } $apilisturl = ADMINSCRIPT . '?action=plugins&operation=config&do=' . $pluginid . '&identifier=wechat&pmod=wsq_setting&viewapi=yes'; $setting['wsq_siteurl'] = $setting['wsq_siteurl'] ? $setting['wsq_siteurl'] : $_G['siteurl']; $setting['wsq_sitename'] = $setting['wsq_sitename'] ? $setting['wsq_sitename'] : $_G['setting']['bbname']; require_once libfile('function/forumlist'); $forums = '<select name="setting[wsq_fid]"><option value="">' . cplang('plugins_empty') . '</option>' . forumselect(FALSE, 0, $setting['wsq_fid'], TRUE) . '</select>'; $sitelogo = $setting['wsq_sitelogo'] ? '<img src="' . $setting['wsq_sitelogo'] . '" width="150" />' : ''; $qrcode = $setting['wechat_qrcode'] ? '<img src="' . $_G['setting']['attachurl'] . 'common/' . $setting['wechat_qrcode'] . '" width="150" />' : ''; showtips(lang('plugin/wechat', 'wsq_tips', array('ADMINSCRIPT' => ADMINSCRIPT . '?action=', 'apiurl' => $apilisturl))); showformheader('plugins&operation=config&do=' . $pluginid . '&identifier=wechat&pmod=wsq_setting', 'enctype'); showtableheader(lang('plugin/wechat', 'wechat_wsq_setting') . ' ' . ($setting['wsq_status'] ? ' (' . lang('plugin/wechat', 'wsq_status_open') . ')' : ($setting['wsq_siteid'] ? ' (' . lang('plugin/wechat', 'wsq_status_ing') . (TIMESTAMP - $setting['wsq_lastrequest'] > 3600 ? ' <a href="' . ADMINSCRIPT . '?action=plugins&operation=config&do=' . $pluginid . '&identifier=wechat&pmod=wsq_setting&recheck=yes">[' . lang('plugin/wechat', 'wsq_status_try') . ']</a>)' : ')') : ' (' . lang('plugin/wechat', 'wsq_status_close') . ')'))); showsetting(lang('plugin/wechat', 'wsq_allow'), 'setting[wsq_allow]', $setting['wsq_allow'], 'radio', 0, 0, lang('plugin/wechat', 'wsq_allow_comment')); if ($setting['wsq_allow'] && $setting['wsq_siteid']) { showtablefooter(); showtableheader(); showsetting(lang('plugin/wechat', 'wsq_url'), '', '', '<span style="white-space:nowrap">' . $url . '</span>'); showtablefooter(); showtableheader(); showsetting(lang('plugin/wechat', 'wsq_siteid'), '', '', $setting['wsq_siteid']); showsetting(lang('plugin/wechat', 'wsq_sitetoken'), '', '', $setting['wsq_sitetoken']); }
function mtag_managemember($mtag, $uids, $newgrade) { global $_SGLOBAL; if(empty($uids)) return false; $managemtag = checkperm('managemtag'); //副吧主 if($mtag['grade'] < 9 && $newgrade >= 8 && !$managemtag) { showmessage('no_privilege'); } $newuids = array(); $query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('tagspace')." WHERE tagid='$mtag[tagid]' AND uid IN (".simplode($uids).")"); while ($value = $_SGLOBAL['db']->fetch_array($query)) { if($value['grade'] < 8 || ($mtag['grade'] == 9 && $value['uid'] != $_SGLOBAL['supe_uid']) || $managemtag) { $newuids[] = $value['uid']; } } if(empty($newuids)) { showmessage('mtag_managemember_no_privilege'); } //通知 $note_msg = cplang("note_members_grade_$newgrade", array($mtag['tagid'], $mtag['tagname'])); $inserts = $n_uids = array(); foreach ($newuids as $uid) { if($uid != $_SGLOBAL['supe_uid']) { $n_uids[] = $uid; $inserts[] = "('$uid', 'mtag', '1', '$_SGLOBAL[supe_uid]', '$_SGLOBAL[supe_username]', '".addslashes($note_msg)."', '$_SGLOBAL[timestamp]')"; } } if($n_uids) { $_SGLOBAL['db']->query("INSERT INTO ".tname('notification')." (`uid`, `type`, `new`, `authorid`, `author`, `note`, `dateline`) VALUES ".implode(',', $inserts)); $_SGLOBAL['db']->query("UPDATE ".tname('space')." SET notenum=notenum+1 WHERE uid IN (".simplode($n_uids).")"); } if($newgrade == -9) { mtag_out($mtag, $newuids);//踢人 } else { $_SGLOBAL['db']->query("UPDATE ".tname('tagspace')." SET grade='$newgrade' WHERE tagid='$mtag[tagid]' AND uid IN (".simplode($newuids).")"); } }
empty($_G['setting']['forumpicstyle']['thumbheight']) && ($_G['setting']['forumpicstyle']['thumbheight'] = 160); } else { $_G['setting']['forumpicstyle'] = array('thumbwidth' => 214, 'thumbheight' => 160); } require_once libfile('function/post'); $coversql = empty($allthread) ? 'AND cover=\'0\'' : ''; $cover = empty($allthread) ? 0 : null; $_G['forum']['ismoderator'] = 1; foreach (C::t('forum_thread')->fetch_all_by_fid_cover_lastpost($fid, $cover, $starttime, $endtime, $current, $pertask) as $thread) { $processed = 1; $pid = C::t('forum_post')->fetch_threadpost_by_tid_invisible($thread['tid'], 0); $pid = $pid['pid']; setthreadcover($pid); } if ($processed) { cpmsg("{$lang['counter_thread_cover']}: " . cplang('counter_processing', array('current' => $current, 'next' => $next)), $nextlink, 'loading'); } else { cpmsg('counter_thread_cover_succeed', 'action=counter', 'succeed'); } } else { shownav('tools', 'nav_updatecounters'); showsubmenu('nav_updatecounters'); showtips('counter_tips'); showformheader('counter'); showtableheader(); showsubtitle(array('', 'counter_amount')); showhiddenfields(array('pertask' => '')); showtablerow('', array('class="td21"'), array("{$lang['counter_forum']}:", '<input name="pertask1" type="text" class="txt" value="15" /><input type="submit" class="btn" name="forumsubmit" onclick="this.form.pertask.value=this.form.pertask1.value" value="' . $lang['submit'] . '" />')); showtablerow('', array('class="td21"'), array("{$lang['counter_digest']}:", '<input name="pertask2" type="text" class="txt" value="1000" /><input type="submit" class="btn" name="digestsubmit" onclick="this.form.pertask.value=this.form.pertask2.value" value="' . $lang['submit'] . '" />')); showtablerow('', array('class="td21"'), array("{$lang['counter_member']}:", '<input name="pertask3" type="text" class="txt" value="1000" /><input type="submit" class="btn" name="membersubmit" onclick="this.form.pertask.value=this.form.pertask3.value" value="' . $lang['submit'] . '" />')); showtablerow('', array('class="td21"'), array("{$lang['counter_thread']}:", '<input name="pertask4" type="text" class="txt" value="500" /><input type="submit" class="btn" name="threadsubmit" onclick="this.form.pertask.value=this.form.pertask4.value" value="' . $lang['submit'] . '" />'));
//事件发布 //加好友不发布事件 if (ckprivacy('friend', 1)) { $fs = array(); $fs['icon'] = 'friend'; $fs['title_template'] = cplang('feed_friend_title'); $fs['title_data'] = array('touser' => "<a href=\"space.php?uid={$tospace['uid']}\">" . $_SN[$tospace['uid']] . "</a>"); $fs['body_template'] = ''; $fs['body_data'] = array(); $fs['body_general'] = ''; feed_add($fs['icon'], $fs['title_template'], $fs['title_data'], $fs['body_template'], $fs['body_data'], $fs['body_general']); } //我的好友申请数进行变化 $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET addfriendnum=addfriendnum-1 WHERE uid='{$space['uid']}' AND addfriendnum>0"); //通知 notification_add($uid, 'friend', cplang('note_friend_add')); showmessage('friends_add', $_POST['refer'], 1, array($_SN[$tospace['uid']])); } else { $op = 'add2'; include_once template('cp_friend'); exit; } } } } elseif ($op == 'ignore') { //检测用户 if ($uid) { if (submitcheck('friendsubmit')) { //对方与我的关系 $fstatus = getfriendstatus($uid, $space['uid']); if ($fstatus == 1) {
function showportalprimaltemplate($pritplname, $type) { include_once libfile('function/portalcp'); $tpls = array('./template/default:portal/' . $type => getprimaltplname('portal/' . $type . '.htm')); foreach ($alltemplate = C::t('common_template')->range() as $template) { if ($dir = dir(DISCUZ_ROOT . $template['directory'] . '/portal/')) { while (false !== ($file = $dir->read())) { $file = strtolower($file); if (fileext($file) == 'htm' && substr($file, 0, strlen($type) + 1) == $type . '_') { $key = $template['directory'] . ':portal/' . str_replace('.htm', '', $file); $tpls[$key] = getprimaltplname($template['directory'] . ':portal/' . $file); } } } } foreach ($tpls as $key => $value) { echo "<input name=signs[{$type}][" . dsign($key) . "] value='1' type='hidden' />"; } $pritplvalue = ''; if (empty($pritplname)) { $pritplhide = ''; $pritplvalue = ' style="display:none;"'; } else { $pritplhide = ' style="display:none;"'; } $catetplselect = '<span' . $pritplhide . '><select id="' . $type . 'select" name="' . $type . 'primaltplname">'; $selectedvalue = ''; if ($type == 'view') { $catetplselect .= '<option value="">' . cplang('portalcategory_inheritupsetting') . '</option>'; } foreach ($tpls as $k => $v) { if ($pritplname === $k) { $selectedvalue = $k; $selected = ' selected'; } else { $selected = ''; } $catetplselect .= '<option value="' . $k . '"' . $selected . '>' . $v . '</option>'; } $pritplophide = !empty($pritplname) ? '' : ' style="display:none;"'; $catetplselect .= '</select> <a href="javascript:;"' . $pritplophide . ' onclick="$(\'' . $type . 'select\').value=\'' . $selectedvalue . '\';$(\'' . $type . 'select\').parentNode.style.display=\'none\';$(\'' . $type . 'value\').style.display=\'\';">' . cplang('cancel') . '</a></span>'; if (empty($pritplname)) { showsetting('portalcategory_' . $type . 'primaltplname', '', '', $catetplselect); } else { $tplname = getprimaltplname($pritplname . '.htm'); $html = '<span id="' . $type . 'value" ' . $pritplvalue . '> ' . $tplname . '<a href="javascript:;" onclick="$(\'' . $type . 'select\').parentNode.style.display=\'\';$(\'' . $type . 'value\').style.display=\'none\';"> ' . cplang('modify') . '</a></span>'; showsetting('portalcategory_' . $type . 'primaltplname', '', '', $catetplselect . $html); } }
showsubmenu('setting_domain', array(array('setting_domain_base', 'domain', $current['global']), array('setting_domain_app', 'domain&operation=app', $current['app']), array('setting_domain_root', 'domain&operation=root', $current['root']))); $navs = $_G['setting']['navs']; if ($operation == 'app') { if (!submitcheck('submit')) { $appkeyarr = array('portal' => $navs[1]['navname'], 'forum' => $navs[2]['navname'], 'group' => $navs[3]['navname'], 'home' => $navs[4]['navname'], 'mobile' => $lang['mobile'], 'default' => $lang['default']); showtips('setting_domain_app_tips'); showformheader('domain&operation=app'); showtableheader(); showsubtitle(array('name', 'setting_domain_app_domain')); $app = array(); $hiddenarr = array(); foreach ($appkeyarr as $key => $desc) { if (in_array($key, array('portal', 'group')) && !helper_access::check_module($key) || $key == 'home' && !helper_access::check_module('feed')) { $hiddenarr["appnew[{$key}]"] = ''; } else { showtablerow('', array('class="td25"', ''), array($desc, "<input type=\"text\" class=\"txt\" style=\"width:50%;\" name=\"appnew[{$key}]\" value=\"" . $_G['setting']['domain']['app'][$key] . "\">" . ($key == 'mobile' ? cplang('setting_domain_app_mobile_tips') : ''))); } } showsubmit('submit'); showtablefooter(); showhiddenfields($hiddenarr); showformfooter(); } else { $olddomain = $_G['setting']['domain']['app']; $_G['setting']['domain']['app'] = array(); $appset = false; foreach ($_GET['appnew'] as $appkey => $domain) { if (preg_match('/^((http|https|ftp):\\/\\/|\\.)|(\\/|\\.)$/i', $domain)) { cpmsg('setting_domain_http_error', '', 'error'); } if (!empty($domain) && in_array($domain, $_G['setting']['domain']['app'])) {
} elseif ($operation == 'split') { if (!$_G['setting']['bbclosed']) { cpmsg('postsplit_forum_must_be_closed', 'action=postsplit&operation=manage', 'error'); } $tableid = intval($_G['gp_tableid']); $tablename = getposttable($tableid); if ($tableid && $tablename != 'forum_post' || !$tableid) { $status = gettablestatus(DB::table($tablename), false); $allowsplit = false; if ($status && (!$tableid && $status['Data_length'] > 400 * 1048576 || $tableid && $status['Data_length'])) { if (!submitcheck('splitsubmit')) { showtips('postsplit_manage_tips'); showformheader('postsplit&operation=split&tableid=' . $tableid); showtableheader(); showsetting('postsplit_from', '', '', getposttable($tableid) . (!empty($posttable_info[$tableid]['memo']) ? '(' . $posttable_info[$tableid]['memo'] . ')' : '')); $tablelist = '<option value="-1">' . cplang('postsplit_create') . '</option>'; foreach ($posttable_info as $tid => $info) { if ($tableid != $tid) { $tablestatus = gettablestatus(DB::table(getposttable($tid))); $tablelist .= '<option value="' . $tid . '">' . ($info['memo'] ? $info['memo'] : 'forum_post' . ($tid ? '_' . $tid : '')) . '(' . $tablestatus['Data_length'] . ')' . '</option>'; } } showsetting('postsplit_to', '', '', '<select onchange="if(this.value >= 0) {$(\'tableinfo\').style.display = \'none\';} else {$(\'tableinfo\').style.display = \'\';}" name="targettable">' . $tablelist . '</select>'); showtagheader('tbody', 'tableinfo', true, 'sub'); showsetting('postsplit_manage_table_memo', "memo", '', 'text'); showtagfooter('tbody'); $datasize = round($status['Data_length'] / 1048576); $maxsize = round(($datasize - ($tableid ? 0 : 300)) / 100); $maxi = $maxsize > 10 ? 10 : ($maxsize < 1 ? 1 : $maxsize); for ($i = 1; $i <= $maxi; $i++) { $movesize = $i == 10 ? 1024 : $i * 100;
$graph[$ck] .= "<value xid='{$count}'>" . $num . "</value>"; } } } else { $graph[$type] .= "<value xid='{$count}'>" . $value[$type] . "</value>"; } $count++; } $xml = ''; $xml .= '<' . "?xml version=\"1.0\" encoding=\"utf-8\"?>"; $xml .= '<chart><xaxis>'; $xml .= $xaxis; $xml .= "</xaxis><graphs>"; $count = 0; foreach ($graph as $key => $value) { $xml .= "<graph gid='{$count}' title='" . siconv(cplang("do_stat_{$key}"), 'utf8') . "'>"; $xml .= $value; $xml .= '</graph>'; $count++; } $xml .= '</graphs></chart>'; @header("Expires: -1"); @header("Cache-Control: no-store, private, post-check=0, pre-check=0, max-age=0", FALSE); @header("Pragma: no-cache"); @header("Content-type: application/xml; charset=utf-8"); echo $xml; exit; } $siteurl = getsiteurl(); $statuspara = "path=&settings_file=data/stat_setting.xml&data_file=" . urlencode("do.php?ac=stat&xml=1&type={$type}"); $actives = array($type => ' style="font-weight:bold;"');
showformfooter(); } else { showsubtitle(array('block_name', 'block_script', 'block_style', 'block_dateline', 'block_page', 'operation')); $multipage = ''; $count = DB::result(DB::query("SELECT COUNT(*) FROM " . DB::table('common_block') . " b LEFT JOIN " . DB::table('common_template_block') . " tb ON tb.bid=b.bid WHERE {$wheresql}"), 0); if ($count) { $query = DB::query("SELECT b.*, tb.targettplname FROM " . DB::table('common_block') . " b LEFT JOIN " . DB::table('common_template_block') . " tb ON b.bid=tb.bid WHERE {$wheresql} {$ordersql} LIMIT {$start},{$perpage}"); while ($value = DB::fetch($query)) { if ($value['targettplname']) { $diyurl = block_getdiyurl($value['targettplname']); $diyurl = $diyurl['url']; $tplname = isset($_G['cache']['diytemplatename'][$value['targettplname']]) ? $_G['cache']['diytemplatename'][$value['targettplname']] : $value['targettplname']; $diypage[$value['bid']][$value['targettplname']] = $diyurl ? '<a href="' . $diyurl . '" target="_blank">' . $tplname . '</a>' : $tplname; } $list[$value['bid']] = $value; } if ($list) { foreach ($list as $bid => $value) { $inpage = empty($diypage[$bid]) ? cplang('block_page_unused') : implode('<br/>', $diypage[$bid]); $theclass = block_getclass($value['blockclass'], true); showtablerow('', '', array($value['name'] ? $value['name'] : cplang('block_name_null'), $theclass['script'][$value['script']], $value['styleid'] ? $theclass['style'][$value['styleid']]['name'] : lang('portalcp', 'blockstyle_diy'), !empty($value['dateline']) ? dgmdate($value['dateline']) : cplang('block_dateline_null'), $inpage, "<a href=\"portal.php?mod=portalcp&ac=block&op=block&bid={$value['bid']}&from=cp\" target=\"_blank\" onclick=\"showWindow('showblock',this.href);return false;\">" . cplang('block_setting') . "</a>  " . "<a href=\"portal.php?mod=portalcp&ac=block&op=data&bid={$value['bid']}&from=cp\" target=\"_blank\" onclick=\"showWindow('showblock',this.href);return false;\">" . cplang('block_data') . "</a>  " . $diyop . " <a href=\"" . ADMINSCRIPT . "?action=block&operation=perm&bid={$value['bid']}\">" . cplang('portalcategory_perm') . '</a>')); } } $multipage = multi($count, $perpage, $page, $mpurl); } showsubmit('', '', '', '<input type="submit" class="btn" name="clearsubmit" value="' . cplang('block_clear_unused') . '" />', $multipage); showtablefooter(); showformfooter(); } } }
function fetcharray($id, $name, $table, $conditions = '1') { $array = array(array(0, cplang('nolimit'))); $wheresql = $conditions ? " WHERE {$conditions}" : ''; $query = DB::query("SELECT {$id}, {$name} FROM " . DB::table($table) . $wheresql); while ($result = DB::fetch($query)) { $array[] = array($result[$id], $result[$name]); } return $array; }
function IHomeServiceVoteComplainOperation($params = NULL) { global $_SGLOBAL; if ($params['uid']) { if ($params['uid'] <= 0) { $errorMsg = array("errorNo" => "4002", "content" => "the format of parameter is not correct.the parameter uid must be a positive integer."); return json_encode($errorMsg); } else { $query = $_SGLOBAL['db']->query("select username,name from " . tname('space') . " where uid = " . $params['uid']); if ($row = $_SGLOBAL['db']->fetch_array($query)) { if ($row['name']) { $params['uname'] = $row['name']; } else { $params['uname'] = $row['username']; } } else { $errorMsg = array("errorNo" => "500", "content" => "the uid is not exist"); return json_encode($errorMsg); } } } else { $errorMsg = array("errorNo" => "4001", "content" => "lack the neccessary parameter.the parameter uid is not exist or is not a positive integer."); return json_encode($errorMsg); } if ($params['complainId']) { if ($params['complainId'] <= 0) { $errorMsg = array("errorNo" => "4002", "content" => "the format of parameter is not correct.the parameter complainId must be a positive integer."); return json_encode($errorMsg); } else { $query = $_SGLOBAL['db']->query("select uname from " . tname('complain') . " where doid = " . $params['complainId']); if ($row = $_SGLOBAL['db']->fetch_array($query)) { if (isblacklist($row['uid'])) { $errorMsg = array("errorNo" => "500", "content" => "the user of complain is in blacklist."); return json_encode($errorMsg); } } else { $errorMsg = array("errorNo" => "500", "content" => "the complain id is not exist"); return json_encode($errorMsg); } } } else { $errorMsg = array("errorNo" => "4001", "content" => "lack the neccessary parameter.the parameter complainId is not exist or is not a positive integer."); return json_encode($errorMsg); } if ($params['reply_id']) { if ($params['reply_id'] <= 0) { $errorMsg = array("errorNo" => "4002", "content" => "the format of parameter is not correct.the parameter reply_id must be a positive integer."); return json_encode($errorMsg); } else { $query = $_SGLOBAL['db']->query("select * from " . tname('complain_op') . " where id = " . $params['reply_id']); if (!($row = $_SGLOBAL['db']->fetch_array($query))) { $errorMsg = array("errorNo" => "4001", "content" => "the reply_id isn't exist."); return json_encode($errorMsg); } } } else { $errorMsg = array("errorNo" => "4001", "content" => "lack the neccessary parameter.the parameter reply_id is not exist or is not a positive integer."); return json_encode($errorMsg); } if (!$params['vote']) { $errorMsg = array("errorNo" => "4001", "content" => "lack the neccessary parameter.the parameter vote is not exist."); return json_encode($errorMsg); } else { if ($params['vote'] != 'up' & $params['vote'] != 'down') { $errorMsg = array("errorNo" => "4002", "content" => "the format of parameter is not correct.the parameter vote is our of range."); return json_encode($errorMsg); } } # check over $query = $_SGLOBAL['db']->query("select * from " . tname('complain') . " where doid=" . $params['complainId']); $complain = $_SGLOBAL['db']->fetch_array($query); # checked if ($params['vote'] == 'up') { $query = $_SGLOBAL['db']->query("select * from " . tname("complain_op_updown") . " where opid = " . $params['reply_id'] . " and uid = " . $params['uid']); $updown = $_SGLOBAL['db']->fetch_array($query); if (!empty($updown)) { if ($updown['uid'] == $complain['uid'] || $updown['updown'] == 2) { $errorMsg = array("errorNo" => "403", "content" => "updown again"); return json_encode($errorMsg); } $_SGLOBAL['db']->query("delete from " . tname("complain_op_updown") . " where opid = " . $params['reply_id'] . " and uid = " . $params['uid'] . " and updown = 1"); $_SGLOBAL['db']->query("update " . tname('complain_op') . " set upnum=upnum-1 where id=" . $params['reply_id']); $_SGLOBAL['db']->query("update " . tname('complain_dep') . " set upnum=upnum-1,updownnum=updownnum-1,score=score-1 where uid in (select uid from " . tname("complain_op") . " where id=" . $params['reply_id'] . ")"); } else { $downarr = array(); $downarr['opid'] = $params['reply_id']; $downarr['uid'] = $params['uid']; $downarr['updown'] = 1; $downarr['username'] = $params['uname']; $downarr['dateline'] = $_SGLOBAL['timestamp']; $_SGLOBAL['db']->query("update " . tname('complain_dep') . " set upnum=upnum+1,updownnum=updownnum+1,score=score+1 where uid in (select uid from " . tname("complain_op") . " where id= " . $params['reply_id'] . ")"); inserttable("complain_op_updown", $downarr); $_SGLOBAL['db']->query("update " . tname('complain_op') . " set upnum=upnum+1 where id=" . $params['reply_id']); $q = $_SGLOBAL['db']->query("select * from " . tname('complain') . " where uid=" . $params['uid'] . " and doid=" . $params['complainId'] . " and lastopid=" . $params['reply_id'] . " and status=1"); if ($r = $_SGLOBAL['db']->fetch_array($q)) { updatetable('complain', array('status' => 2), array('id' => $r['id'])); $oparr = array(); $oparr['doid'] = $params['complainId']; $oparr['message'] = ''; $oparr['uid'] = $params['uid']; $oparr['username'] = $params['uname']; $oparr['optype'] = 6; $oparr['dateline'] = $_SGLOBAL['timestamp']; $oparr['opvalue'] = 1; inserttable("complain_op", $oparr); } } } else { if ($params['vote'] == 'down') { $query = $_SGLOBAL['db']->query("select * from " . tname("complain_op_updown") . " where opid = " . $params['reply_id'] . " and uid = " . $params['uid']); $updown = $_SGLOBAL['db']->fetch_array($query); if (!empty($updown)) { if ($updown['uid'] == $complain['uid'] || $updown['updown'] == 1) { $errorMsg = array("errorNo" => "403", "content" => "updown again"); return json_encode($errorMsg); } $_SGLOBAL['db']->query("delete from " . tname("complain_op_updown") . " where opid = " . $params['reply_id'] . " and uid = " . $params['uid'] . " and updown = 2"); $_SGLOBAL['db']->query("update " . tname('complain_op') . " set downnum=downnum-1 where id=" . $params['reply_id']); $_SGLOBAL['db']->query("update " . tname('complain_dep') . " set downnum=downnum-1,updownnum=updownnum-1,score=score+1 where uid in (select uid from " . tname("complain_op") . " where id=" . $params['reply_id'] . ")"); } else { $downarr = array(); $downarr['opid'] = $params['reply_id']; $downarr['uid'] = $params['uid']; $downarr['updown'] = 2; $downarr['username'] = $params['uname']; $downarr['dateline'] = $_SGLOBAL['timestamp']; inserttable("complain_op_updown", $downarr); $_SGLOBAL['db']->query("update " . tname('complain_dep') . " set downnum=downnum+1,updownnum=updownnum+1,score=score-1 where uid in (select uid from " . tname("complain_op") . " where id=" . $params['reply_id'] . ")"); $_SGLOBAL['db']->query("update " . tname('complain_op') . " set downnum=downnum+1 where id=" . $params['reply_id']); $sql = "select * from " . tname('complain') . " where uid=" . $params['uid'] . " and doid=" . $params['complainId'] . " and lastopid=" . $params['reply_id'] . " and status=1"; $q = $_SGLOBAL['db']->query("select * from " . tname('complain') . " where uid=" . $params['uid'] . " and doid=" . $params['complainId'] . " and lastopid=" . $params['reply_id'] . " and status=1"); if ($r = $_SGLOBAL['db']->fetch_array($q)) { updatetable('complain', array('status' => 0, 'lastopid' => 0, 'dateline' => $_SGLOBAL['timestamp'], 'times' => 1, 'issendmsg' => 0), array('id' => $r['id'])); $note = cplang("complain_down", array("space.php?do=complain_item&doid={$complain['doid']}")); notification_complain_add($complain["atuid"], "complain", $note); $oparr = array(); $oparr['doid'] = $params['complainId']; $oparr['message'] = ''; $oparr['uid'] = $params['uid']; $oparr['username'] = $params['uname']; $oparr['optype'] = 5; $oparr['dateline'] = $_SGLOBAL['timestamp']; $oparr['opvalue'] = 1; inserttable("complain_op", $oparr); } } } } }
* * $Id: admincp_menu.php 32130 2012-11-14 09:20:40Z zhengqingpeng $ */ global $_G; if (!defined('IN_DISCUZ') || !defined('IN_ADMINCP')) { exit('Access Denied'); } $isfounder = isset($isfounder) ? $isfounder : isfounder(); $topmenu = $menu = array(); $topmenu = array('index' => '', 'global' => '', 'style' => '', 'topic' => '', 'user' => '', 'portal' => '', 'forum' => '', 'group' => '', 'extended' => '', 'plugin' => $isfounder ? 'plugins' : '', 'tools' => ''); $menu['index'] = array(array('menu_home', 'index'), array('menu_custommenu_manage', 'misc_custommenu')); $custommenu = get_custommenu(); $menu['index'] = array_merge($menu['index'], $custommenu); $menu['global'] = array(array('menu_setting_basic', 'setting_basic'), array('menu_setting_access', 'setting_access'), array('menu_setting_functions', 'setting_functions'), array('menu_setting_optimize', 'setting_cachethread'), array('menu_setting_seo', 'setting_seo'), array('menu_setting_domain', 'domain'), array('menu_setting_follow', 'setting_follow'), array('menu_setting_home', 'setting_home'), array('menu_setting_user', 'setting_permissions'), array('menu_setting_credits', 'setting_credits'), array('menu_setting_sec', 'setting_sec'), array('menu_setting_datetime', 'setting_datetime'), array('menu_setting_attachments', 'setting_attach'), array('menu_setting_imgwater', 'setting_imgwater'), array('menu_posting_attachtypes', 'misc_attachtype'), array('menu_setting_search', 'setting_search'), array('menu_setting_district', 'district'), array('menu_setting_ranklist', 'setting_ranklist'), array('menu_setting_mobile', 'setting_mobile'), array('menu_setting_antitheft', 'setting_antitheft')); $menu['style'] = array(array('menu_setting_customnav', 'nav'), array('menu_setting_styles', 'setting_styles'), array('menu_styles', 'styles'), $isfounder ? array('menu_styles_templates', 'templates') : null, array('menu_posting_smilies', 'smilies'), array('menu_click', 'click'), array('menu_thread_stamp', 'misc_stamp'), array('menu_posting_editor', 'setting_editor'), array('menu_misc_onlinelist', 'misc_onlinelist')); $menu['topic'] = array(array('menu_moderate_posts', 'moderate'), array('menu_posting_censors', 'misc_censor'), array('menu_maint_report', 'report'), array('menu_setting_tag', 'tag'), array('menu_setting_collection', 'collection'), array(cplang('nav_forum'), '', 1), array('menu_maint_threads', 'threads'), array('menu_maint_prune', 'prune'), array('menu_maint_attaches', 'attach'), array(cplang('nav_forum'), '', 2), array(cplang('nav_group'), '', 1), array('menu_maint_threads_group', 'threads_group'), array('menu_maint_prune_group', 'prune_group'), array('menu_maint_attaches_group', 'attach_group'), array(cplang('nav_group'), '', 2), array(cplang('thread'), '', 1), array('menu_moderate_recyclebin', 'recyclebin'), array('menu_moderate_recyclebinpost', 'recyclebinpost'), array('menu_threads_forumstick', 'threads_forumstick'), array('menu_postcomment', 'postcomment'), array(cplang('thread'), '', 2), array(cplang('nav_home'), '', 1), array('menu_maint_doing', 'doing'), array('menu_maint_blog', 'blog'), array('menu_maint_blog_recycle_bin', 'blogrecyclebin'), array('menu_maint_feed', 'feed'), array('menu_maint_album', 'album'), array('menu_maint_pic', 'pic'), array('menu_maint_comment', 'comment'), array('menu_maint_share', 'share'), array(cplang('nav_home'), '', 2)); $menu['user'] = array(array('menu_members_edit', 'members_search'), array('menu_members_add', 'members_add'), array('menu_members_profile', 'members_profile'), array('menu_members_stat', 'members_stat'), array('menu_members_newsletter', 'members_newsletter'), array('menu_members_mobile', 'members_newsletter_mobile'), array('menu_usertag', 'usertag'), array('menu_members_edit_ban_user', 'members_ban'), array('menu_members_ipban', 'members_ipban'), array('menu_members_credits', 'members_reward'), array('menu_moderate_modmembers', 'moderate_members'), array('menu_admingroups', 'admingroup'), array('menu_usergroups', 'usergroups'), array('menu_follow', 'specialuser_follow'), array('menu_defaultuser', 'specialuser_defaultuser'), array('members_verify_profile', 'verify_verify'), array('menu_members_verify_setting', 'verify')); if (is_array($_G['setting']['verify'])) { foreach ($_G['setting']['verify'] as $vid => $verify) { if ($vid != 7 && $verify['available']) { $menu['user'][] = array($verify['title'], "verify_verify_{$vid}"); } } } $menu['portal'] = array(array('menu_portalcategory', 'portalcategory'), array('menu_article', 'article'), array('menu_topic', 'topic'), array('menu_html', 'makehtml'), array('menu_diytemplate', 'diytemplate'), array('menu_block', 'block'), array('menu_blockstyle', 'blockstyle'), array('menu_blockxml', 'blockxml'), array('menu_portalpermission', 'portalpermission'), array('menu_blogcategory', 'blogcategory'), array('menu_albumcategory', 'albumcategory')); $menu['forum'] = array(array('menu_forums', 'forums'), array('menu_forums_merge', 'forums_merge'), array('menu_forums_infotypes', 'threadtypes'), array('menu_grid', 'grid')); $menu['group'] = array(array('menu_group_setting', 'group_setting'), array('menu_group_type', 'group_type'), array('menu_group_manage', 'group_manage'), array('menu_group_userperm', 'group_userperm'), array('menu_group_level', 'group_level'), array('menu_group_mod', 'group_mod')); $menu['extended'] = array(array('menu_misc_announce', 'announce'), array('menu_adv_custom', 'adv'), array('menu_tasks', 'tasks'), array('menu_magics', 'magics'), array('menu_medals', 'medals'), array('menu_misc_help', 'faq'), array('menu_ec', 'setting_ec'), array('menu_misc_link', 'misc_link'), array('memu_focus_topic', 'misc_focus'), array('menu_misc_relatedlink', 'misc_relatedlink'), array('menu_card', 'card')); if (file_exists($menudir = DISCUZ_ROOT . './source/admincp/menu')) { $adminextend = $adminextendnew = array(); if (file_exists($adminextendfile = DISCUZ_ROOT . './data/sysdata/cache_adminextend.php')) {
if (submitcheck('searchsubmit')) { $security = $secStatus && $security; if ($security) { $postlistcount = C::t('#security#security_evilpost')->count_by_search($posttableid, null, $keywords, -5, $inforum, null, $authors ? explode(',', str_replace(' ', '', $authors)) : null, strtotime($pstarttime), strtotime($pendtime)); } else { $postlistcount = C::t('forum_post')->count_by_search($posttableid, null, $keywords, -5, $inforum, null, $authors ? explode(',', str_replace(' ', '', $authors)) : null, strtotime($pstarttime), strtotime($pendtime)); } showtagheader('div', 'postlist', $searchsubmit); showformheader('recyclebinpost&operation=search&frame=no', 'target="rbframe"', 'rbform'); showtableheader(cplang('recyclebinpost_result') . ' ' . $postlistcount . ' <a href="#" onclick="$(\'postlist\').style.display=\'none\';$(\'postsearch\').style.display=\'\';" class="act lightlink normal">' . cplang('research') . '</a>', 'fixpadding'); if ($postlistcount && recyclebinpostshowpostlist($inforum, $authors, $pstarttime, $pendtime, $keywords, $start_limit, $lpp)) { $multi = multi($postlistcount, $lpp, $page, ADMINSCRIPT . "?action=recyclebinpost"); $multi = preg_replace("/href=\"" . ADMINSCRIPT . "\\?action=recyclebinpost&page=(\\d+)\"/", "href=\"javascript:page(\\1)\"", $multi); $multi = str_replace("window.location='" . ADMINSCRIPT . "?action=recyclebinpost&page='+this.value", "page(this.value)", $multi); } showsubmit('rbsubmit', 'submit', '', '<a href="#rb" onclick="checkAll(\'option\', $(\'rbform\'), \'delete\')">' . cplang('recyclebin_all_delete') . '</a> <a href="#rb" onclick="checkAll(\'option\', $(\'rbform\'), \'undelete\')">' . cplang('recyclebin_all_undelete') . '</a> <a href="#rb" onclick="checkAll(\'option\', $(\'rbform\'), \'ignore\')">' . cplang('recyclebin_all_ignore') . '</a> ', $multi); showtablefooter(); showformfooter(); echo '<iframe name="rbframe" style="display:none"></iframe>'; showtagfooter('div'); } } elseif ($operation == 'clean') { if (!submitcheck('cleanrbsubmit', 1)) { shownav('topic', 'nav_recyclebinpost'); showsubmenu('nav_recyclebinpost', array(array('recyclebinpost_list', 'recyclebinpost', 0), array('search', 'recyclebinpost&operation=search', 0), array('clean', 'recyclebinpost&operation=clean', 1))); showformheader('recyclebinpost&operation=clean'); showtableheader('recyclebinpost_clean'); showsetting('recyclebinpost_clean_days', 'days', '30', 'text'); showsubmit('cleanrbsubmit'); showtablefooter(); showformfooter();
} else { if ($ids = dimplode($_GET['delete'])) { C::t('common_admincp_cmenu')->delete($_GET['delete'], $_G['uid']); } if (is_array($_GET['titlenew'])) { foreach ($_GET['titlenew'] as $id => $title) { $_GET['urlnew'][$id] = rawurlencode($_GET['urlnew'][$id]); $title = dhtmlspecialchars($_GET['langnew'][$id] && cplang($_GET['langnew'][$id], false) ? $_GET['langnew'][$id] : $title); $ordernew = intval($_GET['displayordernew'][$id]); C::t('common_admincp_cmenu')->update($id, array('title' => $title, 'displayorder' => $ordernew, 'url' => dhtmlspecialchars($_GET['urlnew'][$id]))); } } if (is_array($_GET['newtitle'])) { foreach ($_GET['newtitle'] as $k => $v) { $_GET['urlnew'][$k] = rawurlencode($_GET['urlnew'][$k]); C::t('common_admincp_cmenu')->insert(array('title' => dhtmlspecialchars($v), 'displayorder' => intval($_GET['newdisplayorder'][$k]), 'url' => dhtmlspecialchars($_GET['newurl'][$k]), 'sort' => 1, 'uid' => $_G['uid'])); } } updatemenu('index'); cpmsg('custommenu_edit_succeed', 'action=misc&operation=custommenu', 'succeed'); } } elseif ($do == 'add') { if ($_GET['title'] && $_GET['url']) { admincustom($_GET['title'], dhtmlspecialchars($_GET['url']), 1); updatemenu('index'); cpmsg('custommenu_add_succeed', rawurldecode($_GET['url']), 'succeed', array('title' => cplang($_GET['title']))); } else { cpmsg('parameters_error', '', 'error'); } } }
} } else { $moderate = $_GET['moderate']; $moderation = array('delete' => array(), 'undelete' => array(), 'ignore' => array()); if (is_array($moderate)) { foreach ($moderate as $tid => $action) { $moderation[$action][] = intval($tid); } } require_once libfile('function/delete'); $threadsdel = deletethread($moderation['delete']); $threadsundel = undeletethreads($moderation['undelete']); if ($threadsdel || $threadsundel) { $cpmsg = cplang('recyclebin_succeed', array('threadsdel' => $threadsdel, 'threadsundel' => $threadsundel)); } else { $cpmsg = cplang('recyclebin_nothread'); } ?> <script type="text/JavaScript">alert('<?php echo $cpmsg; ?> ');parent.$('rbsearchform').searchsubmit.click();</script> <?php } } elseif ($operation == 'clean') { if (!submitcheck('rbsubmit', 1)) { shownav('topic', 'nav_recyclebin'); showsubmenu('nav_recyclebin', array(array('recyclebin_list', 'recyclebin', 0), array('search', 'recyclebin&operation=search', 0), array('clean', 'recyclebin&operation=clean', 1))); showformheader('recyclebin&operation=clean'); showtableheader('recyclebin_clean'); showsetting('recyclebin_clean_days', 'days', '30', 'text');
showsetting('adv_edit_style_image_url', 'advnewimage', $adv['parameters']['url'], 'filetext'); showsetting('adv_edit_style_image_link', 'advnew[image][link]', $adv['parameters']['link'], 'text'); showsetting('adv_edit_style_image_alt', 'advnew[image][alt]', $adv['parameters']['alt'], 'text'); if ($imagesizes) { $v = $adv['parameters']['width'] . 'x' . $adv['parameters']['height']; showsetting('adv_edit_style_image_size', '', '', '<select onchange="setsize(this.value, \'image\')"><option value="x">' . cplang('adv_edit_style_custom') . '</option>' . str_replace('"' . $v . '"', '"' . $v . '" selected="selected"', $imagesizes) . '</select>'); } showsetting('adv_edit_style_image_width', 'advnew[image][width]', $adv['parameters']['width'], 'text', '', 0, '', 'id="imagewidth" onchange="setpreview(\'image\')"'); showsetting('adv_edit_style_image_height', 'advnew[image][height]', $adv['parameters']['height'], 'text', '', 0, '', 'id="imageheight" onchange="setpreview(\'image\')"'); showtagfooter('tbody'); showtagheader('tbody', 'style_flash', $adv['parameters']['style'] == 'flash'); showtitle('adv_edit_style_flash'); showsetting('adv_edit_style_flash_url', 'advnewflash', $adv['parameters']['url'], 'filetext'); if ($imagesizes) { $v = $adv['parameters']['flash'] . 'x' . $adv['parameters']['flash']; showsetting('adv_edit_style_flash_size', '', '', '<select onchange="setsize(this.value, \'flash\')"><option>' . cplang('adv_edit_style_custom') . '</option>' . str_replace('"' . $v . '"', '"' . $v . '" selected="selected"', $imagesizes) . '</select>'); } showsetting('adv_edit_style_flash_width', 'advnew[flash][width]', $adv['parameters']['width'], 'text', '', 0, '', 'id="flashwidth" onchange="setpreview(\'flash\')"'); showsetting('adv_edit_style_flash_height', 'advnew[flash][height]', $adv['parameters']['height'], 'text', '', 0, '', 'id="flashheight" onchange="setpreview(\'flash\')"'); showtagfooter('tbody'); echo '<tr><td colspan="2">'; if ($operation == 'edit') { echo '<input id="previewbtn" type="button" class="btn" onclick="$(\'advpreview\').style.display=\'\';this.form.preview.value=1;this.form.target=\'preview\';this.form.submit();" name="jspreview" value="' . $lang['preview'] . '"> '; } echo '<input type="submit" class="btn" name="advsubmit" onclick="this.form.preview.value=0;this.form.target=\'\'" value="' . $lang['submit'] . '"><input name="preview" type="hidden" value="0"></td></tr>'; showtablefooter(); showtableheader(); echo '<tr><td colspan="2" id="imagesizepreviewtd" style="border:0"><div id="imagesizepreview" style="display:none;border:1px dotted gray"></div></td></tr>'; echo '<tr><td colspan="2" id="flashsizepreviewtd" style="border:0"><div id="flashsizepreview" style="display:none;border:1px dotted gray"></div></td></tr>'; showtablefooter(); showformfooter();