Esempio n. 1
0
 function _render()
 {
     $show = $this->_show ? $this->_show : "add";
     if ($show == "update") {
         list($id, $rateConfig, $isopen) = $this->_buildUpdateHtml();
     }
     isset($isopen) ? $isopen : ($isopen[1] = "checked=checked");
     $typeId = isset($rateConfig['typeid']) ? $rateConfig['typeid'] : 1;
     $typeSelect = $this->_buildTypeSelectHTML($typeId);
     $default_handler_url = EncodeUrl($this->_getDefaultUrl() . "&job=ajax");
     include H_R . '/template/ajax.htm';
     ajax_footer();
 }
Esempio n. 2
0
<?php

!defined('P_W') && exit('Forbidden');
$baseUrl = $admin_file . "?adminjob=mode&admintype=cms_purview&";
$purviewService = C::loadClass('PurviewService');
/* @var $purviewService PW_PurviewService */
S::gp(array('action', 'page'));
if (!$action) {
    $perPage = 20;
    S::gp(array('username'));
    $cmsPurviews = $purviewService->findAll($username, $page, $perPage);
    if (!$username) {
        $count = $purviewService->countPurview();
        $pager = pwGetPager($count, $page, $perPage, $baseUrl);
    }
    $ajaxUrl = EncodeUrl($baseUrl);
} elseif ($action == 'add') {
    S::gp(array('username', 'pid'));
    if (!empty($pid)) {
        $userpurview = $purviewService->findPurviewById($pid);
    }
    $superchecked = $userpurview['super'] ? "checked=checked" : "";
    $columns = $purviewService->getAllColumns();
} elseif ($action == 'addsubmit') {
    S::gp(array('pid', 'username', 'columnids', 'super'));
    if (empty($username)) {
        Showmsg('用户名不能为空', $basename . '&action=add&pid=' . $pid);
    }
    if (!empty($columnids) && !is_array($columnids)) {
        Showmsg('非法操作', $basename . '&action=add&pid=' . $pid);
    }
Esempio n. 3
0
    if ($forumdb) {
        foreach ($forumdb as $value) {
            $forum_L[] = $value;
        }
    }
    if ($subdb1) {
        foreach ($subdb1 as $value) {
            $forum_L[] = $value;
        }
    }
    if ($subdb2) {
        foreach ($subdb2 as $value) {
            $forum_L[] = $value;
        }
    }
    $ajaxurl = EncodeUrl($basename);
} elseif ($action == 'editforum') {
    InitGP(array('fidcommend'), 'P', 0);
    InitGP(array('order'), 'P', 2);
    $pwSQL = $forumDB = $fids = array();
    $query = $db->query("SELECT fid,vieworder FROM pw_searchforum");
    while ($rt = $db->fetch_array($query)) {
        $forumDB[$rt['fid']]['fid'] = $rt['fid'];
        $forumDB[$rt['fid']]['vieworder'] = (int) $rt['vieworder'];
        $fids[] = $rt['fid'];
    }
    foreach ($fidcommend as $key => $value) {
        //用于add|update
        $vieworder = (int) $order[$key];
        if (!S::inArray($key, $fids)) {
            $addSQL[$key]['fid'] = $key;
Esempio n. 4
0
     if ($_num > 1500) {
         $_cacheService = L::loadClass('cacheservice', 'utility');
         $_cacheService->flush(PW_CACHE_MEMCACHE);
     } else {
         $_query = $db->query("SELECT uid FROM tmp_datastate");
         $_uids = array();
         while ($rt = $db->fetch_array($_query)) {
             $_uids[] = $rt['uid'];
         }
         Perf::gatherInfo('changeMembersWithUserIds', array('uid' => $_uids));
     }
     //* 清除pw_members缓存 end
     if ($havesend < $count) {
         $step++;
         $j_url = "{$basename}&action={$action}&step={$step}&sendto=" . implode(',', $sendto) . "&by={$by}&count={$count}";
         adminmsg("sendmsg_step", EncodeUrl($j_url), 1);
     }
     adminmsg('operate_success');
 } elseif ($by == 2) {
     $cache_file = D_P . "data/bbscache/" . substr(md5($admin_pwd), 10, 10) . ".txt";
     if (!$step) {
         pwCache::setData($cache_file, $atc_content);
     } else {
         //* $atc_content = readover($cache_file);
         $atc_content = pwCache::getData($cache_file, false, true);
     }
     if (empty($subject) || empty($atc_content)) {
         adminmsg('sendmsg_empty');
     }
     $subject = S::escapeChar($subject);
     $sendmessage = S::escapeChar($atc_content);
Esempio n. 5
0
<?php

!defined('P_W') && exit('Forbidden');
InitGP(array("jobact"));
$ajaxurl = EncodeUrl($stopic_admin_url);
$bg_perpage = 6;
if ("preadd" == $jobact) {
    InitGP(array("new_category", "layout_select", 'style'));
    InitGP(array("is_new_category", "category_id", "is_new_bg", "bg_id", "copy_stopic_id"), null, 2);
    if ($is_new_category) {
        if (trim($new_category) == "") {
            Showmsg("对不起,新增分类名不能为空", $stopic_admin_url . "&job=default");
        }
        $new_category_id = $stopic_service->addCategory(array("title" => $new_category, "creator" => $admin_name));
        !$new_category_id && Showmsg("对不起,新分类增加失败", $stopic_admin_url . "&job=default");
        $category_id = $new_category_id;
    }
    if (!$category_id) {
        Showmsg("对不起,您既没有选择分类,也没有新建分类,请您重试", $stopic_admin_url . "&job=default");
    }
    if (!$layout_select) {
        Showmsg("对不起,请选择布局", $stopic_admin_url . "&job=default");
    }
    $layoutDefaultSet = $stopic_service->getLayoutSet($style);
    $defaultBanner = $stopic_service->getStyleBanner($style);
    $styles = $stopic_service->getStyles();
    $bg_list = $stopic_service->getPicturesAndDefaultBGs($category_id);
    $bg_total = ceil(count($bg_list) / $bg_perpage);
    include stopic_use_layout('admin');
} elseif ("add" == $jobact) {
    InitGP(array("stopic_title", "banner_url", "nav_set", "layout_select", "layout_set", "seo_keyword", "seo_desc"));
Esempio n. 6
0
        $db->update("UPDATE pw_pcfield SET fieldname=" . pwEscape($fieldname) . " WHERE fieldid=" . pwEscape($fieldid));
        /*$ckfieldname = $db->get_one("SHOW COLUMNS FROM $pcvaluetable LIKE '$fieldname'");
        		if ($ckfieldname) {
        			Showmsg('field_have_exists');
        		} else {
        			$sql = getFieldSqlByType($fieldtype);
        			$db->query("ALTER TABLE $pcvaluetable ADD $fieldname $sql");
        		}*/
        $sql = getFieldSqlByType($fieldtype);
        $db->query("ALTER TABLE {$pcvaluetable} ADD {$fieldname} {$sql}");
        Showmsg('pcfield_add_success');
    }
} elseif ($action == 'editfield') {
    define('AJAX', 1);
    if (!$_POST['step']) {
        $ajax_basename_edit = EncodeUrl($basename . "&action=editfield");
        InitGP(array('fieldid'));
        if (empty($fieldid)) {
            Showmsg('field_not_select');
        }
        $fielddb = $db->get_one("SELECT name,fieldname,rules,type,descrip,ifdel FROM pw_pcfield WHERE fieldid=" . pwEscape($fieldid));
        $count = $db->get_value("SELECT COUNT(*) FROM {$pcvaluetable} WHERE " . $fielddb['fieldname'] . " != ''");
        //查找是否变量已有值
        if ($count || $fielddb['ifdel']) {
            $ifhidden = '1';
        }
        if (in_array($fielddb['fieldname'], array('objecter', 'payway'))) {
            $areaifhidden = '1';
        }
        $rules = unserialize($fielddb['rules']);
        $type = $fielddb['type'];
Esempio n. 7
0
 function _buildRateParams($typeId)
 {
     $default_ajax_url = EncodeUrl($this->_getDefaultUrl());
     $rateConfigs = $this->_buildRateConfigHTML($typeId);
     $imageUrl = $this->_bbsUrl . '/hack/rate/images/';
     return array($rateConfigs, $default_ajax_url, $imageUrl);
 }
Esempio n. 8
0
        $fp = opendir($path);
        while ($file = readdir($fp)) {
            if ($file != '' && !in_array($file, array('.', '..')) && preg_match('/^fcache\\_\\d+\\_\\d+\\.php$/i', $file)) {
                ++$isnum;
                //* P_unlink("$path/$file");
                pwCache::deleteData("{$path}/{$file}");
            }
            if ($isnum > $num) {
                break;
            }
        }
        closedir($fp);
        if ($isnum > $num) {
            $url = "{$basename}&action=delf&num={$num}&step={$step}";
            $delnum = $num * $step;
            adminmsg('fcache_delete', EncodeUrl($url), 2);
        }
        adminmsg('operate_success');
    }
}
//class & functions for updatecache
class ClearMemcache
{
    function _isMemecacheOpen()
    {
        return class_exists("Memcache") && strtolower($GLOBALS['db_datastore']) == 'memcache';
    }
}
function getForumSelectHtml()
{
    global $db;
Esempio n. 9
0
}
*/
$diyoptions = $db_diy ? explode(',', $db_diy) : array('setforum', 'setuser', 'level', 'postcache', 'article');
$newopration = getHotOpration();
$menu = new MenuStart();
$diymenu = new MenuDiy();
$hotmenu = new MenuDiy();
creadMenu($nav_left, $menu);
$allmenu = $menu->myStruct();
$allmenu = "" == $allmenu ? "{}" : $allmenu;
$diyjsstr = $diymenu->myStruct();
$hotjsstr = $hotmenu->myStruct();
$headjsstr = headSerialize();
$db_guideshow = $db_guideshow === null ? 1 : ($db_guideshow == 1 ? 1 : 0);
/*init*/
$ajaxurl = EncodeUrl($db_adminfile . "?adminjob=ajaxhandler");
if ($adskin) {
    include PrintEot('windowindex');
} else {
    $mainList = $minorList = array();
    $flag = 0;
    foreach ($nav_left as $key => $value) {
        $key == 'modelist' && ($flag = 1);
        if (!isset($headdb[$key])) {
            continue;
        }
        if ($flag) {
            $minorList[$key] = $value;
        } else {
            $mainList[$key] = $value;
        }
Esempio n. 10
0
                                P_unlink("{$attachdir}/thumb/{$file1}/{$file2}");
                            }
                            if ($num - $start >= $pernum) {
                                $start = $num - $delnum;
                                $j_url = "{$basename}&action={$action}&start={$start}&pernum={$pernum}&deltotal={$deltotal}";
                                adminmsg('delattach_step', EncodeUrl($j_url), 0);
                            }
                        }
                    }
                }
            } elseif (is_file("{$attachdir}/{$file1}")) {
                $num++;
                if ($num > $start) {
                    $rt = $db->get_one("SELECT aid,ifthumb FROM pw_attachs WHERE attachurl=" . S::sqlEscape($file1));
                    if (!$rt) {
                        $delnum++;
                        $deltotal++;
                        P_unlink("{$attachdir}/{$file1}");
                        P_unlink("{$attachdir}/thumb/{$file1}");
                    }
                    if ($num - $start >= $pernum) {
                        $start = $num - $delnum;
                        $j_url = "{$basename}&action={$action}&start={$start}&pernum={$pernum}&deltotal={$deltotal}";
                        adminmsg('delattach_step', EncodeUrl($j_url), 0);
                    }
                }
            }
        }
    }
    adminmsg('operate_success');
}
Esempio n. 11
0
            $schtime = $timestamp - $msgdate * 24 * 3600;
            $sql .= " AND mdate<" . pwEscape($schtime);
        }
        $lines < 1 && ($lines = 100);
        $delids = array();
        $query = $db->query("SELECT DISTINCT mid FROM pw_msglog WHERE {$sql} LIMIT {$lines}");
        while ($rt = $db->fetch_array($query)) {
            $delids[] = $rt['mid'];
        }
        require_once R_P . 'require/msg.php';
        if ($delids) {
            $delids = pwImplode($delids);
            $db->update("DELETE FROM pw_msglog WHERE mid IN({$delids})");
            $delnum += $db->affected_rows();
            delete_msgc($delids);
            adminmsg('msglog_delete_step', EncodeUrl("{$basename}&action={$action}&msgdate={$msgdate}&lines={$lines}&delnum={$delnum}"));
        } else {
            delete_msgc();
            adminmsg('operate_success');
        }
    }
}
function numofpage_t($count, $page, $numofpage, $url, $max = null, $ajaxurl = '')
{
    global $tablecolor;
    $total = $numofpage;
    if (!empty($max)) {
        $max = (int) $max;
        $numofpage > $max && ($numofpage = $max);
    }
    if ($numofpage <= 1 || !is_numeric($page)) {
Esempio n. 12
0
 $invokepiece = $invokeService->getInvokePieceByInvokeId($invokepieceid);
 if ($invokepiece['rang'] != 'fid') {
     $fid = 0;
 }
 if (!$step) {
     InitGP(array('pushtid'));
     $default = array();
     if ($pushtid) {
         require R_P . 'lib/tplgetdata.class.php';
         $default = getSubjectByTid($pushtid, $invokepiece['param']);
     } else {
         foreach ($invokepiece['param'] as $key => $value) {
             $default[$key] = '';
         }
     }
     $ajax_basename = EncodeUrl($basename . "&action=addpush");
     require_once PrintMode('ajax_tplcontent');
     ajax_footer();
 } else {
     InitGP(array('param', 'offset', 'endtime', 'starttime', 'title1', 'title2', 'title3', 'title4', 'titletime'), 'GP');
     if (isset($invokepiece['param']['tagrelate'])) {
         InitGP(array('tagrelate'));
         $param['tagrelate'] = getTagRelate($tagrelate);
     }
     $titlecss = $invokeService->pushDataTitleCss($title1, $title2, $title3, $title4, $titletime);
     if (isset($param['image']) && count($_FILES) && $_FILES["uploadpic"]["name"] && $_FILES["uploadpic"]["size"]) {
         $uploadPicUrl = $invokeService->uploadPicture($_FILES, $invokepieceid, $admin_name);
         $param['image'] = $uploadPicUrl ? $uploadPicUrl : $param['image'];
     }
     $offset = (int) $offset;
     $invokeService->insertPushData(array('invokename' => $invokepiece['invokename'], 'invokepieceid' => $invokepieceid, 'fid' => $fid, 'loopid' => $loopid, 'starttime' => $starttime, 'endtime' => $endtime, 'offset' => $offset, 'data' => $param, 'editor' => $admin_name, 'titlecss' => $titlecss));
Esempio n. 13
0
        adminmsg('operate_success', "{$basename}&type={$type}");
    } else {
        adminmsg('operate_error', "{$basename}&type={$type}");
    }
} elseif ($action == 'empty') {
    $pwServer['REQUEST_METHOD'] != 'POST' && PostCheck($verify);
    $recycleService = new PW_RecycleEmpty();
    if ($type == 'topic') {
        $result = $recycleService->emptyTopic();
        adminmsg($result);
    } else {
        S::gp(array('ptable'));
        !is_numeric($ptable) && ($ptable = $db_ptable);
        $result = $recycleService->emptyReply($ptable);
        $j_url = "{$basename}&type={$type}";
        adminmsg($result, EncodeUrl($j_url), 2);
    }
}
function RevertModelTopic($modeldb)
{
    global $db;
    foreach ($modeldb as $key => $value) {
        $modelids = S::sqlImplode($value);
        $pw_topicvalue = GetTopcitable($key);
        $db->update("UPDATE {$pw_topicvalue} SET ifrecycle='0' WHERE tid IN({$modelids})");
    }
}
function RevertPcTopic($pcdb)
{
    global $db;
    foreach ($pcdb as $key => $value) {
Esempio n. 14
0
        }
        $cname = str_replace('%', '*', $cname);
        $aname = str_replace('%', '*', $aname);
        $uploader = str_replace('%', '*', $uploader);
        $pintro = str_replace('%', '*', $pintro);
        require_once PrintApp('admin');
    }
} elseif ($action == 'level') {
    require_once A_P . 'action/admin_level.php';
} elseif ($action == 'active') {
    S::gp(array('job'));
    if ($job == 'del') {
        if (empty($_POST['step'])) {
            S::gp(array('id'));
            define('AJAX', 1);
            $posthash = EncodeUrl("{$basename}&action=active&job=del&selid={$id}&ajax=1");
            require_once A_P . 'template/admin_ajax.htm';
            ajax_footer();
        } else {
            S::gp(array('selid', 'urladd'));
            if (isset($_GET['ajax'])) {
                define('AJAX', 1);
            }
            $basename .= "&action={$action}&job=list" . $urladd;
            if (!$selid) {
                adminmsg('operate_error');
            }
            require_once A_P . 'lib/active.class.php';
            $newActive = new PW_Active();
            $newActive->delActive($selid);
            if (defined('AJAX')) {
Esempio n. 15
0
            if ($errormsg[0] != 1) {
                adminmsg($errormsg[1]);
            }
        }
        $sphinxData = array('isopen' => $isopen, 'host' => $host, 'port' => $port, 'rank' => trim($rank), 'group' => trim($group), 'tindex' => trim($tindex), 'tcindex' => trim($tcindex), 'pindex' => trim($pindex));
        setConfig('db_sphinx', $sphinxData);
        updatecache_c();
        adminmsg("operate_success");
    } else {
        $ajax = GetGP('ajax');
        if ($ajax == 1 && strtolower($pwServer['REQUEST_METHOD']) == 'post') {
            InitGP(array('host', 'port'));
            $errormsg = testSockopen($host, $port);
            showError($errormsg[1]);
        }
        $baseUrl = EncodeUrl($basename);
        $default = $sphinxSearch->getDefaults();
        $configure = $db_sphinx ? $db_sphinx : $default;
        /*兼容*/
        foreach ($default as $k => $v) {
            $configure[$k] = isset($db_sphinx[$k]) ? $db_sphinx[$k] : $default[$k];
        }
        $configure['isopen'] == 0 ? $isopenCheck[0] = 'checked=checked' : ($isopenCheck[1] = 'checked=checked');
        $rankSelects = assignSelect($ranks, $configure['rank']);
        $groupSelects = assignSelect($groups, $configure['group']);
        include PrintEot('advanced');
    }
}
function assignSelect($arrays, $select)
{
    $selects = array();
Esempio n. 16
0
        }
        foreach ($tids as $tid) {
            $tid = intval($tid);
            if ($tid < 1) {
                continue;
            }
            $db_ifftp or $attachsService->reBuildAttachs($tid);
            $tuCoolService->updateTucoolImageNum($tid);
        }
        if (!$fids || $totalNums) {
            $step++;
            if (!$fids) {
                adminmsg("数据更新完成", $basename);
            }
            $fids = trim(implode(",", $fids));
            $jumpUrl = EncodeUrl("{$basename}&action={$action}&totalNums={$totalNums}&step={$step}&fids={$fids}&starttime={$startTime}&endtime={$endTime}&offset={$offset}&haveBuild={$haveBuild}");
            include PrintEot('tucool');
        }
    }
    include PrintEot('tucool');
}
function getTucoolForumsHtml($tucoolForums)
{
    $html = '';
    if (S::isArray($tucoolForums)) {
        foreach ($tucoolForums as $k => $v) {
            $html .= '<option value="' . $k . '">' . $v['name'] . '</option>';
        }
    }
    return $html;
}
Esempio n. 17
0
             if (eregi("^{$pre}", $file) && eregi("\\.sql\$", $file)) {
                 $count++;
             }
         }
     }
     !$step && ($step = 1);
     /*
     $sql=readover(D_P.'data/'.$pre.$step.'.sql');
     bakindata($sql);
     */
     bakindata(D_P . 'data/' . $pre . $step . '.sql');
     $i = $step;
     $step++;
     if ($count > 1 && $step <= $count) {
         $j_url = "{$basename}&action=bakin&step={$step}&count={$count}&pre={$pre}";
         adminmsg('bakup_in', EncodeUrl($j_url), 2);
     }
     updatecache();
     adminmsg('operate_success');
 } elseif ($action == 'del') {
     InitGP(array('delfile'), 'P');
     if (!$delfile) {
         adminmsg('operate_error');
     }
     foreach ($delfile as $key => $value) {
         if (eregi("\\.sql\$", $value)) {
             P_unlink(D_P . "data/{$value}");
         }
     }
     adminmsg('operate_success');
 }
