/** * @param unknown_type $output */ function ajaxExport($output) { echo is_array($output) ? stripslashes(pwJsonEncode($output)) : $output; ajax_footer(); }
} empty($subtype) && ($subtype = 'groupsms'); $normalUrl = $baseUrl . "?type={$subtype}"; !empty($winduid) && ($userId = $winduid); S::gp(array('smstype', 'page'), 'GP'); !$page && ($page = 1); $selected_all = $selected_self = $selected_other = ''; $selected_all = $action == '' || $action == 'all' ? 'selected' : ''; $selected_self = $action == 'self' ? 'selected' : ''; $selected_other = $action == 'other' ? 'selected' : ''; $groupsmsCount = $groupsmsAllCount = (int) $messageServer->countAllGroupMessage($userId); $notReadCount = (int) $messageServer->countGroupMessagesNotRead($userId); //editer $uploadfiletype = $db_uploadfiletype ? unserialize($db_uploadfiletype) : array(); $attachAllow = pwJsonEncode($uploadfiletype); $imageAllow = pwJsonEncode(getAllowKeysFromArray($uploadfiletype, array('jpg', 'jpeg', 'gif', 'png', 'bmp'))); if (empty($action) || $action == 'all') { $pageCount = ceil($groupsmsCount / $perpage); $page = validatePage($page, $pageCount); $groupsmsList = $messageServer->getAllGroupMessages($userId, $page, $perpage); $url = "{$normalUrl}&"; !$groupsmsCount && ($emptyListTip = "暂无任何群消息"); } elseif ($action == 'unread') { $groupsmsCount = $notReadCount; $pageCount = ceil($groupsmsCount / $perpage); $page = validatePage($page, $pageCount); $groupsmsList = $messageServer->getGroupMessagesNotRead($userId, $page, $perpage); $url = "{$normalUrl}&action=unread&"; $pages = numofpage($groupsmsCount, $page, $pageCount, $url); !$notReadCount && ($emptyListTip = "暂无任何未读群消息"); } elseif ($action == 'self') {
$pid = $db->get_value("SELECT MIN(b.pid) AS pid FROM pw_cnphoto a LEFT JOIN pw_cnphoto b ON a.aid=b.aid AND a.pid<b.pid WHERE a.pid=" . pwEscape($pid)); echo "ok\t{$pid}"; } ajax_footer(); } elseif ($a == 'pre') { define('AJAX', 1); InitGP(array('pid', 'aid'), null, 2); if ($aid) { $next_photo = $db->get_one("SELECT c.pid,c.path,c.ifthumb,m.groupid FROM pw_cnphoto c LEFT JOIN pw_members m ON c.uploader=m.username WHERE c.pid<" . pwEscape($pid) . " AND c.aid=" . pwEscape($aid) . " ORDER BY c.pid DESC"); if ($next_photo) { $next_photo['path'] = getphotourl($next_photo['path'], $next_photo['ifthumb']); if ($next_photo['groupid'] == 6 && $db_shield && $groupid != 3) { $next_photo['path'] = $pwModeImg . '/banuser.gif'; } unset($next_photo['ifthumb']); $pid = pwJsonEncode($next_photo); echo "ok\t{$pid}"; } else { echo "begin"; } } else { $pid = $db->get_value("SELECT MAX(b.pid) AS pid FROM pw_cnphoto a LEFT JOIN pw_cnphoto b ON a.aid=b.aid AND a.pid>b.pid WHERE a.pid=" . pwEscape($pid)); echo "ok\t{$pid}"; } ajax_footer(); } elseif ($a == 'editphoto') { banUser(); InitGP(array('pid'), null, 2); $photo = $db->get_one("SELECT p.aid,p.pintro,a.ownerid,p.path,a.lastphoto FROM pw_cnphoto p LEFT JOIN pw_cnalbum a ON p.aid=a.aid WHERE pid=" . pwEscape($pid)); if (empty($photo) || !$isGM && $photo['ownerid'] != $winduid) { Showmsg('data_error');
S::gp(array('ckey', 'advertype', 'adverstatus')); /*hold*/ $cates = $cateDescrip = array(); $optCates = ''; $query = $db->query("SELECT id,ckey,uid,ifshow,descrip,config FROM pw_advert WHERE type=0 AND ifshow=1 ORDER BY id"); while ($rt = $db->fetch_array($query)) { list($rt['name'], $rt['descrip']) = explode("~\t~", $rt['descrip']); $rt['ifhire'] = $rt['uid']; $rt['config'] = unserialize($rt['config']); $cates[$rt['ckey']] = $rt; $selected = $ckey == $rt['ckey'] ? "selected=selected" : ""; $optCates .= "<option value=\"{$rt['ckey']}\" {$selected}>{$rt['name']}</option>"; $cateDescrip[strtolower($rt['ckey'])] = addslashes($rt['descrip']); //$cateDescrip .= "'".addslashes(strtolower($rt['ckey']))."' : '".addslashes($rt['descrip'])."',"; } $cateDescrip = pwJsonEncode($cateDescrip); $adverClass = L::loadclass('adver', 'advertisement'); /*search*/ $adverTypeSelect = $adverClass->buildTypeSelect($advertype); $adverStatusSelect = $adverClass->buildStatusSelect($adverstatus); $ckeySelect = $adverClass->getAdverBenchSelect($ckey, 'ckey', 'ckey'); if (empty($job)) { S::gp(array('ckey', 'keyword', 'page')); $sql = ''; $ids = array(); $ckey && ($sql .= " AND ckey=" . S::sqlEscape($ckey)); $keyword && ($sql .= " AND descrip LIKE " . S::sqlEscape("%{$keyword}%")); in_array($advertype, array_keys($adverClass->getType())) && ($sql .= " AND config LIKE " . S::sqlEscape("%\"" . $advertype . "\";%")); in_array($adverstatus, array_keys($adverClass->getStatus())) && $adverstatus != '' && ($sql .= " AND ifshow=" . S::sqlEscape($adverstatus)); $count = $db->get_value("SELECT COUNT(*) FROM pw_advert WHERE type=1 {$sql}"); $page < 1 && ($page = 1);
/** * JSON处理 * * @return Ambigous <multitype:, string> */ function getMedalJson($medal) { $openMedalTemp = array(); foreach ($medal as $v) { $openMedalTemp[] = $v; } return pwJsonEncode($openMedalTemp); }
Showmsg('can_not_modify_field_type'); } $sql = getFieldSqlByType($fieldtype); $db->query("ALTER TABLE {$tablename} CHANGE {$fieldname} {$fieldname} {$sql}"); } $db->update("UPDATE pw_topicfield SET " . S::sqlSingle(array('name' => $name, 'type' => $fieldtype, 'rules' => $s_rules, 'descrip' => $descrip)) . " WHERE fieldid=" . S::sqlEscape($fieldid)); Showmsg('field_edit_success'); } } elseif ($action == 'showfield') { define('AJAX', 1); S::gp(array('currentmodelid')); $query = $db->query("SELECT fieldid,name FROM pw_topicfield WHERE modelid=" . S::sqlEscape($modelid)); while ($rt = $db->fetch_array($query)) { $fielddb[$rt['fieldid']] = $rt['name']; } $fielddb = pwJsonEncode($fielddb); echo "success\t{$fielddb}"; ajax_footer(); } elseif ($action == 'copyfield') { define('AJAX', 1); S::gp(array('copyfield')); if (empty($copyfield) || !is_array($copyfield)) { adminmsg('topiccate_copyfield_none'); } $query = $db->query("SELECT name,type,rules,descrip FROM pw_topicfield WHERE fieldid IN (" . S::sqlImplode($copyfield) . ")"); while ($rt = $db->fetch_array($query)) { $name = $db->get_value("SELECT name FROM pw_topicfield WHERE modelid=" . S::sqlEscape($modelid)); $db->update("INSERT INTO pw_topicfield SET " . S::sqlSingle(array('name' => $rt['name'], 'fieldname' => $rt['fieldname'], 'modelid' => $modelid, 'type' => $rt['type'], 'rules' => $rt['rules'], 'descrip' => $rt['descrip'])), false); $fieldid = $db->insert_id(); $fieldname = 'field' . $fieldid; $tablename = GetTopcitable($modelid);
!defined('P_W') && exit('Forbidden'); define('AJAX', 1); $output = array(); S::gp(array('key'), 'GP'); PostCheck(); $key = pwConvert(urldecode($key), $db_charset, 'utf8'); if (!$winduid || !$key || strlen($key) > 15) { $output['status'] = 0; echo pwJsonEncode($output); exit; } $attentionService = L::loadClass('Attention', 'friend'); /* @var $attentionService PW_Attention */ $friends = $attentionService->getUidsInFollowList($winduid, 1, 500); if (S::isArray($friends)) { $userService = L::loadClass('userservice', 'user'); $usernames = $userService->getUserNamesByUserIds($friends); foreach ($usernames as $k => $v) { if (strpos($v, $key) !== 0) { unset($usernames[$k]); } } $output['status'] = 1; foreach ((array) $usernames as $k => $v) { $output['users'][] = array('uid' => $k, 'uname' => $v); } } else { $output['status'] = 0; } echo pwJsonEncode($output);
break; case 'invcode': $return = $registerCheckService->checkInvcode($value[2]); break; case 'customerfield': list($fieldname, $v) = explode('|', $value[2]); $v = S::escapeChar(urldecode($v)); $return = $registerCheckService->checkCustomerField($fieldname, $v); break; } $return && ($returnArray[$value[0]] = $return); } if (!S::isArray($returnArray)) { echo 'success'; } else { echo pwJsonEncode($returnArray); } } ajax_footer(); } elseif (S::getGP('action', 'P') == 'pay') { //* include_once pwCache::getPath(D_P."data/bbscache/inv_config.php"); //* include_once pwCache::getPath(D_P.'data/bbscache/ol_config.php'); pwCache::getData(D_P . "data/bbscache/inv_config.php"); pwCache::getData(D_P . 'data/bbscache/ol_config.php'); if ($_POST['step'] == '3') { S::gp(array('invnum', 'email')); if (!is_numeric($invnum) || $invnum < 1) { $invnum = 1; } $order_no = str_pad('0', 10, "0", STR_PAD_LEFT) . get_date($timestamp, 'YmdHis') . num_rand(5); $rt = array();
define('AJAX', 1); $pushdataService->deletePushdata($id); echo getLangInfo('msg', 'operate_success') . "\treload"; ajax_footer(); } elseif ($action == 'verify') { S::gp(array('id'), '', 2); define('AJAX', 1); $pushdataService->verifyPushdata($id); echo getLangInfo('msg', 'operate_success') . "\treload"; ajax_footer(); } elseif ($action == 'channelchange') { S::gp(array('alias', 'ifverify')); define('AJAX', 1); $portalPageService = L::loadClass('portalpageservice', 'area'); $invokes = $portalPageService->getPageInvokesForSelect($alias, $ifverify); echo pwJsonEncode($invokes); ajax_footer(); } elseif ($action == 'verifys') { S::gp(array('selid'), '', 2); if (!S::isArray($selid)) { Showmsg('ÇëÑ¡ÔñÒªÉóºËµÄÍÆËÍÄÚÈÝ'); } foreach ($selid as $value) { $value = (int) $value; if (!$value) { continue; } $pushdataService->verifyPushdata($value); } adminmsg('operate_success'); }
if ($image_type == 1) { L::loadClass('stopicupload', 'upload', false); $imgUrl = stopicUploadImg(0); if ($imgUrl !== false) { $banner_image = $imgUrl; } } $block_data = array('image' => $banner_image, 'title' => $banner_title, 'title_left' => $postion_left, 'title_top' => $postion_top, 'title_style' => $font_style, 'title_size' => $font_size, 'title_color' => $font_color); } elseif ('spclTpc' == $block_type) { S::gp(array('tid', 'height'), null, 2); $block_data = array('tid' => $tid, 'height' => $height); } stopic_stripslashes($block_data); $stopic_service->updateUnitByFild($stopic_id, $block_id, array('title' => $block_title, 'data' => $block_data)); $result = array('title' => stripslashes($block_title), 'content' => $block_type == 'comment' ? '' : $stopic_service->getHtmlData($block_data, $block_type, $block_id)); $result = pwJsonEncode($result); $result = stripslashes($result); echo "success\t" . $result; ajax_footer(); } function stopic_stripslashes(&$array) { if (is_array($array)) { foreach ($array as $key => $value) { if (is_array($value)) { stopic_stripslashes($array[$key]); } else { $array[$key] = stripslashes($value); } } }
} else { echo 'error'; } } elseif ($job == 'listphotos') { S::gp(array('aid')); if ($photos = getPhotoList($photoService, $aid)) { echo "success\t" . pwJsonEncode($photos); } else { echo 'error'; } } else { $albums = getAlbumList($photoService); if ($albums) { $aid = $albums[0][0]; $photos = getPhotoList($photoService, $aid); echo "success\t" . pwJsonEncode($albums) . "\t" . pwJsonEncode($photos); } else { echo 'error'; } } exit; function getAlbumList($sv) { $sv->setPerpage($sv->getAlbumNumByUid()); $result = $sv->getAlbumBrowseList(); list(, $albums) = $result; $array = array(); if ($albums) { foreach ($albums as $key => $value) { $array[] = array($value['aid'], $value['aname']); }
/** * 输出消息 * @return unknown_type */ function toString() { return pwJsonEncode($this->msg); }
<?php !defined('P_W') && exit('Forbidden'); S::gp(array('u'), 'P', 2); if (!$u) { Showmsg('undefined_action'); } if ($u != $winduid) { Showmsg('undefined_action'); } $msgdb = array(); $messageServer = L::loadClass("message", 'message'); $temp = array(); $msgdb = $messageServer->getAllNotRead($winduid, 1, 10); foreach ($msgdb as $value) { $type = $messageServer->getReverseConst(substr($value['typeid'], 0, 1)); $temp[] = array('fromuid' => $value['uid'], 'from' => $value['username'], 'title' => substrs($value['title'], 30), 'rid' => $value['rid'], 'mid' => $value['mid'], 'typeid' => $value['typeid'], 'type' => $type); } $str = ''; if ($temp) { $str = stripcslashes(pwJsonEncode($temp)); } echo "success\t{$str}"; ajax_footer();
S::gp(array('fid', 'tid', 'pid', 'pingid'), null, 2); //权限 $foruminfo = $db->get_one('SELECT * FROM pw_forums f LEFT JOIN pw_forumsextra fe USING(fid) WHERE f.fid=' . S::sqlEscape($fid)); !$foruminfo && Showmsg('data_error'); $isGM = $isBM = $admincheck = 0; if ($groupid != 'guest') { $isGM = S::inArray($windid, $manager); $isBM = admincheck($foruminfo['forumadmin'], $foruminfo['fupadmin'], $windid); $admincheck = $isGM || $isBM ? 1 : 0; } $pingdata = $db->get_one("SELECT * FROM pw_pinglog WHERE id=" . S::sqlEscape($pingid)); !$pingdata && Showmsg('data_error'); !($admincheck || $_G['markable'] && $pingdata['pinger'] == $windid) && Showmsg('data_error'); //$db->update("UPDATE pw_pinglog SET ifhide=1 WHERE id=" . S::sqlEscape($pingid) . " LIMIT 1"); pwQuery::update('pw_pinglog', 'id=:id LIMIT 1', array($pingid), array('ifhide' => 1)); if ($db->affected_rows()) { $pingService = L::loadClass("ping", 'forum'); $pingTotal = $pingService->getPingLogAll($tid, $pid); $pingTotal = pwJsonEncode($pingTotal); echo "success\t{$pingTotal}"; $pingService->update_markinfo($tid, $pid); # memcache reflesh if ($db_memcache) { //* $threads = L::loadClass('Threads', 'forum'); //* $threads->delThreads($tid); Perf::gatherInfo('changeThreadWithThreadIds', array('tid' => $tid)); } } else { echo "data_error"; } ajax_footer();
function initFileTypeInfo($db_uploadfiletype) { $uploadfiletype = $db_uploadfiletype ? unserialize($db_uploadfiletype) : array(); $attachAllow = pwJsonEncode($uploadfiletype); $imageAllow = pwJsonEncode(getAllowKeysFromArray($uploadfiletype, array('jpg', 'jpeg', 'gif', 'png', 'bmp'))); return array($attachAllow, $imageAllow); }
} $maxTopped = $db->get_value("SELECT MAX(topped) FROM pw_threads WHERE tid IN(" . S::sqlImplode($selids) . ")"); $maxTopped == 4 && ($isKmd = true); } list($catedbs, $top_1, $top_2, $top_3) = getForumListForHeadTopic($fid); if ($top_1) { $top_1_index = pwJsonEncode(array_keys($top_1)); $top_1 = pwJsonEncode($top_1); } if ($top_2) { $top_2_index = pwJsonEncode(array_keys($top_2)); $top_2 = pwJsonEncode($top_2); } if ($top_3) { $top_3_index = pwJsonEncode(array_keys($top_3)); $top_3 = pwJsonEncode($top_3); } require_once PrintEot($template); footer(); } else { PostCheck(); S::gp(array('topped', 'ifmsg', 'timelimit', 'nextto', 'selForums', 'defaultSelForums')); is_null($topped) && Showmsg('请选择置顶操作管理选项'); $topped = intval($topped); $pwTopped = $isGM ? '3' : pwRights($isBM, 'topped'); if ($topped > $pwTopped) { Showmsg('masigle_top'); } empty($selForums) && ($selForums = explode(',', trim($defaultSelForums, ','))); if (empty($selForums)) { Showmsg('masigle_top_error');
function buildTucoolAttachs($tucoolAttachs) { global $isGM; if (!S::isArray($tucoolAttachs)) { return array(); } $attachs = array(); $countNum = count((array) $tucoolAttachs); $i = 1; foreach ((array) $tucoolAttachs as $v) { $v['dfadmin'] = $GLOBALS['attachShow']->isAdmin; if ($v['type'] != 'img' || $v['needrvrc'] > 0 && $GLOBALS['attachShow']->viewHiddenAtt($v) !== true) { continue; } $v['position'] = '[' . $i . '/' . $countNum . ']'; $v['json'] = pwJsonEncode($v); $attachs[$v[aid]] = $v; $i++; } return $attachs; }
$userAllCredits['c' . $key] = array($winddb[$key] ? $key == 'rvrc' ? $winddb[$key] / 10 : $winddb[$key] : $customCreditValue[$key], $value, $credit->cUnit[$key]); } $alltype .= "<option value=\"{$key}\">" . $value . "</option>"; } $userAllCredits && ($userAllCredits = pwJsonEncode($userAllCredits)); foreach ($db_sellset['type'] as $key => $value) { $selltype .= "<option value=\"{$value}\">" . $credit->cType[$value] . "</option>"; $sellCredit[$value] = $credit->cType[$value]; } if (is_array($db_enhideset['type'])) { foreach ($db_enhideset['type'] as $key => $value) { $enhidetype .= "<option value=\"{$value}\">" . $credit->cType[$value] . "</option>"; $enhideCredit[$value] = $credit->cType[$value]; } } list($sellCredit, $enhideCredit) = array(pwJsonEncode($sellCredit), pwJsonEncode($enhideCredit)); require_once R_P . 'require/showimg.php'; list($postFaceUrl) = showfacedesign($winddb['icon'], 1, 'm'); $icondb = array(); if ($db_threademotion) { $emotion = @opendir(S::escapeDir("{$imgdir}/post/emotion")); while (($emotionimg = @readdir($emotion)) !== false) { if ($emotionimg != "." && $emotionimg != ".." && $emotionimg != "" && preg_match("/^(\\d+)\\.(gif|jpg|png|bmp)\$/i", $emotionimg, $emotionMatch)) { $icondb[$emotionMatch[1]] = $emotionimg; } } ksort($icondb); @closedir($emotion); } //multiple post types 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'])) {
function ajaxExport($output) { echo is_array($output) ? pwJsonEncode($output) : $output; ajax_footer(); exit; }
ajax_footer(); } elseif ($a == 'showftlist') { S::gp(array('u'), 'P', 2); if (!$u) { Showmsg('undefined_action'); } if ($u != $winduid) { Showmsg('undefined_action'); } $query = $db->query("SELECT * FROM pw_friendtype WHERE uid=" . S::sqlEscape($u) . " ORDER BY ftid"); $types = array(); while ($rt = $db->fetch_array($query)) { $types[] = $rt; } if (count($types)) { $str = pwJsonEncode($types); } else { $str = ''; } echo "success\t{$str}"; ajax_footer(); } elseif ($a == 'setfriendtype') { S::gp(array('friendid', 'ftid'), 'P', 2); !$ftid && ($ftid = 0); if (!$friendid) { Showmsg('undefined_action'); } $db->update("UPDATE pw_friends SET ftid=" . S::sqlEscape($ftid) . " WHERE uid=" . S::sqlEscape($winduid) . " AND friendid=" . S::sqlEscape($friendid)); echo "success"; ajax_footer(); } elseif ($a == 'delcollecttype') {
/** * @desc 显示经过Json处理过的提示信息并跳转 * * @param string $msg -- 提示 * @param string $jumpurl -- 跳转到URL */ function scanmsg($msg, $jumpurl = '') { $msg = getLangInfo('cpmsg', $msg); $show = <<<EOT \t{$msg} EOT; echo pwJsonEncode(array('msg' => $show, 'url' => $jumpurl)); ajax_footer(); }
$t_exits = 0; $t_typedb = $t_subtypedb = array(); if ($t_db) { foreach ($t_db as $value) { if ($value['upid'] == 0) { $t_typedb[$value['id']] = $value; } else { $value['id'] == $type && ($pwSelectType = $value['upid']); $t_subtypedb[$value['upid']][$value['id']] = $value['name']; } $t_exits = 1; } } $t_childtypedb = $t_subtypedb; if ($t_subtypedb) { $t_subtypedb = pwJsonEncode($t_subtypedb); $t_sub_exits = 1; } if ($t_db[$type]['upid']) { $t_child = $t_childtypedb[$t_db[$type]['upid']]; } else { $t_child = $t_childtypedb[$type]; } $db_forcetype = $t_exits && $t_per == '2' ? 1 : 0; // 是否需要强制主题分类 $db_maxtypenum == 0 && ($db_maxtypenum = 5); //$db_menuinit .= ",'td_post' : 'menu_post','td_post1' : 'menu_post','td_special' : 'menu_special'"; $db_menuinit .= ",'td_special' : 'menu_special'"; if ($winddb['shortcut']) { $myshortcut = 'true'; } else {
$typedb[$rt['id']] = $rt; } else { $subtypedb[$rt['id']] = $rt; } $t_typedbnum++; } //分类主题类型 $topicdb = array(); @(include_once D_P . 'data/bbscache/topic_config.php'); foreach ($topiccatedb as $key => $value) { if ($value['ifable'] == 1) { $topicdb[$key]['cateid'] = $value['cateid']; $topicdb[$key]['name'] = $value['name']; } } $jsoncateids = pwJsonEncode($topicdb); //分类模型 foreach ($topicmodeldb as $key => $value) { if ($value['ifable'] == 1) { $modeldb[$value['cateid']][$key]['cateid'] = $value['cateid']; $modeldb[$value['cateid']][$key]['modelid'] = $value['modelid']; $modeldb[$value['cateid']][$key]['name'] = $value['name']; } } !$allowtype && ($posttypestyle = 'style="display:none"'); !$modelid && ($topiccatestyle = 'style="display:none"'); !$pcid && ($postcatestyle = 'style="display:none"'); //团购活动 @(include_once D_P . 'data/bbscache/postcate_config.php'); } $ajaxurl = EncodeUrl($basename);
<?php !defined('P_W') && exit('Forbidden'); define('AJAX', '1'); S::gp(array('type')); if ($type == 'showcard') { S::gp(array('uid', 'username')); $uid = intval($uid); $cardInfo = getCardData($uid, $winduid, $username); $cardInfo['status'] = S::isArray($cardInfo) ? 'success' : 'fail'; echo pwJsonEncode($cardInfo); ajax_footer(); } /** * 组装小名片数据 * * @param int $uid 用户ID * @param int $winduid 当前用户id * @param bool $username 用户名 * @return array */ function getCardData($uid, $winduid, $username) { extract(pwCache::getData(R_P . "data/bbscache/level.php", false)); if ($uid < 1 && !trim($username) || $username == '游客' || $username == '匿名') { return array('username' => '游客', 'memtitle' => $ltitle[2]); } $userService = L::loadClass('UserService', 'user'); if ($uid) { $userInfo = $userService->get($uid, true, true); } elseif ($username) {
$styleid = $colony['styleid']; $basename = "thread.php?cyid={$cyid}&showtype=set"; if (!$colony['ifwriteopen'] && !$ifadmin && (!$colony['ifcyer'] || $colony['ifadmin'] == '-1')) { Showmsg('colony_cnmenber'); } list($faceurl) = showfacedesign($winddb['icon'], 1, 'm'); !$ifadmin && Showmsg('undefined_action'); $a_key = 'set'; S::gp('t'); //获取功能权限 $ifsetable = $newColony->getSetAble($t); !$ifsetable && Showmsg('colony_setunable'); $t && ($tmpUrlAdd .= '&t=' . $t); if (empty($t)) { $jsStyle = pwJsonEncode($o_styledb); $jsStyleRelation = pwJsonEncode($o_style_relation); if (empty($_POST['step'])) { $titledetail = explode("~", $colony['titlefont']); $titlecolor = $titledetail[0]; if ($titlecolor && !preg_match('/\\#[0-9A-F]{6}/is', $titlecolor)) { $titlecolor = ''; } if ($titledetail[1] == '1') { $stylename[1] = 'b one'; } else { $stylename[1] = 'b'; } if ($titledetail[2] == '1') { $stylename[2] = 'u one'; } else { $stylename[2] = 'u';
$modeldb[$value['cateid']][$key]['cateid'] = $value['cateid']; $modeldb[$value['cateid']][$key]['modelid'] = $value['modelid']; $modeldb[$value['cateid']][$key]['name'] = $value['name']; } } //活动主题分类 $activitycatedb = $activitymodeldb = array(); //* @include_once pwCache::getPath(D_P. 'data/bbscache/activity_config.php'); pwCache::getData(D_P . 'data/bbscache/activity_config.php'); foreach ($activity_catedb as $key => $value) { if ($value['ifable'] == 1) { $activitycatedb[$key]['actid'] = $value['actid']; $activitycatedb[$key]['name'] = $value['name']; } } $jsonactids = pwJsonEncode($topicdb); //活动二级分类 foreach ($activity_modeldb as $key => $value) { if ($value['ifable'] == 1) { $activitymodeldb[$value['actid']][$key]['actid'] = $value['actid']; $activitymodeldb[$value['actid']][$key]['actmid'] = $value['actmid']; $activitymodeldb[$value['actid']][$key]['name'] = $value['name']; } } $thumbSelect = array($forumset['ifthumb'] => 'selected'); list($forumset['width'], $forumset['height']) = explode("\t", $forumset['thumbsize']); $style = $forumset['ifthumb'] == 1 ? 'display:' : 'display:none'; if ($forumset['ifthumb'] == 0) { $thumbstyle = array(0 => 'style="display:;"', 1 => 'style="display:none"', 2 => 'style="display:none"'); } elseif ($forumset['ifthumb'] == 1) { $thumbstyle = array(0 => 'style="display:none"', 1 => 'style="display:;"', 2 => 'style="display:none"');
InitGP(array('tid', 'block_id')); $tid = (int) $tid; if (!$tid) { exit; } $thread = $db->get_one("SELECT tid,fid,author,authorid,subject,type,postdate,hits,replies FROM pw_threads WHERE tid=" . pwEscape($tid)); $temp = array(); if ($thread) { $temp = array(); $temp['url'] = 'read.php?tid=' . $thread['tid']; $temp['title'] = $thread['subject']; $temp['image'] = ''; $temp['forumname'] = getForumName($thread['fid']); $temp['forumurl'] = getForumUrl($thread['fid']); $temp['descrip'] = getDescripByTid($tid); // $block = $stopic_service->getBlockById($block_id); // foreach ($block['config'] as $value) { // if ($value == 'descrip') { // $temp[$value] = getDescripByTid($tid); // } elseif (array_key_exists($value,$thread)) { // $temp[$value] = $thread[$value]; // } else { // $temp[$value] = ''; // } // } $temp = pwJsonEncode($temp); echo "success\t" . $temp; } else { echo "error"; } ajax_footer();
$readmsg = ''; } else { $temp_msgdb = explode(',', $readmsg); arsort($temp_msgdb); $readmsg = implode(',', $temp_msgdb); } $db->update('UPDATE pw_memberinfo SET readmsg=' . pwEscape($readmsg, false) . ' WHERE uid=' . pwEscape($winduid)); } } else { $readmsg = $msginfo['mid']; $db->update("INSERT INTO pw_memberinfo SET " . pwSqlSingle(array('uid' => $winduid, 'readmsg' => $readmsg))); } updateNewpm($winduid, 'minus'); $str = ''; if ($msginfo) { $str = pwJsonEncode($msginfo); } require_once PrintEot('ajax'); ajax_footer(); } else { Showmsg('msg_error'); } } else { Showmsg('msg_error'); } } elseif ($action == 'unread') { PostCheck(); InitGP(array('mid')); $rt = $db->get_one("SELECT mid FROM pw_msg WHERE mid=" . pwEscape($mid) . " AND type='rebox' AND touid=" . pwEscape($winduid) . "AND fromuid<>0"); if ($rt) { $db->update('UPDATE pw_msg SET ifnew=1 WHERE mid=' . pwEscape($mid));
$t_db = (array) $foruminfo['topictype']; $tdbJson = array(); if ($t_db) { foreach ($t_db as $key => $value) { if ($value['ifsys'] && $gp_gptype != 'system') { unset($t_db[$key]); continue; } $tdbJson[$value['id']]['name'] = $value['name']; $tdbJson[$value['id']]['upid'] = $value['upid']; if ($value['upid'] != 0) { $tdbJson[$value['upid']]['sub'][] = $value['id']; } } } $tdbJson = pwJsonEncode($tdbJson); $t_per = $pwforum->foruminfo['t_type']; } $db_forcetype = 0; // 是否需要强制主题分类 if ($t_db && $t_per == '2') { $db_forcetype = 1; } //实名认证权限 if ($db_authstate && !$pwpost->admincheck && $pwforum->forumset['auth_allowpost'] && true !== ($authMessage = $pwforum->authStatus($winddb['userstatus'], $pwforum->forumset['auth_logicalmethod']))) { Showmsg($authMessage . '_post'); } if (!$pwforum->foruminfo['allowpost'] && !$pwpost->admincheck && $_G['allowpost'] == 0) { Showmsg('postnew_group_right'); } $postSpecial = null;
updateUserAppNum($winduid, 'diary'); if ($db_tcheck) { $postcheck['diary'] = $diaryCheck; $pwInfoSQL['postcheck'] = serialize($postcheck); } S::isArray($pwInfoSQL) && $userService->update($winduid, array(), $pwInfoSQL); $url = "{$basename}a=detail&did={$did}"; $msg = defined('AJAX') ? "success\t" . $url : 'operate_success'; // defend start CloudWind::YunPostDefend($winduid, $windid, $groupid, $did, $atc_title, $atc_content, 'diary'); // defend end refreshto($url, $msg); } } elseif ($a == 'edit') { $db_uploadfiletype = $o_uploadsize = !empty($o_uploadsize) ? unserialize($o_uploadsize) : array(); $imageAllow = pwJsonEncode($db_uploadfiletype); $sendWeiboPrivacy = false; if (!$_POST['step']) { $did = (int) S::getGP('did'); $editor = getstatus($winddb['userstatus'], PW_USERSTATUS_EDITOR) ? 'wysiwyg' : 'textmode'; $dtsel = ''; $diary = $db->get_one("SELECT did,dtid,aid,privacy,subject,content,ifcopy,ifconvert FROM pw_diary WHERE uid=" . S::sqlEscape($winduid) . " AND did=" . S::sqlEscape($did)); !$diary && Showmsg('illegal_request'); $attach = ''; if ($diary['aid']) { $attachs = unserialize($diary['aid']); if (is_array($attachs)) { foreach ($attachs as $key => $value) { list($value['attachurl'], ) = geturl($value['attachurl'], 'lf'); $attach .= "'{$key}' : ['{$value['name']}', '{$value['size']}', '{$value['attachurl']}', '{$value['type']}', '{$value['special']}', '{$value['needrvrc']}', '{$value['ctype']}', '{$value['desc']}'],"; }