Пример #1
0
/**
 * 重置消息数
 */
function resetUserMsgCount($num)
{
    global $winduid, $winddb;
    $num = intval($num);
    $userService = L::loadclass('UserService', 'user');
    /* @var $userService PW_UserService */
    $userService->update($winduid, array('newpm' => $num));
}
Пример #2
0
function search($fid)
{
    global $page, $thisp, $q, $db, $wap_perpage;
    /* 调用搜索Service -- searchThreads 搜索帖子内容 */
    $searcherService = L::loadclass('searcher', 'search');
    $result = $searcherService->searchThreads($q, 1, '', '', '', array(), $page, $wap_perpage, array());
    $start = ($page - 1) * $wap_perpage;
    if (is_array($result[1])) {
        foreach ($result[1] as $k => $v) {
            $id++;
            $v['anonymous'] && ($v['author'] = $db_anonymousname);
            $v['id'] = $id;
            $hots[] = $v;
        }
    }
    return $hots;
}
Пример #3
0
function overPrint($overprint, $tid, $operate = '', $oid = '')
{
    if (!in_array($overprint, array(1, 2))) {
        return false;
    }
    $overPrintService = L::loadclass("overprint");
    /*过滤*/
    if ($overPrintService->checkThreadRelated($overprint, $operate, $tid)) {
        return false;
    }
    if ($overprint == 2) {
        $oid = 0;
        $operate = '';
    }
    $overPrintService->suckThread($tid, $operate, $oid);
}
Пример #4
0
     $keywhere = substr_replace($keywhere, "", 0, 3);
     $sql .= " AND ({$keywhere}) ";
 }
 if ($userip) {
     $userip = str_replace('*', '%', $userip);
     $sql .= " AND (userip LIKE " . S::sqlEscape($userip) . ")";
 }
 if ($tcounts) {
     $sql .= " AND char_length(content)>" . S::sqlEscape($tcounts);
 } elseif ($counts) {
     $sql .= " AND char_length(content)<" . S::sqlEscape($counts);
 }
 $nums = is_numeric($nums) ? $nums : 20;
 if ($sphinx && $keyword && $db_sphinx['isopen'] == 1 && strpos($keyword, '*') === false) {
     $forumIds = $fid > 0 ? array($fid) : array();
     $sphinxServer = L::loadclass('searcher', 'search');
     $result = $sphinxServer->manageThreads($keyword, 3, $authorarray, $pstart, $pend, $forumIds, $page, $nums);
     if ($result === false) {
         adminmsg('search_keyword_empty');
     }
     $count = $result[0];
     $query = $db->query("SELECT fid,pid,tid,author,authorid,content,postdate,userip FROM {$pw_posts} WHERE pid in (" . $result[1] . ")  ORDER BY postdate DESC ");
 } else {
     $rt = $db->get_one("SELECT COUNT(*) AS sum FROM {$pw_posts} WHERE {$sql}");
     $count = $rt['sum'];
     $page < 1 && ($page = 1);
     $limit = S::sqlLimit(($page - 1) * $nums, $nums);
     $sql .= ' ORDER BY postdate DESC ';
     $sql .= $_POST['direct'] ? " LIMIT {$nums}" : $limit;
     $query = $db->query("SELECT fid,pid,tid,author,authorid,content,postdate,userip FROM {$pw_posts} {$forceIndex} WHERE {$sql}");
 }
Пример #5
0
 function recountTopic($read, $ifdel, $recycle)
 {
     global $db_anonymousname, $timestamp;
     $ret = 0;
     $tid = $read['tid'];
     $pw_posts = GetPtable($read['ptable']);
     $replies = $this->db->get_value("SELECT COUNT(*) AS replies FROM {$pw_posts} WHERE tid='{$tid}' AND ifcheck='1'");
     if (!$replies) {
         $read['anonymous'] && ($read['author'] = $db_anonymousname);
         if ($ifdel) {
             if ($recycle) {
                 //$this->db->update("UPDATE pw_threads SET fid='0',ifshield='0' WHERE tid='$tid'");
                 pwQuery::update('pw_threads', 'tid = :tid', array($tid), array('fid' => 0, 'ifshield' => 0));
             } else {
                 //* $threadManager = L::loadClass("threadmanager", 'forum');
                 //* $threadManager->deleteByThreadId($read['fid'], $tid);
                 $threadService = L::loadclass('threads', 'forum');
                 $threadService->deleteByThreadId($tid);
                 Perf::gatherInfo('changeThreadWithForumIds', array('fid' => $read['fid']));
                 $pw_tmsgs = GetTtable($tid);
                 //* $this->db->update("DELETE FROM $pw_tmsgs WHERE tid='$tid'");
                 pwQuery::delete($pw_tmsgs, 'tid=:tid', array($tid));
             }
             $ret = 1;
         } else {
             $pwSQL = array('replies' => 0, 'lastposter' => $read['author']);
             !($read['lastpost'] > $timestamp || $read['locked'] > 2) && ($pwSQL['lastpost'] = $read['postdate']);
             //$this->db->update("UPDATE pw_threads SET " . S::sqlSingle($pwSQL) . " WHERE tid=" . S::sqlEscape($tid));
             pwQuery::update('pw_threads', 'tid = :tid', array($tid), $pwSQL);
         }
     } else {
         $pt = $this->db->get_one("SELECT postdate,author,anonymous FROM {$pw_posts} WHERE tid='{$tid}' ORDER BY postdate DESC LIMIT 1");
         $pt['anonymous'] && ($pt['author'] = $db_anonymousname);
         $pwSQL = array('replies' => $replies, 'lastposter' => $pt['author']);
         !($read['lastpost'] > $timestamp || $read['locked'] > 2) && ($pwSQL['lastpost'] = $pt['postdate']);
         //$this->db->update("UPDATE pw_threads SET " . S::sqlSingle($pwSQL) . " WHERE tid=" . S::sqlEscape($tid));
         pwQuery::update('pw_threads', 'tid = :tid', array($tid), $pwSQL);
     }
     return $ret;
 }
