<?php
/**
* 维清工作室 [ 专业开发各种Discuz!插件 ]
*
* Copyright (c) 2011-2012 http://www.weiqing.org All rights reserved.
*
* Author: wuchunuan <wuchunuan@163.com
*
* $Id: index.inc.php 2013-1-20 上午02:44:08Z wuchunuan $
*/
if(!defined('IN_DISCUZ')) {
exit('Access Denied');
}
//setting
$setting = $_G['cache']['plugin']['wq_viewthread'];
$plugin_name = trim($setting['plugin_name']);
$forums = unserialize($setting['forums']);
$perpage = intval($setting['perpage']);
$title_num = intval($setting['title_num']);
$contents_num = intval($setting['contents_num']);
$navtitle = trim($setting['seo_title']);
$metakeywords = trim($setting['seo_keyword']);
$metadescription = trim($setting['seo_discript']);
$is_attament = intval($setting['is_attament']);
$page = intval($_G['page']);
$page = $page <= 0 ? 1 : $page;
$start = ($page - 1) * $perpage;
$plugin_nav = lang('plugin/wq_viewthread', 'plugin_nav_index');
$week = array(
lang('plugin/wq_viewthread', 'week0'),
lang('plugin/wq_viewthread', 'week1'),
lang('plugin/wq_viewthread', 'week2'),
lang('plugin/wq_viewthread', 'week3'),
lang('plugin/wq_viewthread', 'week4'),
lang('plugin/wq_viewthread', 'week5'),
lang('plugin/wq_viewthread', 'week6'),
);
//thread
$conditions = " t.fid IN (".dimplode($forums).") AND t.displayorder = '0' AND p.first = '1'";
if($is_attament == '1'){
$conditions .= " AND t.attachment = '2'";
}
$sql = "SELECT t.*,p.message FROM ".DB::table('forum_thread')." t , ".DB::table('forum_post')." p WHERE ".$conditions." AND t.tid = p.tid ORDER BY t.dateline DESC LIMIT {$start},{$perpage}";
$sql_count = "SELECT count(*) FROM ".DB::table('forum_thread')." t , ".DB::table('forum_post')." p WHERE ".$conditions." AND t.tid = p.tid";
$count = DB::result_first($sql_count);
$url = "plugin.php?id=wq_viewthread:index";
$multipage = multi($count, $perpage, $page, $url, 0, 10);
$list_sql = DB::query($sql);
while($row = DB::fetch($list_sql)){
$row['start_ymd'] = date("Y-m-d",$row['dateline']);
$row['start_d'] = date("d",$row['dateline']);
$row['start_w'] = $week[date("w",$row['dateline'])];
$row['subject_s'] = cutstr($row['subject'],$title_num);
$row['message'] = archivermessage($row[message]);
$row['message'] = cutstr($row['message'],$contents_num);
$row['fname'] = DB::result_first("SELECT name FROM ".DB::table('forum_forum')." WHERE fid = '".$row['fid']."'");
$img = DB::fetch_first("SELECT attachment,remote FROM ".DB::table("forum_threadimage")." WHERE tid='".$row[tid]."'");
if($img['attachment']){
if($img['remote']==1){
$imgurl = $_G['setting']['ftp']['attachurl']."forum/".$img['attachment'];
}else{
$imgurl = $_G['setting']['attachurl']."forum/".$img['attachment'];
}
}else{
$imgurl = "./static/image/common/nophoto.gif";
}
$row['imgurl'] = $imgurl;
$list[] = $row;
}
$count_list = count($list) - 1;
include template('wq_viewthread:index');
//common
function archivermessage($message){
$message=nl2br($message);
$message=strip_tags($message);
$message=preg_replace('/\[attach\](.+?)\[\/attach\]/is','',$message);
$message=preg_replace('/\[img\](.+?)\[\/img\]/is','',$message);
$message=preg_replace('/\[audio\](.+?)\[\/audio\]/is','',$message);
$message=preg_replace('/\[media\](.+?)\[\/media\]/is','',$message);
$message=preg_replace('/\[flash\](.+?)\[\/flash\]/is','',$message);
$message=preg_replace("/\[hide=?\d*\](.*?)\[\/hide\]/is",'',$message);
$message=preg_replace("/\[\/?\w+=?.*?\]/",'',$message);
return $message;
}
?>
没有合适的资源?快使用搜索试试~ 我知道了~
时光轴最新修复版商业插件discuzX3
共11个文件
xml:4个
gif:3个
php:1个
5星 · 超过95%的资源 需积分: 9 34 下载量 64 浏览量
2013-11-13
10:22:55
上传
评论 1
收藏 12KB RAR 举报
温馨提示
时光轴最新修复版商业插件discuzX3 discuz商业版插件支持最新的discuzX3.0 3.1 2.5等各个版本的
资源推荐
资源详情
资源评论
收起资源包目录
discuz商业版插件时光轴.rar (11个子文件)
时光轴
wq_viewthread
discuz_plugin_wq_viewthread_SC_UTF8.xml 6KB
index.inc.php 4KB
discuz_plugin_wq_viewthread_TC_UTF8.xml 6KB
discuz_plugin_wq_viewthread_TC_BIG5.xml 6KB
discuz_plugin_wq_viewthread_SC_GBK.xml 6KB
template
images
line.gif 174B
jiantou4.gif 347B
jiantou3.gif 343B
mis_03.jpg 531B
index.htm 4KB
index.css 9KB
共 11 条
- 1
资源评论
- qq_322302652015-11-28可以用。。。
- QQ64224582014-03-20代码不是很全
- crbb2014-05-08其实最重要的还是需要学习原理
- cfchat2014-03-17自己改了改,用着还是很不错的
hzcftk
- 粉丝: 0
- 资源: 15
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功