Discuz精品商业插件主题列表图片显示最新V4.4商业版.zip资源
2024-12-26 15:07
<?php
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
class plugin_showimg_dzx{
function forumdisplay_output() {
global $_G;
$fid = getgpc('fid');
if($fid) {
$fid = is_numeric($fid) ? intval($fid) : (!empty($_G['setting']['forumfids'][$fid]) ? $_G['setting']['forumfids'][$fid] : 0);
}
$forumset = unserialize($_G['cache']['forums'][$fid]['plugin']['showimg_dzx']['forum_setting']);
$forumset['wf_pages'] = $forumset['wf_pages']?$forumset['wf_pages']:5;
if(in_array(0,$forumset['content_show'])){
$content_show = 1;
}
if($forumset['forum_type'] >= 3 and $forumset['forum_type']<5){
$forumname = strip_tags($_G['forum']['name']);
//设置SEO
$navtitle = strip_tags($_G['forum']['name']);
//$_G['forum']['name'] = $_G['forum']['seotitle'];
$metakeywords = $_G['forum']['keywords'];
$metadescription = $_G['forum']['seodescription'];
if(!$metakeywords) {
$metakeywords = $_G['forum']['name'];
}
if(!$metadescription) {
$metadescription = $_G['forum']['name'];
}
//子版块
foreach($_G['cache']['forums'] as $sub) {
if($sub['type'] == 'sub' && $sub['fup'] == $_G['fid'] && (!$_G['setting']['hideprivate'] || !$sub['viewperm'] || forumperm($sub['viewperm']) || strstr($sub['users'], " $_G[uid] "))) {
if(!$sub['status']) {
continue;
}
$subexists = 1;
$sublist = array();
$query = C::t('forum_forum')->fetch_all_info_by_fids(0, 'available', 0, $_G['fid'], 1, 0, 0, 'sub');
if(!empty($_G['member']['accessmasks'])) {
$fids = array_keys($query);
$accesslist = C::t('forum_access')->fetch_all_by_fid_uid($fids, $_G['uid']);
foreach($query as $key => $val) {
$query[$key]['allowview'] = $accesslist[$key];
}
}
foreach($query as $sub) {
$sub['extra'] = dunserialize($sub['extra']);
if(!is_array($sub['extra'])) {
$sub['extra'] = array();
}
if(forum($sub)) {
$sub['orderid'] = count($sublist);
$sublist[] = $sub;
}
}
break;
}
}
if($subexists) {
if($_G['forum']['forumcolumns']) {
$_G['forum']['forumcolwidth'] = (floor(100 / $_G['forum']['forumcolumns']) - 0.1).'%';
$_G['forum']['subscount'] = count($sublist);
$_G['forum']['endrows'] = '';
if($colspan = $_G['forum']['subscount'] % $_G['forum']['forumcolumns']) {
while(($_G['forum']['forumcolumns'] - $colspan) > 0) {
$_G['forum']['endrows'] .= '<td> </td>';
$colspan ++;
}
$_G['forum']['endrows'] .= '</tr>';
}
}
if(empty($_G['cookie']['collapse']) || strpos($_G['cookie']['collapse'], 'subforum_'.$_G['fid']) === FALSE) {
$collapse['subforum'] = '';
$collapseimg['subforum'] = 'collapsed_no.gif';
} else {
$collapse['subforum'] = 'display: none';
$collapseimg['subforum'] = 'collapsed_yes.gif';
}
}
if(!empty($_GET['forumdefstyle'])){ //设置文字还是图片模式
$forumdefstyle = isset($_GET['forumdefstyle']) ? $_GET['forumdefstyle'] : '';
if($forumdefstyle) {
switch($forumdefstyle) {
case 'no': dsetcookie('forumdefstyle', ''); break;
case 'yes': dsetcookie('forumdefstyle', 1, 31536000); break;
}
}
}
//版规展开、关闭图片
if(!isset($_G['cookie']['collapse']) || strpos($_G['cookie']['collapse'], 'forum_rules_'.$_G['fid']) === FALSE) {
$collapse['forum_rules'] = '';
$collapse['forum_rulesimg'] = 'no';
} else {
$collapse['forum_rules'] = 'display: none';
$collapse['forum_rulesimg'] = 'yes';
}
if($_GET['mod']=='forumdisplay' and $_GET['forumdefstyle']!='yes' and $_G['cookie']['forumdefstyle']!=1){
$navtitle = $_G['forum']['name']; //版块标题名称
$forum_up = $_G['cache']['forums'][$_G['forum']['fup']];
if($_G['forum']['type'] == 'forum') {
$fgroupid = $_G['forum']['fup'];
if(empty($_GET['archiveid'])) {
$navigation = ' <em>›</em> <a href=https://download.csdn.net/download/cy810/"forum.php?gid='.$forum_up['fid'].'">'.$forum_up['name'].'</a><em>›</em> <a href=https://download.csdn.net/download/cy810/"forum.php?mod=forumdisplay&fid='.$_G['forum']['fid'].'">'.$_G['forum']['description'].'</a>';
} else {
$navigation = ' <em>›</em> '.'<a href=https://download.csdn.net/download/cy810/"forum.php?mod=forumdisplay&fid='.$_G['fid'].'">'.$_G['forum']['name'].'</a> <em>›</em> '.$forumarchive[$_GET['archiveid']]['displayname'];
}
$seodata = array('forum' => $_G['forum']['name'], 'fgroup' => $forum_up['name'], 'page' => intval($_GET['page']));
}
$_G['setting']['forumpicstyle']['thumbwidth'] = $forumset['pic_width'];
$_G['setting']['forumpicstyle']['thumbheight'] = $forumset['pic_height'];
if(empty($forumset['digest_len'])){
$clen = 100; //内容摘要长度
}else{
$clen = $forumset['digest_len']; //内容摘要长度
}
$page = $_G['page'];
$subforumonly = $_G['forum']['simple'] & 1;
$language = lang('forum/misc');
foreach($_G['forum_threadlist'] as $key => $value){
$_G['forum_threadlist'][$key]['coverpath'] = getthreadcover($value['tid'], $value['cover']);
$_G['forum_threadlist'][$key]['avatar'] = avatar($value['authorid'],'small',true);
$post = DB::fetch_first("SELECT * FROM ".DB::table('forum_post')." WHERE tid='{$value['tid']}' and first=1");
if(in_array(0,$forumset['content_show'])){
$_G['forum_threadlist'][$key]['content'] = cutstr(ubb(strip_tags($post['message'])),$clen);
$_G['forum_threadlist'][$key]['content'] = preg_replace(lang('plugin/showimg_dzx','btzhyybj'), '', $_G['forum_threadlist'][$key]['content']);
}
//今天发表的用红色
if($_G['forum_threadlist'][$key]['istoday']){
$_G['forum_threadlist'][$key][dateline] = str_replace('<span ','<span style="color:#f26c4f;"',$_G['forum_threadlist'][$key][dateline]);
}
//加载特殊主题调用模板
$_G['forum_threadlist'][$key]['callcontent'] = loadtemplate($value,$forumset);
}
include('source/language/forum/lang_template.php');
if($forumset['forum_type'] == 3){
$multipage = multi($_G['forum_threadcount'], $_G['tpp'], $page, "forum.php?mod=forumdisplay&fid=$_G[fid]".$sqlsid.$forumdisplayadd['page'].($multiadd ? '&'.implode('&', $multiadd) : '')."$multipage_archive", $_G['setting']['threadmaxpages']);
include template('showimg_dzx:pu');
}elseif($forumset['forum_type'] == 4){
$multipage = multi($_G['forum_threadcount'], $_G['tpp'], $page, "forum.php?mod=forumdisplay&fid=$_G[fid]".$sqlsid.$forumdisplayadd['page'].($multiadd ? '&'.implode('&', $multiadd) : '')."$multipage_archive", $_G['setting']['threadmaxpages']);
$lang = lang('forum/template');
include template('showimg_dzx:list_style_1');
}
exit;
}else{
return;
}
}
}
function common() {
global $_G;
$fid = intval($_G['fid']);
$forumset = unserialize($_G['cache']['forums'][$fid]['plugin']['showimg_dzx']['forum_setting']);
if($forumset['forum_type']>1 && $_G['gp_mod'] == 'viewthread'){ //如果是图片模板就显示设为封面按钮
$_G['forum']['picstyle'] = 1;
}
}
function discuzcode(){
global $_G,$post;
//print_r($_G['discuzcodemessage']);
$message = $_G['discuzcodemessage'];
if($post['first']==1){
if($_G['groupid']<=3 or $_G['uid']==$_G['forum_thread']['authorid']){
$msglower = strtolower($message);
$allowimgcode = 1;
if(strpos($msglower, '[/img]') !== FALSE) {
$message = preg_replace(array(
"/[img]s*([^[<
]+?)s*[/img]/ies",
"/[img=(d{1,4})[x|,](d{1,4})]s*([^[<
]+?)s*[/img]/ies"
), $allowimgcode ? array(
"parseimg2('', '', '\1','".$_G['tid']."')",
"parseimg2('\1', '\2', '\3','".$_G['tid']."')"
) : array(