Пример #6
0
function recycle($ids)
{
    global $db, $fid;
    $delids = array();
    foreach ($ids as $key => $value) {
        if (is_numeric($value)) {
            $delids[] = $value;
        }
    }
    if ($delids) {
        $delids = S::sqlImplode($delids);
    } else {
        Showmsg('forumcp_recycle_nodata');
    }
    $query = $db->query("SELECT r.*,t.special,t.ifshield,t.ifupload,t.ptable,t.replies,t.fid AS ckfid FROM pw_recycle r LEFT JOIN pw_threads t ON r.tid=t.tid WHERE r.tid IN ({$delids}) AND r.pid='0' AND r.fid=" . S::sqlEscape($fid));
    $taid_a = $ttable_a = $ptable_a = array();
    $delids = $pollids = $actids = $delaids = $rewids = $ids = array();
    while (@extract($db->fetch_array($query))) {
        $ids[] = $tid;
        ($ifshield != '2' || $replies == '0' || $ckfid == '0') && ($delids[] = $tid);
        $special == 1 && ($pollids[] = $tid);
        $special == 2 && ($actids[] = $tid);
        $special == 3 && ($rewids[] = $tid);
        if ($ifshield != '2' || $replies == '0' || $ckfid == '0') {
            $ptable_a[$ptable] = 1;
            $ttable_a[GetTtable($tid)][] = $tid;
        }
        if ($ifupload) {
            $taid_a[GetTtable($tid)][] = $tid;
            if ($ifshield != '2' || $replies == '0' || $ckfid == '0') {
                $pw_posts = GetPtable($ptable);
                $query2 = $db->query("SELECT aid FROM {$pw_posts} WHERE tid=" . S::sqlEscape($tid) . " AND aid!=''");
                while (@extract($db->fetch_array($query2))) {
                    if (!$aid) {
                        continue;
                    }
                    $attachs = unserialize(stripslashes($aid));
                    foreach ($attachs as $key => $value) {
                        is_numeric($key) && ($delaids[] = $key);
                        pwDelatt($value['attachurl'], $GLOBALS['db_ifftp']);
                        $value['ifthumb'] && pwDelatt("thumb/{$value['attachurl']}", $GLOBALS['db_ifftp']);
                    }
                }
            }
        }
    }
    foreach ($taid_a as $pw_tmsgs => $value) {
        $value = S::sqlImplode($value);
        $query = $db->query("SELECT aid FROM {$pw_tmsgs} WHERE tid IN({$value}) AND aid!=''");
        while (@extract($db->fetch_array($query))) {
            if (!$aid) {
                continue;
            }
            $attachs = unserialize(stripslashes($aid));
            foreach ($attachs as $key => $value) {
                is_numeric($key) && ($delaids[] = $key);
                pwDelatt($value['attachurl'], $GLOBALS['db_ifftp']);
                $value['ifthumb'] && pwDelatt("thumb/{$value['attachurl']}", $GLOBALS['db_ifftp']);
            }
        }
    }
    if ($pollids) {
        $pollids = S::sqlImplode($pollids);
        $db->update("DELETE FROM pw_polls WHERE tid IN({$pollids})");
    }
    if ($actids) {
        $actids = S::sqlImplode($actids);
        $db->update("DELETE FROM pw_activity WHERE tid IN({$actids})");
        $db->update("DELETE FROM pw_actmember WHERE actid IN({$actids})");
    }
    if ($rewids) {
        $rewids = S::sqlImplode($rewids);
        $db->update("DELETE FROM pw_reward WHERE tid IN({$rewids})");
    }
    if ($delaids) {
        $pw_attachs = L::loadDB('attachs', 'forum');
        $pw_attachs->delete($delaids);
    }
    //$delids  = S::sqlImplode($delids);
    if ($delids) {
        # $db->update("DELETE FROM pw_threads	WHERE tid IN($delids)");
        # ThreadManager
        //* $threadManager = L::loadClass("threadmanager", 'forum');
        //* $threadManager->deleteByThreadIds($fid,$delids);
        $threadService = L::loadclass('threads', 'forum');
        $threadService->deleteByThreadIds($delids);
        Perf::gatherInfo('changeThreadWithForumIds', array('fid' => $fid));
    }
    foreach ($ttable_a as $pw_tmsgs => $val) {
        //* $val = S::sqlImplode($val);
        //* $db->update("DELETE FROM $pw_tmsgs WHERE tid IN($val)");
        pwQuery::delete($pw_tmsgs, 'tid IN(:tid)', array($val));
    }
    foreach ($ptable_a as $key => $val) {
        $pw_posts = GetPtable($key);
        //$db->update("DELETE FROM $pw_posts WHERE tid IN($delids)");
        pwQuery::delete($pw_posts, 'tid IN(:tid)', array($delids));
    }
    delete_tag(S::sqlImplode($delids));
    if ($ids) {
        $ids = S::sqlImplode($ids);
        $db->update("DELETE FROM pw_recycle WHERE tid IN ({$ids})");
    }
    pwFtpClose($GLOBALS['ftp']);
}
Пример #7
0
function delforum($fid)
{
    global $db, $db_guestdir, $db_guestthread, $db_guestread;
    $foruminfo = $db->get_one("SELECT fid,fup,forumadmin FROM pw_forums WHERE fid=" . S::sqlEscape($fid));
    //$db->update("DELETE FROM pw_forums WHERE fid=".S::sqlEscape($fid));
    pwQuery::delete('pw_forums', 'fid=:fid', array($fid));
    //* $db->update("DELETE FROM pw_forumdata WHERE fid=".S::sqlEscape($fid));
    pwQuery::delete('pw_forumdata', 'fid=:fid', array($fid));
    $db->update("DELETE FROM pw_forumsextra WHERE fid=" . S::sqlEscape($fid));
    $db->update("DELETE FROM pw_permission WHERE fid>'0' AND fid=" . S::sqlEscape($fid));
    if ($foruminfo['forumadmin']) {
        $userService = L::loadClass('UserService', 'user');
        /* @var $userService PW_UserService */
        $forumadmin = explode(",", $foruminfo['forumadmin']);
        foreach ($forumadmin as $key => $value) {
            if ($value) {
                $gid = $userService->getByUserName($value);
                if ($gid['groupid'] == 5 && !ifadmin($value)) {
                    $userService->update($gid['uid'], array('groupid' => -1));
                    admincheck($gid['uid'], $value, $gid['groupid'], '', 'delete');
                }
            }
        }
    }
    if ($db_guestthread || $db_guestread) {
        require_once R_P . 'require/guestfunc.php';
        $db_guestthread && deldir(D_P . "{$db_guestdir}/T_{$fid}");
    }
    //* P_unlink(D_P."data/forums/fid_{$fid}.php");
    pwCache::deleteData(D_P . "data/forums/fid_{$fid}.php");
    require_once R_P . 'require/functions.php';
    require_once R_P . 'require/updateforum.php';
    $pw_attachs = L::loadDB('attachs', 'forum');
    $ttable_a = $ptable_a = array();
    $query = $db->query("SELECT tid,replies,ptable FROM pw_threads WHERE fid=" . S::sqlEscape($fid));
    while ($tpc = $db->fetch_array($query)) {
        $tid = $tpc['tid'];
        $ttable_a[GetTtable($tid)][] = $tid;
        $ptable_a[$tpc['ptable']] = 1;
        $db_guestread && clearguestcache($tid, $tpc['replies']);
        if ($attachdb = $pw_attachs->getByTid($tid)) {
            delete_att($attachdb);
        }
    }
    pwFtpClose($GLOBALS['ftp']);
    foreach ($ttable_a as $pw_tmsgs => $val) {
        //* $val = S::sqlImplode($val,false);
        //* $db->update("DELETE FROM $pw_tmsgs WHERE tid IN($val)");
        pwQuery::delete($pw_tmsgs, 'tid IN(:tid)', array($val));
    }
    # $db->update("DELETE FROM pw_threads WHERE fid=".S::sqlEscape($fid));
    # ThreadManager
    //* $threadManager = L::loadClass("threadmanager", 'forum');
    //* $threadManager->deleteByForumId($fid);
    $threadService = L::loadclass('threads', 'forum');
    $threadService->deleteByForumId($fid);
    //* Perf::gatherInfo('changeThreadWithForumIds', array('fid'=>$fid));
    foreach ($ptable_a as $key => $val) {
        $pw_posts = GetPtable($key);
        //$db->update("DELETE FROM $pw_posts WHERE fid=".S::sqlEscape($fid));
        pwQuery::delete($pw_posts, 'fid=:fid', array($fid));
    }
    updateforum($foruminfo['fup']);
}
Пример #8
0
function deleteThreadsHander($tidarray)
{
    global $windid, $manager, $groupid, $SYSTEM;
    PostCheck();
    (!$SYSTEM['superright'] || !$SYSTEM['delatc']) && Showmsg('mawhole_right');
    if ($tidarray == "") {
        Showmsg('data_error');
    }
    $tidarray = explode("|", $tidarray);
    if (!is_array($tidarray)) {
        Showmsg('data_error');
    }
    $forums = $threadIds = array();
    foreach ($tidarray as $v) {
        if ($v == "") {
            continue;
        }
        if (intval($v) < 0) {
            continue;
        }
        $threadIds[] = $v;
    }
    /**
    	$threadManager = L::loadclass('threadmanager', 'forum');
    	foreach($forums as $fid=>$threadIds){
    		$threadManager->deleteByThreadIds($fid,$threadIds);
    	}**/
    $threadService = L::loadclass('threads', 'forum');
    foreach ($forums as $fid => $_threadIds) {
        $threadService->deleteByThreadIds($_threadIds);
        Perf::gatherInfo('changeThreadWithForumIds', array('fid' => $fid));
    }
    $delarticle = L::loadClass('DelArticle', 'forum');
    $delarticle->delTopicByTids($threadIds, true);
    echo getLangInfo('other', 'search_manager_success');
    ajax_footer();
}
Пример #9
0
 function _getThreadList()
 {
     $threadlist = L::loadclass("threadlist");
     return $threadlist;
 }