Esempio n. 18
0
             $tend = $tmax;
             $end > $tend && ($end = $tend);
             $ttable = GetTtable($tstart + 1);
             $step = 3;
         }
         $ftable = 'pw_tmsgs' . $id;
         $ftable == $ttable && adminmsg('table_same');
         $db->update("INSERT INTO {$ttable} SELECT * FROM {$ftable} WHERE tid>" . S::sqlEscape($tstart) . 'AND tid<=' . S::sqlEscape($end));
         $db->update("DELETE FROM {$ftable} WHERE tid>" . S::sqlEscape($tstart) . 'AND tid<=' . S::sqlEscape($end));
         if ($end < $tend) {
             $j_url = "{$basename}&action={$action}&step={$step}&tstart={$end}&lines={$lines}&tmax={$tmax}&tmin={$tmin}&id={$id}";
             adminmsg('table_change', EncodeUrl($j_url), 2);
         } elseif ($step == 2 && $tidmax && $tmax > $tidmax) {
             $step = 3;
             $j_url = "{$basename}&action={$action}&step={$step}&lines={$lines}&tmax={$tmax}&tmin={$tmin}&id={$id}";
             adminmsg('table_change', EncodeUrl($j_url), 2);
         } else {
             adminmsg('operate_success');
         }
     }
 } elseif ($action == 'delttable') {
     S::gp('id', 'GP', 2);
     $rt = $db->get_one("SHOW TABLE STATUS LIKE 'pw_tmsgs{$id}'");
     if ($rt && $rt['Rows']) {
         adminmsg('deltable_error2');
     }
     $rt && $db->update("DROP TABLE pw_tmsgs{$id}", 0);
     $tlistdb = $db_tlist;
     unset($tlistdb[$id]);
     $db_tlist = count($tlistdb) > 1 ? $tlistdb : '';
     setConfig('db_tlist', $db_tlist);
Esempio n. 19
0
     $query = $db->query("SELECT tid FROM pw_threads WHERE fid='{$thisfid}' AND ifcheck=1 AND special='0' ORDER BY specialsort DESC,lastpost DESC" . S::sqlLimit($start, $percount));
     while ($topic = $db->fetch_array($query)) {
         $goon = 1;
         $staticPage->update($topic['tid']);
     }
     if ($forumnum && $next >= $forumnum) {
         $goon = 0;
     }
     if ($goon) {
         $j_url .= "&step={$step}&tfid={$tfid}";
         adminmsg('updatecache_step', EncodeUrl($j_url));
     } else {
         $tfid++;
         if (isset($creatfid[$tfid])) {
             $j_url .= "&step=1&tfid={$tfid}";
             adminmsg('updatecache_step1', EncodeUrl($j_url));
         }
         adminmsg('operate_success');
     }
 } elseif ($_POST['action'] == 'delete') {
     //* @include_once pwCache::getPath(D_P.'data/bbscache/forum_cache.php');
     pwCache::getData(D_P . 'data/bbscache/forum_cache.php');
     S::gp(array('creatfid'), 'P');
     if (in_array('all', $creatfid)) {
         $handle = opendir(R_P . $db_readdir . '/');
         while ($file = readdir($handle)) {
             if ($file != "." && $file != ".." && $file != "") {
                 if (is_dir(R_P . $db_readdir . '/' . $file)) {
                     //cms
                     if (!$forum[$file]['cms']) {
                         deldir(R_P . $db_readdir . '/' . $file);
Esempio n. 20
0
        if ($tid) {
            $threads = $postIndexDB->getThreadsById($tid);
        } else {
            $threads = $postIndexDB->getThreadsByReplies($replies, $page);
        }
    } elseif ($action == "update") {
        InitGP(array('threads'), 'GP');
        if (!is_array($threads)) {
            $threads = explode(',', $threads);
        }
        InitGP(array('step', 't_step'), 'GP');
        !$step && ($step = 1);
        !$t_step && ($t_step = 1);
        $index = $step - 1;
        $total = count($threads);
        if ($total > $index) {
            $t_step = $postIndexDB->addPostIndex($threads[$index], $t_step);
            $next = $t_step ? $step : $step + 1;
        }
        if ($next) {
            $threads = implode(',', $threads);
            $j_url = "{$basename}&sub=y&action=update&step={$next}&t_step={$t_step}&threads={$threads}";
            adminmsg('updatecache_total_step', EncodeUrl($j_url));
        } else {
            $basename = "{$basename}&sub=y&action=search";
            adminmsg("operate_success");
        }
    }
}
include PrintEot('postindex');
exit;
Esempio n. 21
0
function FormCheck($pre, $url, $add)
{
    $pre = stripslashes($pre);
    $add = stripslashes($add);
    return "<form{$pre} action=\"" . EncodeUrl($url) . "&\"{$add}>";
}
Esempio n. 22
0
            if ($class > 0) {
                //获取分类名
                $sql = "SELECT title,state FROM pw_filter_class WHERE id=" . pwEscape($class);
                $filter_class = $db->get_one($sql);
                $title = $filter_class['title'];
                $state = $filter_class['state'];
                $state = $state ? 0 : 1;
                $show = $state ? getLangInfo('cpmsg', 'filter_class_show_open') : getLangInfo('cpmsg', 'filter_class_show_close');
                $prompt = $state ? getLangInfo('cpmsg', 'filter_switch_open') : getLangInfo('cpmsg', 'filter_switch_close');
                //获取该分类敏感词总数
                $sql = "SELECT COUNT(id) AS count FROM pw_wordfb WHERE classid=" . pwEscape($class);
                $count = $db->get_value($sql);
            } else {
                ajaxmsg('filter_class_state');
            }
            $ajax_basename = EncodeUrl($basename . "&action=class&job=switch");
            include_once PrintEot('filterAjax');
            ajax_footer();
        }
    }
} elseif ($action == 'scan') {
    if ($admin_gid != 3 && $admin_gid != 4) {
        adminmsg('illegal_request');
    }
    if ($job == 'go') {
        define('AJAX', 1);
        InitGP(array('type', 'record_id', 'scan_count', 'remaintime', 'result_count', 'count', 'start_time', 'skip', 'convert'));
        $pagesize = 100;
        //如果没有敏感词,则不扫描
        $sql = "SELECT COUNT(id) AS count FROM pw_wordfb";
        $word_count = $db->get_value($sql);
Esempio n. 23
0
             adminmsg('operate_success', "{$basename}" . "&action=check&job=post");
         }
     } else {
         define('AJAX', 1);
         if (!$type || $type == 'thread') {
             //获取全部待审核主题
             $sql = "SELECT COUNT(*) AS count FROM pw_filter WHERE tid>0 AND pid=0 AND state=0";
             $count = $db->get_value($sql);
             $title = getLangInfo('cpmsg', 'filter_scan_type_thread');
             $ajax_basename = EncodeUrl($basename . "&action=check&job=allpass");
         } else {
             //获取全部待审核回复
             $sql = "SELECT COUNT(*) AS count FROM pw_filter WHERE tid>0 AND pid>0 AND state=0";
             $count = $db->get_value($sql);
             $title = getLangInfo('cpmsg', 'filter_scan_type_post');
             $ajax_basename = EncodeUrl($basename . "&action=check&job=allpass");
         }
         include_once PrintEot('filterAjax');
         ajax_footer();
     }
 } elseif ($job == 'del') {
     S::gp(array('pid', 'tid', 'type'));
     if (!$tid && !$pid) {
         adminmsg('operate_error', "{$basename}" . "&action=check");
     }
     $delarticle = L::loadClass('DelArticle', 'forum');
     if (!$type || $type == 'thread') {
         if (is_array($tid)) {
             $sTid = S::sqlImplode($tid);
         } else {
             $sTid = (int) $tid;
Esempio n. 24
0
<?php

!defined('P_W') && exit('Forbidden');
define('AJAX', 1);
$ajaxurl = EncodeUrl($basename . '&ajax=1');
S::gp(array('step', 'block_id', 'stopic_id'));
if (!$block_id || !$stopic_id) {
    showmsg('undefined_error');
}
$stopic_data = $stopic_service->getSTopicInfoById($stopic_id);
if (!$stopic_data) {
    showmsg('undefined_error');
}
list(, $block_type, ) = explode('_', $block_id);
$block_name = $stopic_service->getBlockById($block_type);
if (!$step) {
    $block = $stopic_service->getStopicUnitByStopic($stopic_id, $block_id);
    $block_data = $block ? $block['data'] : array();
    if (!$block) {
        $block = array('stopic_id' => $stopic_id, 'html_id' => $block_id, 'title' => '');
        $stopic_service->addUnit($block);
    }
    $block_job = '';
    include stopic_use_layout('ajax');
} else {
    S::gp(array('block_title'));
    $block_title = trim($block_title);
    $block_data = array();
    //do it self
    if ('thrd' == $block_type) {
        S::gp(array('url', 'title'));
Esempio n. 25
0
    foreach ($vieworder as $sid => $value) {
        $db->update('UPDATE pw_sharelinks SET threadorder = ' . S::sqlEscape($value) . ' WHERE sid= ' . S::sqlEscape($sid));
    }
    updatecache_i();
    adminmsg('operate_success');
} elseif ($action == 'types') {
    $query = L::loadClass('SharelinksTypeService', 'site');
    $typeCates = $query->getAllTypesName();
    $ajax_basename_add = EncodeUrl($basename . "&action=addtype");
    include PrintEot('sharelink');
    exit;
} elseif ($action == 'addtype') {
    define('AJAX', 1);
    S::gp(array('step'), 'P');
    if (empty($step)) {
        $ajax_basename_add = EncodeUrl($basename . "&action=addtype");
        $ifable_Y = 'checked';
        include PrintEot('sharelink');
        ajax_footer();
    } elseif ($step == 2) {
        S::gp(array('name', 'ifable', 'vieworder'), 'P');
        (!$name || strlen($name) > 30) && adminmsg('type_name_long');
        $typeService = L::loadClass('SharelinksTypeService', 'site');
        $stid = $typeService->getTypeIdByName($name);
        $stid && adminmsg('type_name_exist');
        $fieldsData = array('name' => $name, 'ifable' => intval($ifable), 'vieworder' => intval($vieworder));
        $typeService->insert($fieldsData);
        adminmsg('linkstype_add_success', "{$basename}&action=types");
    }
} elseif ($action == 'edittype') {
    S::gp(array('types'), 'P');
Esempio n. 26
0
<?php

!defined('P_W') && exit('Forbidden');
$portalPageService = L::loadClass('portalpageservice', 'area');
$actionUrl = $admin_file . "?adminjob=mode&admintype=area_page_manage";
$ajaxActionUrl = EncodeUrl($actionUrl);
if (!$action) {
    $portalPages = $portalPageService->getPortalPagesFromDB();
    include PrintMode('page_manage');
    exit;
} elseif ($action == 'update') {
    S::gp(array('sign'));
    if (!$sign) {
        echo '数据有误';
        ajax_footer();
        exit;
    }
    $staticPath = S::escapePath(PORTAL_PATH . $sign . '/index.html');
    touch($staticPath, strtotime('1970'));
    echo getLangInfo('msg', 'operate_success');
    ajax_footer();
    exit;
} elseif ($action == 'clear') {
    S::gp(array('sign'));
    if (!$sign) {
        Showmsg('数据有误');
    }
    $portalPageService->deletePortalPage($sign);
    updatePortalTemplate($sign);
    Showmsg("修改成功!");
}
Esempio n. 27
0
        $invokename = $invokepiece['invokename'];
        $invokeInfo = $invokeService->getInvokeByName($invokename);
        $channelAlias = $invokeInfo['sign'];
        $portalPageService = L::loadClass('portalpageservice', 'area');
        $portalPages = $portalPageService->getPortalPages();
        $invokes = $portalPageService->getPageInvokesForSelect($channelAlias);
        $offsets = array(0 => "", 1 => "", 2 => "", 3 => "", 4 => "", 5 => "");
        $offsets[$push['vieworder']] = 'checked="checked"';
        $stylename = $pushdataService->getTitleCss($push);
        ifcheck($push['ifbusiness'], 'ifbusiness');
        $push['starttime'] = $push['starttime'] ? get_date($push['starttime'], 'Y-m-d H:i') : '';
        if ($invokes && $invokename) {
            $invokepieces = $invokes[$invokename]['pieces'];
        }
        $invokesForJs = pwJsonEncode($invokes);
        $ajax_basename = EncodeUrl($basename);
        include PrintMode('pushdata');
        exit;
    } else {
        S::gp(array('param', 'offset', 'starttime', 'css', 'ifbusiness', 'invokepieceid'), 'GP');
        $pushdataService = L::loadClass('pushdataservice', 'area');
        $pushdataService->editPushdata($pushdataid, array('invokepieceid' => $invokepieceid, 'editor' => $admin_name, 'starttime' => $starttime, 'vieworder' => $offset, 'data' => $param, 'titlecss' => $css, 'ifbusiness' => $ifbusiness, 'ifverify' => 0));
        $baseUrl = "{$basename}&page={$page}&alias={$alias}&invoke={$invoke}&invokepiece={$invokepiece}";
        adminmsg('operate_success', $baseUrl);
    }
} elseif ($action == "fetch") {
    $dataSourceService = L::loadClass('datasourceservice', 'area');
    define('AJAX', 1);
    S::gp(array('pushdataid', 'invokepieceid'));
    if (!$invokepieceid) {
        ajax_footer();
Esempio n. 28
0
    ajax_footer();
    exit;
} else {
    S::gp(array('default_step', 'channels', 'defaultalias'));
    if ($default_step == 1) {
        $channelService->updateChannels($channels);
        $channelService->updateDefaultAlias($defaultalias);
        Showmsg("operate_success");
    } else {
        //* include_once pwCache::getPath(D_P.'data/bbscache/area_config.php');
        pwCache::getData(D_P . 'data/bbscache/area_config.php');
        $addUrl = $admin_file . "?adminjob=mode&admintype=area_channel_manage&action=add&ajax=1";
        $editUrl = $admin_file . "?adminjob=mode&admintype=area_channel_manage&action=edit&ajax=1";
        $delUrl = $admin_file . "?adminjob=mode&admintype=area_channel_manage&action=del";
        $channel_list = $channelService->getChannels();
        $actionUrl = EncodeUrl($actionUrl . "&ajax=1");
        include PrintMode('channel_manage');
    }
}
//验证提交表单
function checkChannelPost($channel_name, $channel_alias = 'alias', $id)
{
    global $channel_db;
    if ($channel_name == '') {
        Showmsg('频道名称不能为空');
    } elseif ($channel_alias == '') {
        Showmsg('英文别名不能为空');
    } elseif (strlen($channel_name) > 20) {
        Showmsg('频道名称不能超过20个字符');
    } elseif (strlen($channel_alias) > 20) {
        Showmsg('英文别名不能超过20个字符');
Esempio n. 29
0
    if ($fp = opendir(R_P . 'hack')) {
        $infodb = array();
        while ($hackdir = readdir($fp)) {
            if (strpos($hackdir, '.') === false && empty($db_hackdb[$hackdir])) {
                $hackname = $hackdir;
                $hackopen = 0;
                if (function_exists('file_get_contents')) {
                    $filedata = @file_get_contents(R_P . "hack/{$hackdir}/info.xml");
                } else {
                    $filedata = readover(R_P . "hack/{$hackdir}/info.xml");
                }
                if (preg_match('/\\<hackname\\>(.+?)\\<\\/hackname\\>\\s+\\<ifopen\\>(.+?)\\<\\/ifopen\\>/is', $filedata, $infodb)) {
                    $infodb[1] && ($hackname = Char_cv(str_replace(array("\n"), '', $infodb[1])));
                    $hackopen = (int) $infodb[2];
                }
                $hackurl = EncodeUrl("{$basename}&action=add&hackdir={$hackdir}&hackname=" . rawurlencode($hackname) . "&hackopen={$hackopen}");
                $uninstalldb[] = array($hackname, $hackdir, $hackopen, $hackurl);
            }
        }
        closedir($fp);
    }
    unset($db_hackdb);
    include PrintEot('hackcenter');
    exit;
} elseif ($action == 'edit') {
    InitGP(array('hackname'), 'GP', 0);
    //InitGP(array('hackopen'),'GP',2);
    //$navMenu = L::loadClass('navmenu');
    //$navMenu->settype('bbs_navinfo');
    !is_array($hackname) && ($hackname = array());
    foreach ($hackname as $key => $value) {
Esempio n. 30
0
<?php

!function_exists('adminmsg') && exit('Forbidden');
!$adminitem && ($adminitem = 'customfield');
$basename = "{$admin_file}?adminjob=customfield";
$ajaxurl = EncodeUrl($basename . '&adminitem=' . $adminitem);
if ($adminitem == 'customfield') {
    if (empty($action)) {
        S::gp(array('page'));
        $customfielddb = array();
        $page = max((int) $page, 1);
        $fieldService = L::loadClass('customerfield', 'user');
        $count = $fieldService->countAllFields();
        $count > 0 && ($customfielddb = $fieldService->getAllFieldsWithPages(($page - 1) * $db_perpage, $db_perpage));
        $total = ceil($count / $db_perpage);
        $pages = numofpage($count, $page, $total, $basename . '&adminitem=customfield&');
        include PrintEot('customfield');
        exit;
    } elseif ($action == 'add') {
        if (!$_POST['step']) {
            $rt = array();
            $state_1 = 'checked';
            $required_0 = 'checked';
            $viewinread_0 = 'checked';
            $editable_0 = 'checked';
            $areasService = L::loadclass("areasservice", 'utility');
            $basicValue = array(array('parentid' => 0, 'selectid' => 'province', 'defaultid' => '', 'hasfirst' => 1));
            $allAreas = $areasService->buildAllAreasLists($basicValue);
            include PrintEot('customfield');
            exit;
        } else {