136 lines
4.5 KiB
PHP
136 lines
4.5 KiB
PHP
<?php
|
|
|
|
/**
|
|
* This is NOT a freeware, use is subject to license terms
|
|
* 应用名称: 贴吧楼中楼回复 9.0
|
|
* 下载地址: https://addon.dismall.com/plugins/replyfloor.html
|
|
* 应用开发者: 乘凉
|
|
* 开发者QQ: 594433766
|
|
* 更新日期: 202505310549
|
|
* 授权域名: www.shitangsweet.com
|
|
* 授权码: 2025053105b89RrI3R9n
|
|
* 未经应用程序开发者/所有者的书面许可,不得进行反向工程、反向汇编、反向编译等,不得擅自复制、修改、链接、转载、汇编、发表、出版、发展与之有关的衍生产品、作品等
|
|
*/
|
|
|
|
|
|
if(!defined('IN_DISCUZ')) {
|
|
exit('Access Denied');
|
|
}
|
|
|
|
class replyfloor_apphook {
|
|
|
|
public static $identifier = 'replyfloor';
|
|
|
|
function __construct() {
|
|
global $_G;
|
|
if(empty($_G['cache']['plugin'][self::$identifier])){
|
|
loadcache('plugin');
|
|
}
|
|
$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['shownum_mobile'] = $setconfig['shownum_mobile'] > 0 ? $setconfig['shownum_mobile'] : 5;
|
|
$setconfig['perpage_mobile'] = $setconfig['perpage_mobile'] > 0 ? $setconfig['perpage_mobile'] : 10;
|
|
$this->setconfig = $setconfig;
|
|
}
|
|
|
|
//返回多个回复帖内的楼内回复条数及列表信息
|
|
public function getalllist($pids) {
|
|
global $_G;
|
|
$setconfig = $this->setconfig;
|
|
if(!$pids) {
|
|
return array();
|
|
}
|
|
$shownum = $setconfig['shownum_mobile'];
|
|
$perpage = $setconfig['perpage_mobile'];
|
|
$orderby = 'order by createtime desc';
|
|
if($setconfig['order_type'] == 2){
|
|
$orderby = 'order by createtime asc';
|
|
}
|
|
$messageinfo = C::t('#'.self::$identifier.'#replyfloor_message')->fetch_message_by_pid($pids, $perpage, $orderby, $setconfig);
|
|
foreach ($messageinfo as $key => $value) {
|
|
$value['shownum'] = $shownum;
|
|
$value['perpage'] = $perpage;
|
|
$messageinfo[$key] = $value;
|
|
}
|
|
return $messageinfo;
|
|
}
|
|
|
|
//返回单个回复帖内的楼内回复条数及列表信息
|
|
public function getlist($pid, $page) {
|
|
global $_G;
|
|
$setconfig = $this->setconfig;
|
|
require_once libfile('function/common', 'plugin/replyfloor');
|
|
$shownum = $setconfig['shownum_mobile'];
|
|
$perpage = $setconfig['perpage_mobile'];
|
|
$start = ($page-1)*$perpage;
|
|
$wherearr = array();
|
|
$wherearr[] = "status = '0'";
|
|
$wherearr[] = "pid = '".$pid."'";
|
|
$count = C::t('#'.self::$identifier.'#replyfloor_message')->count_by_search_where($wherearr);
|
|
$orderby = 'order by createtime desc';
|
|
if($setconfig['order_type'] == 2){
|
|
$orderby = 'order by createtime asc';
|
|
}
|
|
$list = C::t('#'.self::$identifier.'#replyfloor_message')->fetch_all_by_search_where($wherearr, $orderby, $start, $perpage);
|
|
$date_convert = $_G['setting']['dateconvert'];
|
|
$_G['setting']['dateconvert'] = $setconfig['date_convert'];
|
|
foreach ($list as $key => $value) {
|
|
$value['message'] = replyfloor_discuzcode($value['message']);
|
|
if($setconfig['show_br']) {
|
|
$value['message'] = nl2br($value['message']);
|
|
}
|
|
if($setconfig['show_location']) {
|
|
$value['location'] = replyfloor_location($value['postip']);
|
|
}else{
|
|
$value['location'] = '';
|
|
}
|
|
$value['createtime'] = dgmdate($value['createtime'], 'u');
|
|
$list[$key] = $value;
|
|
}
|
|
$_G['setting']['dateconvert'] = $date_convert;
|
|
$messageinfo = array('shownum' => $shownum, 'perpage' => $perpage, 'count' => $count, 'list' => $list);
|
|
return $messageinfo;
|
|
}
|
|
|
|
//返回单条楼内回复信息
|
|
public function getmsginfo($msgid) {
|
|
global $_G;
|
|
$setconfig = $this->setconfig;
|
|
$msgid = intval($msgid);
|
|
$msginfo = C::t('#'.self::$identifier.'#replyfloor_message')->fetch_by_id($msgid);
|
|
if(!$msginfo) {
|
|
return array();
|
|
}
|
|
require_once libfile('function/common', 'plugin/replyfloor');
|
|
$msginfo['message'] = replyfloor_discuzcode($msginfo['message']);
|
|
if($setconfig['show_br']) {
|
|
$msginfo['message'] = nl2br($msginfo['message']);
|
|
}
|
|
if($setconfig['show_location']) {
|
|
$msginfo['location'] = replyfloor_location($msginfo['postip']);
|
|
}else{
|
|
$msginfo['location'] = '';
|
|
}
|
|
$date_convert = $_G['setting']['dateconvert'];
|
|
$_G['setting']['dateconvert'] = $setconfig['date_convert'];
|
|
$msginfo['createtime'] = dgmdate($msginfo['createtime'], 'u');
|
|
$_G['setting']['dateconvert'] = $date_convert;
|
|
return $msginfo;
|
|
}
|
|
|
|
//提交楼内回复
|
|
public function reply($pids) {
|
|
global $_G;
|
|
$setconfig = $this->setconfig;
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|