Пример #10
0
<?php

!defined('P_W') && exit('Forbidden');
/**
 * 门户前台管理入口
 * @author liuhui @2010-3-10
 */
S::gp(array("invokename", "channelid", "action", "selid"));
$invokename = pwConvert(urldecode($invokename), $db_charset, 'utf8');
$levelService = L::loadclass("AreaLevel", 'area');
if (empty($action)) {
    /*门户管理操作*/
    $portalPageService = L::loadClass('portalpageservice', 'area');
    $channelid = $portalPageService->getSignForManage($channelid);
    $invokeService = L::loadClass('invokeservice', 'area');
    $invokeInfo = $invokeService->getInvokeByName($invokename);
    if (!$invokeInfo) {
        echo $levelService->language("area_no_invoke");
    }
    $invokename = trim(strip_tags($invokename));
    $level = $levelService->getAreaLevel($winduid, $channelid, $invokename);
    if ($level) {
        //获取频道名称
        list($title, $baseUrl) = array("模块内容管理-" . $invokeInfo['title'], "mode.php?m=area&q=manage&invokename=" . urlencode($invokename) . "&channelid=" . $channelid);
        require_once areaLoadFrontView('area_dialog');
    } else {
        echo $levelService->language("area_no_level");
    }
    ajax_footer();
} elseif ($action == "pushto") {
    /*内容推送/推荐操作*/
Пример #11
0
 function channelService()
 {
     return L::loadclass("channelService", 'area');
 }
Пример #12
0
function runJob()
{
    global $db_job_isopen, $winduid, $groupid;
    if (!$db_job_isopen || !$winduid) {
        /*是否开启用户任务*/
        return;
    }
    $taskClass = L::loadclass('job');
    $taskClass->run($winduid, $groupid);
}
Пример #13
0
<?php

!defined('P_W') && exit('Forbidden');
$overPrintClass = L::loadclass("overprint", 'forum');
if (empty($action)) {
    $relatedSelect = $overPrintClass->getRelatedSelect('');
    $isOpenSelect = $overPrintClass->getStatusSelect('');
    $iconPath = $overPrintClass->getIconPath();
    $overprints = $overPrintClass->getOverPrints();
    $overprintlists = array();
    foreach ($overprints as $overprint) {
        $list = array();
        $name = "list[" . $overprint['id'] . "][related]";
        $isopen = "list[" . $overprint['id'] . "][isopen]";
        $list['select'] = $overPrintClass->getRelatedSelect($overprint['related'], $name, $name);
        $list['isopen'] = $overprint['isopen'] > 0 ? "启用" : "关闭";
        $list['open'] = $overprint['isopen'] > 0 ? "checked" : "";
        $overprintlists[] = array_merge($overprint, $list);
    }
    $icons = $overPrintClass->getOverPrintIcons();
    include PrintEot('overprint');
    exit;
} elseif ($action == "add") {
    S::gp(array('title', 'icon', 'related', 'isopen'));
    $title = trim($title);
    $icon = trim($icon);
    $related = intval($related);
    $isopen = in_array($isopen, array(0, 1)) ? $isopen : 0;
    $title == "" && adminmsg("主题印戳 关联名称不能为空");
    ($icon == "" || !$overPrintClass->checkIcon($icon)) && adminmsg("请选择主题印戳图标或图标格式不正确");
    $data = array();
Пример #14
0
     $keywhere = substr_replace($keywhere, "", 0, 3);
     $sql .= " AND ({$keywhere}) ";
 }
 if ($userip) {
     $userip = str_replace('*', '%', $userip);
     $sql .= " AND (userip LIKE " . pwEscape($userip) . ")";
 }
 if ($tcounts) {
     $sql .= " AND char_length(content)>" . pwEscape($tcounts);
 } elseif ($counts) {
     $sql .= " AND char_length(content)<" . pwEscape($counts);
 }
 $nums = is_numeric($nums) ? $nums : 20;
 if ($sphinx && $keyword && $db_sphinx['isopen'] == 1 && strpos($keyword, '*') === false) {
     $index = $ptable ? 'posts1index' : 'postsindex';
     $sphinx = L::loadclass("search");
     $result = $sphinx->sphinxSearch($keyword, "OR", $index, $digest, $fid, $exclude, "lastpost", "DESC", $authorids, $pstart, $pend, "", $nums);
     if ($result === false) {
         adminmsg('search_keyword_empty');
     }
     $count = $result[0];
     $query = $db->query("SELECT fid,pid,tid,author,authorid,content,postdate,userip FROM {$pw_posts} WHERE pid in (" . $result[1] . ")  ORDER BY postdate DESC ");
 } else {
     $rt = $db->get_one("SELECT COUNT(*) AS sum FROM {$pw_posts} WHERE {$sql}");
     $count = $rt['sum'];
     $page < 1 && ($page = 1);
     $limit = pwLimit(($page - 1) * $nums, $nums);
     $sql .= ' ORDER BY postdate DESC ';
     $sql .= $_POST['direct'] ? " LIMIT {$nums}" : $limit;
     $query = $db->query("SELECT fid,pid,tid,author,authorid,content,postdate,userip FROM {$pw_posts} WHERE {$sql}");
 }
Пример #15
0
$guidename .= " &raquo; <a href=\"read.php?tid={$tid}{$viewbbs}\">{$subject}</a>";
$forumtitle = '|' . $forumtitle;
/** Labs Code By cn0zz
if ($db_htmifopen) {
	$link_ref_canonical = ($_GET['fpage'] || $_GET['uid'] || $_GET['skinco']) ? "read{$db_dir}tid-$tid".($page>1 ? "-page-$page" : '').$db_ext : '';
} else {
	$link_ref_canonical = ($_GET['fpage'] || $_GET['uid'] || $_GET['skinco']) ? "read.php?tid=$tid".($page>1 ? "&page=$page" : '') : '';
}
*/
require_once R_P . 'require/header.php';
require_once R_P . 'require/showimg.php';
Update_ol();
$readdb = $authorids = array();
//主题印戳
if ($forumset['overprint']) {
    $overPrintService = L::loadclass("overprint");
    $overprint = $overPrintService->getOverPrintIcon($read['overprint']);
}
if ($read['modelid'] || $foruminfo['modelid']) {
    require_once R_P . 'lib/posttopic.class.php';
    $postTopic = new postTopic($read);
}
if ($read['special'] > 20 || $foruminfo['pcid']) {
    require_once R_P . 'lib/postcate.class.php';
    $postCate = new postCate($read);
}
//分类信息主题帖
if ($read['modelid']) {
    $modelid = $read['modelid'];
    $topicvalue = $postTopic->getTopicvalue($read['modelid']);
    $initSearchHtml = $postTopic->initSearchHtml($read['modelid']);
Пример #16
0
    $pwuser = str_replace('*', '_', $pwuser);
    //noizyfeng
    $query = $db->query("SELECT uid FROM pw_members WHERE username LIKE " . pwEscape($pwuser));
    while ($rt = $db->fetch_array($query)) {
        $uids[] = $rt['uid'];
    }
    !$uids && Showmsg('user_not_exists');
} elseif (is_numeric($authorid)) {
    $uids = array($authorid);
}
if ($sch_time && $sch_time != 'all') {
    !is_numeric($sch_time) && ($sch_time = 86400);
    $sch_timemin = $timestamp - $sch_time;
    $sch_timemax = $timestamp + 86400;
}
$sphinxSearch = L::loadclass('search');
$result = $sphinxSearch->sphinxSearch($q, $method, $index, $digest, $fids, $fidexclude, $sortby, $asc, $uids, $sch_timemin, $sch_timemax, $groupby, $db_perpage);
$total = $result[0];
if (!$result[1]) {
    Showmsg('search_none');
}
$keyword_A = $result[2];
$query = $db->query("SELECT tid,fid,titlefont,author,authorid,subject,postdate,lastpost,lastposter,hits,replies,locked,special,anonymous FROM pw_threads WHERE tid IN({$result['1']}) ORDER BY {$sortby} {$asc}");
while ($rt = $db->fetch_array($query)) {
    if ($rt['anonymous'] && $rt['author'] != $windid) {
        if ($groupid != '3') {
            continue;
        }
        $rt['author'] = $db_anonymousname;
        $rt['authorid'] = 0;
    }
Пример #17
0
    if ($invokes && $invoke && $invokes[$invoke]) {
        $invokepieces = $invokes[$invoke]['pieces'];
    }
    $invokesForJs = pwJsonEncode($invokes);
    $searchArray = array('alias' => $alias, 'invoke' => $invoke, 'invokepiece' => $invokepiece, 'keyword' => $keyword, 'ifverify' => $ifverify);
    $ajax_basename = EncodeUrl($basename . "&ifverify={$ifverify}");
    $pushdatas = $pushdataService->searchPushDatas($searchArray, $page);
    $editUrl = "{$basename}&page={$page}&alias={$alias}&invoke={$invoke}&invokepiece={$invokepiece}";
    $url = $basename . '&';
    $pages = $pushdataService->searchPushdatasCount($searchArray, $page, $url);
    include PrintMode('pushdata');
    exit;
} elseif ($action == 'edit') {
    S::gp(array('pushdataid', 'step'));
    $editUrl = "{$basename}&page={$page}&alias={$alias}&invoke={$invoke}&invokepiece={$invokepiece}";
    $manageService = L::loadclass("AreaManage", 'area');
    $dataSourceService = L::loadClass('datasourceservice', 'area');
    if (!$step) {
        if (!($push = $pushdataService->getPushDataById($pushdataid))) {
            adminmsg('±§Ç¸,±à¼­Êý¾ÝÓÐÎó', $baseUrl);
        }
        $temp_invokepiece = $invokepiece;
        $invokepiece = $invokeService->getInvokePieceByInvokeId($push['invokepieceid']);
        $invokepieceid = $invokepiece['id'];
        $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 => "");
Пример #18
0
 //所有好友
 $friendsAllUids = getFriendsIdArr($winduid);
 if ($step == 2) {
     S::gp(array('f_keyword', 'decode'));
     !isset($f_keyword) && Showmsg('pse_input_keyword');
     $decode && ($f_keyword = pwConvert($f_keyword, $db_charset, 'utf8'));
     if ($according && !in_array($according, array('user', 'uid', 'email', 'tags'))) {
         showMsg("抱歉,搜索类型不存在");
     }
     $f_keyword = strip_tags($f_keyword);
     $count = 0;
     $members = $myAttentionUids = array();
     $searchURL = "u.php?a=friend&type=find";
     switch ($according) {
         case "user":
             $searcherService = L::loadclass('searcher', 'search');
             /* @var $searcherService PW_searcher */
             $uids = $memberdata = $attentionData = array();
             list($count, $users) = $searcherService->searchUsers($f_keyword, $page, $db_perpage);
             $users = $users ? $users : array();
             foreach ($users as $user) {
                 $uids[] = $user['uid'];
             }
             if ($uids) {
                 $userService = L::loadClass('UserService', 'user');
                 /* @var $userService PW_UserService */
                 foreach ($userService->getUsersWithMemberDataByUserIds($uids) as $rt) {
                     $memberdata[$rt['uid']] = $rt['thisvisit'];
                 }
                 $attentionSerivce = L::loadClass('attention', 'friend');
                 /* @var $attentionSerivce PW_Attention */
Пример #19
0
<?php

!function_exists('adminmsg') && exit('Forbidden');
$basename = "{$admin_file}?adminjob=currency";
require_once R_P . "require/forum.php";
if (!$action) {
    include PrintEot('currency');
    exit;
} elseif ($action == 'edit') {
    if (!$_POST['step']) {
        S::gp(array('uid', 'username'));
        $userService = L::loadClass('UserService', 'user');
        /* @var $userService PW_UserService */
        if (is_numeric($uid)) {
            $rt = $userService->get($uid, true, true);
        } else {
            $rt = $userService->getByUserName($username, true, true);
        }
        !$rt && adminmsg('user_not_exists');
        include PrintEot('currency');
        exit;
    } else {
        S::gp(array('uid', 'currency'), 'P');
        $userService = L::loadclass('UserService', 'user');
        /* @var $userService PW_UserService */
        $userService->update($uid, null, array('currency' => $currency));
        adminmsg('operate_success');
    }
}
Пример #20
0
function deleteThreadsHander($tidarray)
{
    global $windid, $manager, $groupid;
    PostCheck();
    (!CkInArray($windid, $manager) || $groupid != 3) && Showmsg('mawhole_right');
    if ($tidarray == "") {
        Showmsg('data_error');
    }
    $tidarray = explode("|", $tidarray);
    if (!is_array($tidarray)) {
        Showmsg('data_error');
    }
    $forums = array();
    foreach ($tidarray as $v) {
        if ($v == "") {
            continue;
        }
        list($fid, $tid) = explode("_", $v);
        if (intval($fid) < 0 && intval($tid) < 0) {
            continue;
        }
        $forums[$fid][] = $tid;
    }
    $threadManager = L::loadclass('threadmanager');
    foreach ($forums as $fid => $threadIds) {
        $threadManager->deleteByThreadIds($fid, $threadIds);
    }
    echo getLangInfo('other', 'search_manager_success');
    ajax_footer();
}
Пример #21
0
 $reward['credit']['max'] = intval($reward['credit']['max']);
 $reward['credit']['step'] = intval($reward['credit']['step']);
 $config['cachetimemin'] = intval($config['cachetimemin']);
 $config['cachetimemax'] = intval($config['cachetimemax']);
 if ($config['punchopen'] && ($reward['credit']['min'] < 1 || $reward['credit']['max'] < 1)) {
     adminmsg('打卡奖励设置有误!');
 }
 //每日递增步长
 if ($reward['credit']['step'] < 1 || $reward['credit']['step'] > $reward['credit']['max'] - $reward['credit']['min']) {
     $reward['credit']['step'] = 1;
 }
 //每日打卡功能  结束
 if ($config['punchopen'] == 0) {
     $config['punchopen'] = "0";
 }
 $jobService = L::loadclass("job", 'job');
 $t_reward = array();
 foreach ($reward['credit'] as $k => $v) {
     $t_reward[$k] = $v;
 }
 $t_reward['category'] = 'credit';
 $t_reward['information'] = $jobService->buildCategoryInfo($t_reward);
 $config['punch_reward'] = serialize($t_reward);
 $config['punch_usergroup'] = $usergroup ? implode(",", $usergroup) : '';
 //每日打卡功能 结束
 if ($config['browseopen'] == 0) {
     $config['browseopen'] = "0";
 }
 if ($configa['userurlopen'] == 0) {
     $configa['userurlopen'] = "0";
 }
Пример #22
0
 function afterReply()
 {
     global $db_ifpwcache, $timestamp, $db_readperpage;
     if ($this->data['ifcheck'] == 1) {
         if ($this->forum->foruminfo['allowhtm'] && !$this->forum->foruminfo['cms'] && $this->tpcArr['replies'] < $db_readperpage) {
             $StaticPage = L::loadClass('StaticPage');
             $StaticPage->update($this->tid);
         }
         $lastpost = array('subject' => $this->data['title'] ? substrs($this->data['title'], 26) : 'Re:' . substrs($this->tpcArr['subject'], 26), 'author' => $this->data['lastposter'], 'lastpost' => $timestamp, 'tid' => $this->tid, 't_date' => $this->tpcArr['postdate']);
         $this->forum->lastinfo('reply', '+', $lastpost);
         //Start Here pwcache
         if ($db_ifpwcache & 270) {
             require_once R_P . 'lib/elementupdate.class.php';
             $elementupdate = new ElementUpdate($this->forum->fid);
             $elementupdate->special = $this->tpcArr['special'];
             if ($db_ifpwcache & 14) {
                 $elementupdate->replySortUpdate($this->tid, $this->forum->fid, $this->tpcArr['postdate'], $this->tpcArr['replies'] + 1);
             }
             if ($db_ifpwcache & 256) {
                 $elementupdate->newReplyUpdate($this->tid, $this->forum->fid, $this->tpcArr['postdate']);
             }
             $elementupdate->updateSQL();
         }
         updateDatanalyse($this->data['authorid'], 'memberThread', 1);
         updateDatanalyse($this->tid, 'threadPost', 1);
         # memcache refresh
         $threadsObj = L::loadclass("threads");
         $threadsObj->clearThreadByThreadId($this->tid);
         # memcache refresh
         $threadlistObj = L::loadclass("threadlist");
         $threadlistObj->updateThreadIdsByForumId($this->forum->fid, $this->tid);
     }
     if ($this->postdata->filter->filter_weight > 1) {
         $this->postdata->filter->insert($this->tid, $this->pid, implode(',', $this->postdata->filter->filter_word), $this->postdata->filter->filter_weight);
     }
 }
Пример #23
0
    Cookie('lastvisit', '', 0);
    echo "ok\t{$showmsginfo}";
    ajax_footer();
} elseif ($action == 'jobpop') {
    if (!$db_job_isopen || !$winduid) {
        exit;
    }
    initGP(array("v", "job"));
    if ($job == "cookie") {
        $v = in_array($v, array(0, 1)) ? $v : 0;
        /*设置cookie*/
        Cookie("jobpop", $v);
    } elseif ($job == "show" || !getCookie("jobpop")) {
        /*强制显示或自定义显示*/
        Cookie("jobpop", 0);
        $jobService = L::loadclass("job");
        /*任务服务类*/
        $lists = $jobService->jobDisplayController($winduid, $groupid, 'list');
        $appliedHTML = $jobService->buildApplieds($winduid, $groupid);
        require PrintEot('jobpop');
        ajax_footer();
        exit;
    }
}
function isFriend($uid, $friend)
{
    global $db;
    if ($db->get_value("SELECT uid FROM pw_friends WHERE uid=" . pwEscape($uid) . ' AND friendid=' . pwEscape($friend) . " AND status='0'")) {
        return true;
    }
    return false;
Пример #24
0
function pwUpdateManager($username, $password)
{
    global $db;
    $userService = L::loadclass('UserService', 'user');
    /* @var $userService PW_UserService */
    $rt = $userService->getByUserName($username);
    if (!$rt['uid']) {
        global $timestamp, $onlineip;
        $mainFields = array('username' => $username, 'password' => $password, 'groupid' => 3, 'memberid' => 8, 'regdate' => $timestamp);
        $memberDataFields = array('postnum' => 0, 'lastvisit' => $timestamp, 'thisvisit' => $timestamp, 'onlineip' => $onlineip);
        $userService->add($mainFields, $memberDataFields);
    } else {
        $userService->update($rt['uid'], array('groupid' => 3, 'password' => $password));
    }
    admincheck($rt['uid'], $username, '3', $rt['groups'], 'update');
}
Пример #25
0
        if (is_numeric($value)) {
            $delids[] = $value;
        }
    }
    !$delids && Showmsg('operate_error');
    $delarticle = L::loadClass('DelArticle', 'forum');
    $readdb = $delarticle->getTopicDb('tid ' . $delarticle->sqlFormatByIds($delids));
    $delarticle->delTopic($readdb, $db_recycle);
    if ($db_ifpwcache ^ 1) {
        $db->update("DELETE FROM pw_elements WHERE type !='usersort' AND id IN(" . S::sqlImplode($delids) . ')');
    }
    # $db->update("DELETE FROM pw_threads WHERE tid IN ($selids)");
    # ThreadManager
    //* $threadManager = L::loadClass("threadmanager", 'forum');
    //* $threadManager->deleteByThreadIds($fid,$selids);
    $threadService = L::loadclass('threads', 'forum');
    $threadService->deleteByThreadIds($delids);
    Perf::gatherInfo('changeThreadWithForumIds', array('fid' => $fid));
    //* P_unlink(D_P.'data/bbscache/c_cache.php');
    pwCache::deleteData(D_P . 'data/bbscache/c_cache.php');
    adminmsg('operate_success', "{$basename}&action=topic&modelid={$modelid}");
} elseif ($action == 'addtopic') {
    define('AJAX', 1);
    if (empty($_POST['step'])) {
        $ajax_basename_add = EncodeUrl($basename . "&action=addtopic");
        $ifable_Y = 'checked';
        include PrintEot('topiccate');
        ajax_footer();
    } elseif ($_POST['step'] == 2) {
        S::gp(array('name'));
        S::gp(array('ifable', 'vieworder'), 'P', 2);
Пример #26
0
            PwUpload::movetoftp($middleFile, $middleDir . $filename);
            $s_ifthumb && PwUpload::movetoftp($smallFile, $smallDir . $filename);
        }
        pwFtpClose($GLOBALS['ftp']);
        $user_a = explode('|', $winddb['icon']);
        $user_a[2] = $img_w;
        $user_a[3] = $img_h;
        $usericon = setIcon("{$udir}/{$winduid}.{$ext}", 3, $user_a);
        $userService = L::loadClass('UserService', 'user');
        /* @var $userService PW_UserService */
        $userService->update($winduid, array('icon' => $usericon));
        //* $db->update("DELETE FROM pw_datastore WHERE skey=". S::sqlEscape("UID_".$winduid). " LIMIT 1");
        //job sign
        initJob($winduid, "doUpdateAvatar");
        if ($from != 'reg') {
            refreshto('profile.php?action=modify&info_type=face', 'upload_icon_success');
        }
        $jobService = L::loadclass('job', 'job');
        $jobs = $jobService->getJobByJobName('doUpdateAvatar');
        foreach ($jobs as $value) {
            if (!S::isArray($value)) {
                continue;
            }
            $jobService->jobGainController($winduid, $value['id']);
        }
        $verifyhash = GetVerify($winduid);
        refreshto("{$db_registerfile}?step=finish&option=2&verify={$verifyhash}", 'upload_icon_success');
    } else {
        Showmsg('upload_icon_fail');
    }
}
Пример #27
0
                $db->update("UPDATE pw_advert SET ifshow=0 WHERE type=0 AND id IN (" . S::sqlImplode($selid) . ")");
                break;
        }
        updatecache_c();
        adminmsg('operate_success', "{$basename}&action={$action}");
    }
    include_once PrintEot('setadvert');
    exit;
} elseif ($action == 'statistics') {
    $adverClass = L::loadclass('adver', 'advertisement');
    /*statistics*/
    list($status, $types, $benchs) = $adverClass->statistics();
    include_once PrintEot('setadvert');
    exit;
} elseif ($action == 'alter') {
    $adverClass = L::loadclass('adver', 'advertisement');
    /*during*/
    S::gp(array("step"));
    if ($step == 2) {
        S::gp(array('alterstatus', 'alterbefore', 'alterway'));
        $alterstatus = in_array($alterstatus, array(1, 0)) ? $alterstatus : 1;
        /*security*/
        $alterway = in_array($alterway, array(1, 2)) ? $alterway : 1;
        $alterbefore = intval($alterbefore);
        $alters = array('alterstatus' => $alterstatus, 'alterbefore' => $alterbefore, 'alterway' => $alterway);
        setConfig('db_alterads', $alters);
        updatecache_c();
        adminmsg("operate_success", "{$basename}&action={$action}");
    }
    $alters = $db_alterads ? $db_alterads : $adverClass->getDefaultAlter();
    /*alter*/
Пример #28
0
                $db->update("UPDATE pw_advert SET ifshow=0 WHERE type=0 AND id IN ({$selid})");
                break;
        }
        updatecache_c();
        adminmsg('operate_success', "{$basename}&action={$action}");
    }
    include_once PrintEot('setadvert');
    exit;
} elseif ($action == 'statistics') {
    $adverClass = L::loadclass('adver');
    /*statistics*/
    list($status, $types, $benchs) = $adverClass->statistics();
    include_once PrintEot('setadvert');
    exit;
} elseif ($action == 'alter') {
    $adverClass = L::loadclass('adver');
    /*during*/
    initGP(array("step"));
    if ($step == 2) {
        InitGP(array('alterstatus', 'alterbefore', 'alterway'));
        $alterstatus = in_array($alterstatus, array(1, 0)) ? $alterstatus : 1;
        /*security*/
        $alterway = in_array($alterway, array(1, 2)) ? $alterway : 1;
        $alterbefore = intval($alterbefore);
        $alters = array('alterstatus' => $alterstatus, 'alterbefore' => $alterbefore, 'alterway' => $alterway);
        setConfig('db_alterads', $alters);
        updatecache_c();
        adminmsg("operate_success", "{$basename}&action={$action}");
    }
    $alters = $db_alterads ? $db_alterads : $adverClass->getDefaultAlter();
    /*alter*/
Пример #29
0
/*SEO*/
$_summary = strip_tags(stripWindCode($read['content']));
$_summary = str_replace(array('"', "\n", "\r", '&nbsp;', '&amp;', '&lt;', '', '&#160;'), '', $_summary);
$_summary = substrs($_summary, 255);
if ($ifConvert) {
    $wordsfb = L::loadClass('FilterUtil', 'filter');
    $_summary = $wordsfb->convert($_summary);
}
bbsSeoSettings('read', '', $foruminfo['name'], $foruminfo['topictype'][$read['type']], $read['subject'], $read['tags'], $_summary);
/*SEO*/
require_once R_P . 'require/showimg.php';
Update_ol();
$readdb = $authorids = array();
//主题印戳
if ($forumset['overprint']) {
    $overPrintService = L::loadclass("overprint", 'forum');
    $overprint = $overPrintService->getOverPrintIcon($read['overprint']);
}
if ($forumset['viewpic'] && !$winduid) {
    $viewpic = 1;
}
if ($read['modelid'] || $foruminfo['modelid']) {
    L::loadClass('posttopic', 'forum', false);
    $postTopic = new postTopic($read);
}
if ($read['special'] > 20 || $foruminfo['pcid']) {
    L::loadClass('postcate', 'forum', false);
    $postCate = new postCate($read);
}
if ($read['special'] == 8 || $foruminfo['actmids']) {
    L::loadClass('ActivityForBbs', 'activity', false);
Пример #30
0
 function getDelArticelService()
 {
     return L::loadclass("delarticle", 'forum');
 }