Exemplo n.º 1
0
        $pwSQL['styleid'] = $styleid;
        //* $db->update("UPDATE pw_colonys SET " . S::sqlSingle($pwSQL) . ' WHERE id=' . S::sqlEscape($cyid));
        pwQuery::update('pw_colonys', 'id=:id', array($cyid), $pwSQL);
        require_once R_P . 'u/require/core.php';
        updateGroupLevel($cyid, $colony);
        adminmsg('operate_success', "{$basename}&action=editcolony");
    }
} elseif ($action == 'mergecolony') {
    if (empty($_POST['step'])) {
        require_once PrintApp('admin');
    } else {
        $basename = $basename . '&action=mergecolony';
        S::gp(array('fromcname', 'tocname'), '');
        require_once A_P . 'lib/colony.class.php';
        require_once A_P . 'lib/colonys.class.php';
        $colonyServer = new PW_Colony();
        if (!($colony = $colonyServer->getColonyByName($fromcname))) {
            adminmsg('源群组不存在!');
        }
        if (!($toColony = $colonyServer->getColonyByName($tocname))) {
            adminmsg('目标群组不存在!');
        }
        if (PwColony::calculateCredit($colony) > PwColony::calculateCredit($toColony)) {
            Showmsg('只允许群积分低的群组并入群积分高的群组!');
        }
        $colonyServer->mergeColony($toColony['id'], $colony['id']);
        adminmsg('operate_success', "{$basename}&action=mergecolony");
    }
} elseif ($action == 'delcolony') {
    S::gp(array('cyid'), '', 2);
    $rt = $db->get_one("SELECT classid,cnimg FROM pw_colonys WHERE id=" . S::sqlEscape($cyid));
Exemplo n.º 2
0
        ${'ifannouceopen_' . ($colony['ifannouceopen'] ? 'Y' : 'N')} = 'checked';
        require_once PrintEot('thread_set');
        footer();
    } else {
        S::gp(array('ifcheck', 'ifopen', 'ifinforum', 'ifwriteopen', 'ifmemberopen', 'ifannouceopen'), 'P', 2);
        $pwSQL = array('ifcheck' => $ifcheck, 'ifopen' => $ifopen, 'ifwriteopen' => $ifwriteopen, 'ifmemberopen' => $ifmemberopen, 'ifannouceopen' => $ifannouceopen);
        //* $db->update("UPDATE pw_colonys SET " . S::sqlSingle($pwSQL) . ' WHERE id=' . S::sqlEscape($cyid));
        pwQuery::update('pw_colonys', 'id=:id', array($cyid), $pwSQL);
        refreshto("{$basename}&t={$t}", 'colony_setsuccess');
    }
} elseif ($t == 'merge') {
    if (!($windid == $colony['admin'] && $groupRight['allowmerge'] || $groupid == '3')) {
        Showmsg('您没有权限进行合并操作!');
    }
    require_once A_P . 'groups/lib/colonys.class.php';
    $colonyServer = new PW_Colony();
    if (empty($_POST['step'])) {
        $groupList = $colonyServer->getColonyList(array('admin' => $colony['admin']));
        if (count($groupList) == 1) {
            Showmsg('没有可以合并的群组!');
        }
        require_once PrintEot('thread_set');
        footer();
    } else {
        S::gp(array('tocid'));
        S::gp(array('password'));
        if (!threadSetCheckOwnerPassword($winduid, $password)) {
            Showmsg('您输入的密码不正确!');
        }
        if (!($toColony = $colonyServer->getColonyById($tocid)) || $toColony['admin'] != $colony['admin']) {
            Showmsg('undefined_action');
Exemplo n.º 3
0
 function checkJoinStatus($id, $uid)
 {
     if ($this->isJoin($id, $uid)) {
         return '你已经报名了!';
     }
     $active = $this->getActiveById($id);
     if ($active['objecter'] == 1) {
         require_once R_P . 'apps/groups/lib/colonys.class.php';
         $colonyServer = new PW_Colony();
         $cm = $colonyServer->getSingleMember($active['cid'], $uid);
         if (!$cm) {
             return '你还不是本群群员,请先加入群组!';
         }
         if ($cm['ifadmin'] == -1) {
             return '你还没有通过身份审核,暂时不能加入活动!';
         }
     }
     if ($active['limitnum'] && $active['members'] >= $active['limitnum']) {
         return '活动参加人数已满!';
     }
     return true;
 }
Exemplo n.º 4
0
     if ($group['cnimg']) {
         list($cnimg) = geturl("cn_img/{$group['cnimg']}", 'lf');
     } else {
         $cnimg = $imgpath . '/g/groupnopic.gif';
     }
     $collection['username'] = $group['admin'];
     $collection['link'] = $db_bbsurl . '/{#APPS_BASEURL#}q=group&cyid=' . $id;
     $collection['group']['name'] = $group['cname'];
     $collection['group']['image'] = $cnimg;
 } elseif ($type == 'groupactive') {
     require_once A_P . 'groups/lib/active.class.php';
     $newActive = new PW_Active();
     $active = $newActive->getActiveById($id);
     empty($active) && Showmsg('data_error');
     require_once A_P . 'groups/lib/colonys.class.php';
     $newColony = new PW_Colony();
     $colony = $newColony->getColonyById($active['cid']);
     if ($active['poster']) {
         list($poster) = geturl("{$active['poster']}", 'lf');
     } else {
         $poster = $imgpath . '/defaultactive.jpg';
     }
     $collection['uid'] = $active['uid'];
     $collection['link'] = $db_bbsurl . '/apps.php?q=group&a=active&job=view&cyid=' . $colony['id'] . '&id=' . $active['id'];
     $collection['active']['type'] = $type;
     $collection['active']['name'] = $active['title'];
     $collection['active']['image'] = $poster;
     $type = 'active';
 } elseif ($type == 'cms') {
     define('M_P', 1);
     require_once R_P . 'mode/cms/require/core.php';
Exemplo n.º 5
0
define('APP_GROUP', 1);
if (isset($_POST['ajax'])) {
    define('AJAX', '1');
}
require_once 'global.php';
!$db_groups_open && Showmsg('groups_close');
//* include_once pwCache::getPath(D_P.'data/bbscache/o_config.php');
pwCache::getData(D_P . 'data/bbscache/o_config.php');
S::gp(array('q', 'step'));
$step && ($step = (int) $step);
if (empty($q)) {
    require_once R_P . 'u/require/core.php';
    require_once R_P . 'apps/groups/lib/colonys.class.php';
    $do = 'reloaddelay';
    $colonyServer = new PW_Colony();
    $weiboService = L::loadClass('weibo', 'sns');
    /* @var $weiboService PW_Weibo */
    $randColonys = $colonyServer->getRandColonys(6);
    $newmembers = $colonyServer->getNewMembers(12);
    $weiboList = $weiboService->getConloysWeibos('nocyids', 1, 10);
} elseif ($q == 'create') {
    !$winduid && Showmsg('not_login');
    !$o_newcolony && Showmsg('colony_reglimit');
    require_once R_P . 'u/require/core.php';
    require_once R_P . 'require/functions.php';
    banUser();
    if ($o_groups && strpos($o_groups, ',' . $groupid . ',') === false) {
        Showmsg('colony_groupright');
    }
    $db_question && $o_groups_qcheck && ($qkey = array_rand($db_question));
Exemplo n.º 6
0
<?php

!defined('P_W') && exit('Forbidden');
require_once R_P . 'apps/groups/lib/colonys.class.php';
$colonyServer = new PW_Colony();
S::gp(array('limit'));
$limit = (int) $limit;
$number = $limit ? $limit : 12;
//Ëæ»úȺ×é
$randColonys = $colonyServer->getRandColonys($number);
require_once PrintEot('ajax');
ajax_footer();
Exemplo n.º 7
0
<?php

!function_exists('adminmsg') && exit('Forbidden');
//* @include_once pwCache::getPath(D_P.'data/bbscache/o_config.php');
pwCache::getData(D_P . 'data/bbscache/o_config.php');
!$action && ($action = 'argument');
require_once A_P . 'lib/colonys.class.php';
$newColony = new PW_Colony();
if ($action == 'argument') {
    S::gp(array('step'));
    if ($step == 'delete') {
        S::gp(array('ttype', 'delid', 'ttable', 'ptable'));
        require_once R_P . 'require/updateforum.php';
        if ($ttype == '1') {
            !$delid && adminmsg('operate_error');
            $pw_tmsgs = 'pw_tmsgs' . ($ttable > 0 ? intval($ttable) : '');
            $fidarray = $delaids = $specialdb = array();
            $tmpDelids = $delid;
            $delids = S::sqlImplode($delid);
            $tnum = array();
            $pnum = array();
            /**
             * 删除帖子
             */
            $db_guestread && (require_once R_P . 'require/guestfunc.php');
            $ptable_a = $delnum = array();
            $query = $db->query("SELECT t.tid,t.fid,t.authorid,t.replies,t.postdate,t.special,t.ptable,tm.aid,t.ifupload FROM pw_threads t LEFT JOIN {$pw_tmsgs} tm ON tm.tid=t.tid WHERE t.tid IN({$delids})");
            while (@extract($db->fetch_array($query))) {
                if (!in_array($fid, $fidarray)) {
                    $fidarray[] = $fid;
                }
Exemplo n.º 8
0
    $ann_img = 'fold';
    $cate_ann = '';
} else {
    $ann_img = 'open';
    $cate_ann = 'display:none;';
}
if (strpos($_COOKIE['deploy'], "\tchildren\t") === false) {
    $children_img = 'fold';
    $cate_children = '';
} else {
    $children_img = 'open';
    $cate_children = 'display:none;';
}
if ($foruminfo['cnifopen'] && $forumset['viewcolony'] && !$cyid) {
    require_once R_P . 'apps/groups/lib/colonys.class.php';
    $colonyServer = new PW_Colony();
    $cnGroups = $colonyServer->getColonysInForum($fid);
}
//子版块
$forumdb = array();
if (($foruminfo['childid'] || $cnGroups) && !$cyid) {
    require_once R_P . "require/thread_child.php";
}
//快捷管理
if ($managecheck) {
    S::gp(array('concle'));
    $concle || ($concle = GetCookie('concle'));
    if ($concle == 1 && ($isGM || $pwSystem['topped'] || $pwSystem['digestadmin'] || $pwSystem['lockadmin'] || $pwSystem['pushadmin'] || $pwSystem['coloradmin'] || $pwSystem['downadmin'])) {
        $concle = 2;
        $managemode = 1;
        Cookie("concle", "1", 0);
Exemplo n.º 9
0
 function init($id)
 {
     global $cyid, $tid;
     $this->_pid = $id;
     if (!$tid) {
         return false;
     }
     $tid = (int) $tid;
     $pw_posts = GetPtable('N', $tid);
     $replyDB = $this->_db->get_one("SELECT p.pid,p.tid,p.anonymous,p.ifshield,p.subject as psubject,p.author,p.authorid,p.postdate,p.content,t.subject as tsubject FROM {$pw_posts} p LEFT JOIN pw_threads t ON p.tid=t.tid WHERE p.pid=" . S::sqlEscape($this->_pid));
     $uid = $replyDB['authorid'];
     $subject = $replyDB['psubject'] ? $replyDB['psubject'] : 'Re:' . $replyDB['tsubject'];
     $username = $replyDB['anonymous'] == 1 ? $db_anonymousname : $replyDB['author'];
     $this->_url = !$cyid ? $this->_url . $tid . "&pid=" . $this->_pid : $this->_url . $tid . "&pid=" . $this->_pid . "&cyid={$cyid}";
     require_once R_P . 'require/bbscode.php';
     $replyDB['content'] = strip_tags(convert($this->escapeStr(stripWindCode($replyDB['content'])), ''));
     $title = sprintf("[url=%s] %s [/url]", $this->_url, $subject);
     $descrip = $content = $replyDB['ifshield'] == 1 ? "该主题已屏蔽" : stripWindCode(substrs($replyDB['content'], 100, 'N'));
     $content .= sprintf("------[url=%s] %s [/url]", $this->_url, $subject);
     $mailSubject = getLangInfo('app', 'reply_recommend');
     $mailContent = getLangInfo('app', 'ajax_sendweibo_info', array('db_bbsurl' => $GLOBALS['db_bbsurl'], 'uid' => $uid, 'username' => $username, 'title' => $title, 'descrip' => substrs($descrip, 50)));
     if ($cyid) {
         require_once R_P . 'apps/groups/lib/colonys.class.php';
         $newColony = new PW_Colony();
         $colonyDB = $newColony->getColonyById($cyid);
         $cname = $colonyDB['cname'];
         $mailContent = getLangInfo('app', 'ajax_sendweibo_groupinfo', array('cname' => $cname, 'title' => $title, 'descrip' => substrs($descrip, 50)));
     }
     $this->_content = $content;
     $this->_mailSubject = $mailSubject;
     $this->_mailContent = $mailContent;
 }