=======================================
名稱:首頁左方顯示論壇資料~美化版
=======================================
最後修改﹕~死性不改~@utalk論壇
小改:文文の封印
安裝條件﹕Discuz!2.5F or SP1
=======================================
我给小改了一下,看你想要那个了,我的演示看
演示:
原作者的
我自己修改的
我改的在2楼
安装开始~
Step 1.
上传left_index.htm到templates\default
Step 2.
修改index.php,找
- require DISCUZ_ROOT.'./include/forum.php';
复制代码
下面加入
- require DISCUZ_ROOT.'./include/misc.php';
复制代码
找
- $newthreads = round(($timestamp - $lastvisit + 600) / 1000) * 1000;
复制代码
下面加入
- //---------------hack Meminfo start
- if(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "MSIE 6.0")) {
- $visitor_browser = "Internet Explorer 6.0";
- } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "MSIE 5.5")) {
- $visitor_browser = "Internet Explorer 5.5";
- } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "MSIE 5.0")) {
- $visitor_browser = "Internet Explorer 5.0";
- } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "MSIE 4.01")) {
- $visitor_browser = "Internet Explorer 4.01";
- } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "NetCaptor")) {
- $visitor_browser = "NetCaptor";
- } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Netscape")) {
- $visitor_browser = "Netscape";
- } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Lynx")) {
- $visitor_browser = "Lynx";
- } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Opera")) {
- $visitor_browser = "Opera";
- } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Konqueror")) {
- $visitor_browser = "Konqueror";
- } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Mozilla")) {
- $visitor_browser = "Mozilla";
- } else {
- $visitor_browser = "其它";
- }
- //上面的是瀏覽器//
- if(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "NT 5.1")) {
- $visitor_os = "Windows XP";
- }elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "NT 5.2")) {
- $visitor_os = "Windows Server 2003";
- }elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "NT 5")) {
- $visitor_os = "Windows 2000";
- } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "4.9")) {
- $visitor_os = "Windows ME";
- } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "NT 4")) {
- $visitor_os = "Windows NT 4.0";
- } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "98")) {
- $visitor_os = "Windows 98";
- } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "95")) {
- $visitor_os = "Windows 95";
- } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Mac")) {
- $visitor_os = "Mac";
- } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Linux")) {
- $visitor_os = "Linux";
- } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "Unix")) {
- $visitor_os = "Unix";
- } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "FreeBSD")) {
- $visitor_os = "FreeBSD";
- } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "SunOS")) {
- $visitor_os = "SunOS";
- } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "BeOS")) {
- $visitor_os = "BeOS";
- } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "OS/2")) {
- $visitor_os = "OS/2";
- } elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "PC")) {
- $visitor_os = "Macintosh";
- }elseif(strpos($HTTP_SERVER_VARS[HTTP_USER_AGENT], "AIX")) {
- $visitor_os = "AIX";
- } else {
- $visitor_os = "其他";
- }
- $mem_home = convertip($onlineip, $datadir = "./");
- //info//
- //新貼//
- $hack_cut_str = 36; //修改標題顯示字數
- $new_post_threadlist = array();
- $nthread = array();
- $query = $db->query("SELECT t.*, f.name FROM $table_threads t, $table_forums f WHERE f.password='' AND t.fid<>'$fid' AND (f.viewperm='' or f.viewperm LIKE '%\t$groupid\t%') AND f.fid=t.fid ORDER BY t.dateline DESC LIMIT 0, 10");
- while($nthread = $db->fetch_array($query)) {
- $nthread['forumname'] = $nthread['name'];
- $nthread['view_subject'] = cutstr($nthread['subject'],$hack_cut_str);
- $nthread['date']= gmdate("$dateformat $timeformat", $nthread['dateline'] + $timeoffset * 3600);
- $nthread['lastreplytime']= gmdate("$dateformat $timeformat", $nthread[lastpost] + ($timeoffset * 3600));
- $new_post_threadlist[] = $nthread;
- }
- //新貼//
- //新回覆
- $hack_cut_str = 36; //修改標題顯示字數
- $new_reply_threadlist = array();
- $rthread = array();
- $query = $db->query("SELECT t.*, f.name FROM $table_threads t, $table_forums f WHERE f.password='' AND t.fid<>'$fid' AND (f.viewperm='' or f.viewperm LIKE '%\t$groupid\t%') AND f.fid=t.fid AND t.closed NOT LIKE 'moved|%' AND t.replies !=0 ORDER BY t.lastpost DESC LIMIT 0, 10");
- while($rthread = $db->fetch_array($query)) {
- $rthread['forumname'] = $rthread['name'];
- $rthread['view_subject'] = cutstr($rthread['subject'],$hack_cut_str);
- $rthread['date']= gmdate("$dateformat $timeformat", $rthread['dateline'] + $timeoffset * 3600);
- $rthread['lastreplytime']= gmdate("$dateformat $timeformat", $rthread[lastpost] + ($timeoffset * 3600));
- $new_reply_threadlist[] = $rthread;
- }
- //回覆//
复制代码
Step 3.
修改index.htm模板
找
(或者你觉得合适的位置)
下面加入
[ Last edited by 文文の封印 on 2005-6-6 at 16:30 ]
[ 本帖最后由 文文の封印 于 2005-7-5 18:03 编辑 ] |