Esempio n. 1
0
    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');
        }
        require_once R_P . 'require/functions.php';
        if (PwColony::calculateCredit($colony) > PwColony::calculateCredit($toColony)) {
            Showmsg('只允许群积分低的群组并入群积分高的群组!');
        }
        $colonyServer->mergeColony($tocid, $cyid);
        refreshto("thread.php?cyid={$tocid}", 'operate_success');
    }
} elseif ($t == 'attorn') {
    if (!($windid == $colony['admin'] && $groupRight['allowattorn'] || $groupid == '3')) {
        Showmsg('您没有权限进行转让操作!');
    }
    if (empty($_POST['step'])) {
        $groupManager = array();
Esempio n. 2
0
 }
 if ($delaids) {
     $delaids = S::sqlImplode($delaids);
     $db->update("DELETE FROM pw_attachs WHERE aid IN({$delaids})");
 }
 # $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($tmpDelids);
 Perf::gatherInfo('changeThreadWithForumIds', array('fid' => $fid));
 $db->update("DELETE FROM pw_argument WHERE tid IN({$delids})");
 require_once R_P . 'u/require/core.php';
 foreach ($colonys as $key => $value) {
     $colony = $newColony->getColonyById($key);
     $colony['tnum'] -= $value['tnum'];
     $colony['pnum'] -= $value['pnum'];
     updateGroupLevel($key, $colony);
     //* $db->update("UPDATE pw_colonys SET tnum=tnum-" . S::sqlEscape($value['tnum']) . ", pnum=pnum-" . S::sqlEscape($value['pnum']) . ", todaypost=todaypost-" . S::sqlEscape($value['todaypost']) . " WHERE id=". S::sqlEscape($key));
     $db->update(pwQuery::buildClause("UPDATE :pw_table SET tnum=tnum-:tnum,pnum=pnum-:pnum,todaypost=todaypost-:todaypost WHERE id=:id", array('pw_colonys', $value['tnum'], $value['pnum'], $value['todaypost'], $key)));
 }
 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($delid));
     //此处需要传入数组,所以用$delid传入
 }
 $db->update("DELETE FROM {$pw_tmsgs} WHERE tid IN ({$delids})");
 delete_tag($delids);
 /**
Esempio n. 3
0
         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';
     $articleDB = C::loadDB('article');
Esempio n. 4
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;
 }