同步宝塔上的源码
This commit is contained in:
444
source/plugin/replyfloor/hook.class.php
Normal file
444
source/plugin/replyfloor/hook.class.php
Normal file
@@ -0,0 +1,444 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This is NOT a freeware, use is subject to license terms
|
||||
* Ӧ<><D3A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD>¥<EFBFBD><C2A5>¥<EFBFBD>ظ<EFBFBD> 9.0
|
||||
* <20><><EFBFBD>ص<EFBFBD>ַ: https://addon.dismall.com/plugins/replyfloor.html
|
||||
* Ӧ<>ÿ<EFBFBD><C3BF><EFBFBD><EFBFBD><EFBFBD>: <20><><EFBFBD><EFBFBD>
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>QQ: 594433766
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: 202505310549
|
||||
* <20><>Ȩ<EFBFBD><C8A8><EFBFBD><EFBFBD>: www.shitangsweet.com
|
||||
* <20><>Ȩ<EFBFBD><C8A8>: 2025053105b89RrI3R9n
|
||||
* δ<><CEB4>Ӧ<EFBFBD>ó<EFBFBD><C3B3><EFBFBD><F2BFAAB7><EFBFBD>/<2F><><EFBFBD><EFBFBD><EFBFBD>ߵ<EFBFBD><DFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD><C9A3><EFBFBD><EFBFBD>ý<EFBFBD><C3BD>з<EFBFBD><D0B7>̡<F2B9A4B3><CCA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ࡢ<EFBFBD><E0A1A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȣ<EFBFBD><C8A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ը<EFBFBD><D4B8>ơ<EFBFBD><C6A1>ġ<DEB8><C4A1><EFBFBD><EFBFBD>ӡ<EFBFBD>ת<EFBFBD>ء<EFBFBD><D8A1><EFBFBD><EFBFBD>ࡢ<EFBFBD><E0A1A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>桢<EFBFBD><E6A1A2>չ<EFBFBD><D5B9>֮<EFBFBD>йص<D0B9><D8B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7>
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* $author: <20><><EFBFBD><EFBFBD> $
|
||||
*/
|
||||
|
||||
if (!defined('IN_DISCUZ')) {
|
||||
exit('Access Denied');
|
||||
}
|
||||
|
||||
class plugin_replyfloor {
|
||||
|
||||
public static $identifier = 'replyfloor';
|
||||
|
||||
function __construct() {
|
||||
global $_G;
|
||||
$setconfig = $_G['cache']['plugin'][self::$identifier];
|
||||
$setconfig['allow_forums'] = (array)unserialize($setconfig['allow_forums']);
|
||||
if(in_array('', $setconfig['allow_forums'])) {
|
||||
$setconfig['allow_forums'] = array();
|
||||
}
|
||||
$setconfig['allow_groups'] = $setconfig['allow_groups'] ? explode(",", $setconfig['allow_groups']) : array();
|
||||
$setconfig['open_seccheck'] = (array)unserialize($setconfig['open_seccheck']);
|
||||
$setconfig['perpage_pc'] = $setconfig['perpage_pc'] > 0 ? $setconfig['perpage_pc'] : 10;
|
||||
$this->setconfig = $setconfig;
|
||||
}
|
||||
|
||||
function deletethread($value) {
|
||||
global $_G;
|
||||
$setconfig = $this->setconfig;
|
||||
if($value['step'] == 'delete'){
|
||||
list($tids, $membercount, $credit, $ponly) = $value['param'];
|
||||
require_once libfile('function/common', 'plugin/replyfloor');
|
||||
if($setconfig['get_credit']) {
|
||||
require_once libfile('function/post');
|
||||
require_once libfile('function/forum');
|
||||
$wherearr = array();
|
||||
$wherearr[] = 'tid in ('.dimplode($tids).')';
|
||||
$wherearr[] = "status = '0'";
|
||||
$recordlist = DB::fetch_all('SELECT * FROM '.DB::table('plugin_replyfloor_message').($wherearr ? ' WHERE '.implode(' AND ', $wherearr) : ''));
|
||||
foreach ($recordlist as $value) {
|
||||
$thread = get_thread_by_tid($value['tid']);
|
||||
updatepostcredits('-', $value['uid'], 'reply', $thread['fid']);
|
||||
}
|
||||
}
|
||||
replyfloor_deletemessage($ids, 'tid', $setconfig['open_recycle']);
|
||||
}
|
||||
}
|
||||
|
||||
function deletepost($value) {
|
||||
global $_G;
|
||||
$setconfig = $this->setconfig;
|
||||
if($value['step'] == 'delete'){
|
||||
list($ids, $idtype, $credit, $posttableid, $recycle) = $value['param'];
|
||||
require_once libfile('function/common', 'plugin/replyfloor');
|
||||
if($idtype == 'pid') {
|
||||
if($setconfig['get_credit']) {
|
||||
require_once libfile('function/post');
|
||||
require_once libfile('function/forum');
|
||||
$wherearr = array();
|
||||
$wherearr[] = 'pid in ('.dimplode($ids).')';
|
||||
$wherearr[] = "status = '0'";
|
||||
$recordlist = DB::fetch_all('SELECT * FROM '.DB::table('plugin_replyfloor_message').($wherearr ? ' WHERE '.implode(' AND ', $wherearr) : ''));
|
||||
foreach ($recordlist as $value) {
|
||||
$thread = get_thread_by_tid($value['tid']);
|
||||
updatepostcredits('-', $value['uid'], 'reply', $thread['fid']);
|
||||
}
|
||||
}
|
||||
replyfloor_deletemessage($ids, 'pid', $setconfig['open_recycle']);
|
||||
} elseif($idtype == 'tid') {
|
||||
if($setconfig['get_credit']) {
|
||||
require_once libfile('function/post');
|
||||
require_once libfile('function_forum', 'function');
|
||||
$wherearr = array();
|
||||
$wherearr[] = 'tid in ('.dimplode($ids).')';
|
||||
$wherearr[] = "status = '0'";
|
||||
$recordlist = DB::fetch_all('SELECT * FROM '.DB::table('plugin_replyfloor_message').($wherearr ? ' WHERE '.implode(' AND ', $wherearr) : ''));
|
||||
foreach ($recordlist as $value) {
|
||||
$thread = get_thread_by_tid($value['tid']);
|
||||
updatepostcredits('-', $value['uid'], 'reply', $thread['fid']);
|
||||
}
|
||||
}
|
||||
replyfloor_deletemessage($ids, 'tid', $setconfig['open_recycle']);
|
||||
} elseif($idtype == 'authorid') {
|
||||
if($setconfig['get_credit']) {
|
||||
require_once libfile('function/post');
|
||||
require_once libfile('function_forum', 'function');
|
||||
$wherearr = array();
|
||||
$wherearr[] = 'uid in ('.dimplode($ids).')';
|
||||
$wherearr[] = "status = '0'";
|
||||
$recordlist = DB::fetch_all('SELECT * FROM '.DB::table('plugin_replyfloor_message').($wherearr ? ' WHERE '.implode(' AND ', $wherearr) : ''));
|
||||
foreach ($recordlist as $value) {
|
||||
$thread = get_thread_by_tid($value['tid']);
|
||||
updatepostcredits('-', $value['uid'], 'reply', $thread['fid']);
|
||||
}
|
||||
}
|
||||
replyfloor_deletemessage($ids, 'authorid', $setconfig['open_recycle']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class plugin_replyfloor_forum extends plugin_replyfloor {
|
||||
|
||||
function forumdisplay_top_output() {
|
||||
global $_G;
|
||||
$return = '';
|
||||
$setconfig = $this->setconfig;
|
||||
if($setconfig['allow_forums'] && !in_array($_G['fid'], $setconfig['allow_forums'])){
|
||||
return $return;
|
||||
}
|
||||
if($setconfig['add_replies']){
|
||||
$tids = array();
|
||||
foreach ($_G['forum_threadlist'] as $key => $value) {
|
||||
$tids[] = $value['tid'];
|
||||
}
|
||||
if(empty($tids)){
|
||||
return $return;
|
||||
}
|
||||
$wherearr = array();
|
||||
$wherearr[] = 'tid in ('.dimplode($tids).')';
|
||||
$wherearr[] = "status = '0'";
|
||||
$recordlist = DB::fetch_all('SELECT tid,count(*) as count FROM '.DB::table('plugin_replyfloor_message').($wherearr ? ' WHERE '.implode(' AND ', $wherearr) : '').' group by tid');
|
||||
$count = array();
|
||||
foreach ($recordlist as $value) {
|
||||
$count[$value['tid']] = $value['count'];
|
||||
}
|
||||
foreach ($_G['forum_threadlist'] as &$thread) {
|
||||
if($count[$thread['tid']]){
|
||||
$thread['allreplies'] += $count[$thread['tid']];
|
||||
$thread['replies'] += $count[$thread['tid']];
|
||||
}
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function viewthread_top_output() {
|
||||
global $_G,$allowpostreply;
|
||||
$setconfig = $this->setconfig;
|
||||
if(($setconfig['position_pc'] > 0) && (!$setconfig['allow_forums'] || in_array($_G['fid'], $setconfig['allow_forums']))){
|
||||
if($setconfig['add_replies']){
|
||||
$_G['forum_thread']['allreplies'] += C::t('#'.self::$identifier.'#'.self::$identifier.'_message')->count_by_search_where(array("tid = '".$_G['tid']."'", "status = '0'"));
|
||||
}
|
||||
include template(self::$identifier.':style');
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function viewthread_bottom_output() {
|
||||
global $_G,$allowpostreply, $swfconfig;
|
||||
$setconfig = $this->setconfig;
|
||||
if(($setconfig['position_pc'] > 0) && (!$setconfig['allow_forums'] || in_array($_G['fid'], $setconfig['allow_forums']))){
|
||||
include template(self::$identifier.':js');
|
||||
}
|
||||
if($setconfig['replace_pc'] == 1){
|
||||
if(!$_G['setting']['rewritestatus']){
|
||||
$_G['setting']['rewritestatus'] = array();
|
||||
}elseif(!is_array($_G['setting']['rewritestatus'])){
|
||||
$_G['setting']['rewritestatus'] = array($_G['setting']['rewritestatus']);
|
||||
}
|
||||
$_G['setting']['rewritestatus'][] = 'replyfloor_reply';
|
||||
$_G['setting']['output']['str']['search']['replyfloor'] = "showWindow('reply', this.href)";
|
||||
$_G['setting']['output']['str']['replace']['replyfloor'] = "replyfloor_reply(this.href)";
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function viewthread_postbottom_output() {
|
||||
global $_G,$postlist,$postno,$postnostick,$allowpostreply;
|
||||
$setconfig = $this->setconfig;
|
||||
$t = $pids = array();
|
||||
if($_G['inajax'] && (empty($_GET['viewpid']) || ($_GET['viewpid'] && $_GET['from']))){
|
||||
return $t;
|
||||
}
|
||||
if(($setconfig['position_pc'] == 1 || $setconfig['position_pc'] == 2) && (!$setconfig['allow_forums'] || in_array($_G['fid'], $setconfig['allow_forums']))){
|
||||
foreach($postlist as $key => $post) {
|
||||
if(!$post['first'] || $setconfig['thread_reply']){
|
||||
$pids[] = $post['pid'];
|
||||
}
|
||||
}
|
||||
if($pids){
|
||||
if(!$setconfig['order_type']){
|
||||
$setconfig['order_type'] = empty($_GET['ordertype']) && getstatus($_G['forum_thread']['status'], 4) ? 1 : intval($_GET['ordertype']);
|
||||
}
|
||||
$orderby = 'order by createtime desc';
|
||||
if($setconfig['order_type'] == 2){
|
||||
$orderby = 'order by createtime asc';
|
||||
}
|
||||
$messageinfo = C::t('#'.self::$identifier.'#'.self::$identifier.'_message')->fetch_message_by_pid($pids, $setconfig['perpage_pc'], $orderby, $setconfig);
|
||||
foreach($postlist as $key => $post) {
|
||||
if($post['first'] && !$setconfig['thread_reply']){
|
||||
$t[] = '';
|
||||
}else{
|
||||
$count = $messageinfo[$post['pid']]['count'] ? $messageinfo[$post['pid']]['count'] : 0;
|
||||
$list = $messageinfo[$post['pid']]['list'];
|
||||
$_GET['ajaxtarget'] = 'replyfloor_content_'.$post['pid'];
|
||||
$multipage = multi($count, $setconfig['perpage_pc'], 1, 'plugin.php?id=replyfloor:index&tid='.$post['tid'].'&pid='.$post['pid'].($_GET['ordertype'] ? '&ordertype='.$_GET['ordertype'] : ''));
|
||||
$_GET['ajaxtarget'] = '';
|
||||
include template(self::$identifier.':viewthread');
|
||||
if($setconfig['position_pc'] == 1){
|
||||
$post['message'] .= $return;
|
||||
$postlist[$key] = $post;
|
||||
}else{
|
||||
$t[] = $return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $t;
|
||||
}
|
||||
|
||||
function viewthread_replyfloor_output() {
|
||||
global $_G,$postlist,$postno,$postnostick,$allowpostreply;
|
||||
$setconfig = $this->setconfig;
|
||||
$t = $pids = array();
|
||||
if($_G['inajax'] && (empty($_GET['viewpid']) || ($_GET['viewpid'] && $_GET['from']))){
|
||||
return $t;
|
||||
}
|
||||
if(($setconfig['position_pc'] == 3) && (!$setconfig['allow_forums'] || in_array($_G['fid'], $setconfig['allow_forums']))){
|
||||
foreach($postlist as $key => $post) {
|
||||
if(!$post['first'] || $setconfig['thread_reply']){
|
||||
$pids[] = $post['pid'];
|
||||
}
|
||||
}
|
||||
if($pids){
|
||||
if(!$setconfig['order_type']){
|
||||
$setconfig['order_type'] = empty($_GET['ordertype']) && getstatus($_G['forum_thread']['status'], 4) ? 1 : intval($_GET['ordertype']);
|
||||
}
|
||||
$orderby = 'order by createtime desc';
|
||||
if($setconfig['order_type'] == 2){
|
||||
$orderby = 'order by createtime asc';
|
||||
}
|
||||
$messageinfo = C::t('#'.self::$identifier.'#'.self::$identifier.'_message')->fetch_message_by_pid($pids, $setconfig['perpage_pc'], $orderby, $setconfig);
|
||||
foreach($postlist as $key => $post) {
|
||||
if($post['first'] && !$setconfig['thread_reply']){
|
||||
$t[] = '';
|
||||
}else{
|
||||
$count = $messageinfo[$post['pid']]['count'] ? $messageinfo[$post['pid']]['count'] : 0;
|
||||
$list = $messageinfo[$post['pid']]['list'];
|
||||
$_GET['ajaxtarget'] = 'replyfloor_content_'.$post['pid'];
|
||||
$multipage = multi($count, $setconfig['perpage_pc'], 1, 'plugin.php?id=replyfloor:index&tid='.$post['tid'].'&pid='.$post['pid'].($_GET['ordertype'] ? '&ordertype='.$_GET['ordertype'] : ''));
|
||||
$_GET['ajaxtarget'] = '';
|
||||
include template(self::$identifier.':viewthread');
|
||||
$t[] = $return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $t;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class plugin_replyfloor_group extends plugin_replyfloor {
|
||||
|
||||
function forumdisplay_top_output() {
|
||||
global $_G;
|
||||
$return = '';
|
||||
$setconfig = $this->setconfig;
|
||||
if($setconfig['allow_groups'] && !$this->_allow_groups($_G['forum'], $setconfig['allow_groups'])){
|
||||
return $return;
|
||||
}
|
||||
if($setconfig['add_replies']){
|
||||
$tids = array();
|
||||
foreach ($_G['forum_threadlist'] as $key => $value) {
|
||||
$tids[] = $value['tid'];
|
||||
}
|
||||
if(empty($tids)){
|
||||
return $return;
|
||||
}
|
||||
$wherearr = array();
|
||||
$wherearr[] = 'tid in ('.dimplode($tids).')';
|
||||
$wherearr[] = "status = '0'";
|
||||
$recordlist = DB::fetch_all('SELECT tid,count(*) as count FROM '.DB::table('plugin_replyfloor_message').($wherearr ? ' WHERE '.implode(' AND ', $wherearr) : '').' group by tid');
|
||||
$count = array();
|
||||
foreach ($recordlist as $value) {
|
||||
$count[$value['tid']] = $value['count'];
|
||||
}
|
||||
foreach ($_G['forum_threadlist'] as &$thread) {
|
||||
if($count[$thread['tid']]){
|
||||
$thread['allreplies'] += $count[$thread['tid']];
|
||||
}
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function viewthread_top_output() {
|
||||
global $_G,$allowpostreply;
|
||||
$setconfig = $this->setconfig;
|
||||
if(($setconfig['position_pc'] > 0) && (!$setconfig['allow_groups'] || $this->_allow_groups($_G['forum'], $setconfig['allow_groups']))){
|
||||
if($setconfig['add_replies']){
|
||||
$_G['forum_thread']['allreplies'] += C::t('#'.self::$identifier.'#'.self::$identifier.'_message')->count_by_search_where(array("tid = '".$_G['tid']."'", "status = '0'"));
|
||||
}
|
||||
include template(self::$identifier.':style');
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function viewthread_bottom_output() {
|
||||
global $_G,$allowpostreply, $swfconfig;
|
||||
$setconfig = $this->setconfig;
|
||||
if(($setconfig['position_pc'] > 0) && (!$setconfig['allow_groups'] || $this->_allow_groups($_G['forum'], $setconfig['allow_groups']))){
|
||||
include template(self::$identifier.':js');
|
||||
}
|
||||
if($setconfig['replace_pc'] == 1){
|
||||
if(!$_G['setting']['rewritestatus']){
|
||||
$_G['setting']['rewritestatus'] = array();
|
||||
}elseif(!is_array($_G['setting']['rewritestatus'])){
|
||||
$_G['setting']['rewritestatus'] = array($_G['setting']['rewritestatus']);
|
||||
}
|
||||
$_G['setting']['rewritestatus'][] = 'replyfloor_reply';
|
||||
$_G['setting']['output']['str']['search']['replyfloor'] = "showWindow('reply', this.href)";
|
||||
$_G['setting']['output']['str']['replace']['replyfloor'] = "replyfloor_reply(this.href)";
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function viewthread_postbottom_output() {
|
||||
global $_G,$postlist,$postno,$postnostick,$allowpostreply;
|
||||
$setconfig = $this->setconfig;
|
||||
$t = $pids = array();
|
||||
if($_G['inajax'] && (empty($_GET['viewpid']) || ($_GET['viewpid'] && $_GET['from']))){
|
||||
return $t;
|
||||
}
|
||||
if(($setconfig['position_pc'] == 1 || $setconfig['position_pc'] == 2) && (!$setconfig['allow_groups'] || $this->_allow_groups($_G['forum'], $setconfig['allow_groups']))){
|
||||
foreach($postlist as $key => $post) {
|
||||
if(!$post['first'] || $setconfig['thread_reply']){
|
||||
$pids[] = $post['pid'];
|
||||
}
|
||||
}
|
||||
if($pids){
|
||||
if(!$setconfig['order_type']){
|
||||
$setconfig['order_type'] = empty($_GET['ordertype']) && getstatus($_G['forum_thread']['status'], 4) ? 1 : intval($_GET['ordertype']);
|
||||
}
|
||||
$orderby = 'order by createtime desc';
|
||||
if($setconfig['order_type'] == 2){
|
||||
$orderby = 'order by createtime asc';
|
||||
}
|
||||
$messageinfo = C::t('#'.self::$identifier.'#'.self::$identifier.'_message')->fetch_message_by_pid($pids, $setconfig['perpage_pc'], $orderby, $setconfig);
|
||||
foreach($postlist as $key => $post) {
|
||||
if($post['first'] && !$setconfig['thread_reply']){
|
||||
$t[] = '';
|
||||
}else{
|
||||
$count = $messageinfo[$post['pid']]['count'] ? $messageinfo[$post['pid']]['count'] : 0;
|
||||
$list = $messageinfo[$post['pid']]['list'];
|
||||
$_GET['ajaxtarget'] = 'replyfloor_content_'.$post['pid'];
|
||||
$multipage = multi($count, $setconfig['perpage_pc'], 1, 'plugin.php?id=replyfloor:index&tid='.$post['tid'].'&pid='.$post['pid'].($_GET['ordertype'] ? '&ordertype='.$_GET['ordertype'] : ''));
|
||||
$_GET['ajaxtarget'] = '';
|
||||
include template(self::$identifier.':viewthread');
|
||||
if($setconfig['position_pc'] == 1){
|
||||
$post['message'] .= $return;
|
||||
$postlist[$key] = $post;
|
||||
}else{
|
||||
$t[] = $return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $t;
|
||||
}
|
||||
|
||||
function viewthread_replyfloor_output() {
|
||||
global $_G,$postlist,$postno,$postnostick,$allowpostreply;
|
||||
$setconfig = $this->setconfig;
|
||||
$t = $pids = array();
|
||||
if($_G['inajax'] && (empty($_GET['viewpid']) || ($_GET['viewpid'] && $_GET['from']))){
|
||||
return $t;
|
||||
}
|
||||
if(($setconfig['position_pc'] == 3) && (!$setconfig['allow_groups'] || $this->_allow_groups($_G['forum'], $setconfig['allow_groups']))){
|
||||
foreach($postlist as $key => $post) {
|
||||
if(!$post['first'] || $setconfig['thread_reply']){
|
||||
$pids[] = $post['pid'];
|
||||
}
|
||||
}
|
||||
if($pids){
|
||||
if(!$setconfig['order_type']){
|
||||
$setconfig['order_type'] = empty($_GET['ordertype']) && getstatus($_G['forum_thread']['status'], 4) ? 1 : intval($_GET['ordertype']);
|
||||
}
|
||||
$orderby = 'order by createtime desc';
|
||||
if($setconfig['order_type'] == 2){
|
||||
$orderby = 'order by createtime asc';
|
||||
}
|
||||
$messageinfo = C::t('#'.self::$identifier.'#'.self::$identifier.'_message')->fetch_message_by_pid($pids, $setconfig['perpage_pc'], $orderby, $setconfig);
|
||||
foreach($postlist as $key => $post) {
|
||||
if($post['first'] && !$setconfig['thread_reply']){
|
||||
$t[] = '';
|
||||
}else{
|
||||
$count = $messageinfo[$post['pid']]['count'] ? $messageinfo[$post['pid']]['count'] : 0;
|
||||
$list = $messageinfo[$post['pid']]['list'];
|
||||
$_GET['ajaxtarget'] = 'replyfloor_content_'.$post['pid'];
|
||||
$multipage = multi($count, $setconfig['perpage_pc'], 1, 'plugin.php?id=replyfloor:index&tid='.$post['tid'].'&pid='.$post['pid'].($_GET['ordertype'] ? '&ordertype='.$_GET['ordertype'] : ''));
|
||||
$_GET['ajaxtarget'] = '';
|
||||
include template(self::$identifier.':viewthread');
|
||||
$t[] = $return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $t;
|
||||
}
|
||||
|
||||
function _allow_groups($forum, $groupids) {
|
||||
global $_G;
|
||||
if(empty($forum) || empty($forum['fid']) || empty($forum['name'])) {
|
||||
return false;
|
||||
}
|
||||
loadcache('grouptype');
|
||||
$groupsecond = $_G['cache']['grouptype']['second'];
|
||||
if($forum['type'] == 'sub') {
|
||||
$secondtype = !empty($groupsecond[$forum['fup']]) ? $groupsecond[$forum['fup']] : array();
|
||||
} else {
|
||||
$secondtype = !empty($groupsecond[$forum['fid']]) ? $groupsecond[$forum['fid']] : array();
|
||||
}
|
||||
$firstid = !empty($secondtype) ? $secondtype['fup'] : (!empty($forum['fup']) ? $forum['fup'] : $forum['fid']);
|
||||
$firsttype = $_G['cache']['grouptype']['first'][$firstid];
|
||||
if($firsttype && in_array($firsttype['fid'], $groupids)) {
|
||||
return true;
|
||||
}
|
||||
if($secondtype && in_array($secondtype['fid'], $groupids)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user