廣告廣告
  加入我的最愛 設為首頁 風格修改
首頁 首尾
 手機版   訂閱   地圖  簡體 
您是第 7410 個閱讀者
 
發表文章 發表投票 回覆文章
  可列印版   加為IE收藏   收藏主題   上一主題 | 下一主題   
ajdfajdfl 手機
數位造型
個人文章 個人相簿 個人日記 個人地圖
初露鋒芒
級別: 初露鋒芒 該用戶目前不上站
推文 x9 鮮花 x141
分享: 轉寄此文章 Facebook Plurk Twitter 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片
推文 x0
[][分享] [完整版]首頁四格 for Discuz! 5.0
在此感謝瑋少

我知道下面有了,可是我覺得這個比較完整,轉貼自AL8 Forum。

首頁四格(含高亮顯示)修改只需3步,for Discuz! 5.0

適用版本:discuz5.0
作者:ytc
修改:瑋少
修改文件:index.php
修改模板:index.htm
功能:含高亮顯示,但會增加兩個查詢
演示:http://www.superairh...dex.php

1.上傳模版indexfour.htm到templates/default

2.修改index.php


$newthreads = round(($timestamp - $lastvisit + 600) / 1000) * 1000;

在下面加上

//新貼//
$hack_cut_str = 36; //修改標題顯示字數
$new_post_threadlist = array();
$nthread = array();
$colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
$query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>'$fid' 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));
if($nthread['highlight']) {
    $string = sprintf('%02d', $nthread['highlight']);
    $stylestr = sprintf('%03b', $string[0]);
    $nthread['highlight'] = 'style="'
    $nthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : ''
    $nthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : ''
    $nthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : ''
    $nthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : ''
    $nthread['highlight'] .= '"'
  } else {
    $nthread['highlight'] = ''
  }

    $new_post_threadlist[] = $nthread;
}
//新貼//
//新回覆
$hack_cut_str = 36; //修改標題顯示字數
$new_reply_threadlist = array();
$rthread = array();
$colorarray = array('', 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'purple', 'gray');
$query = $db->query("SELECT t.*, f.name FROM {$tablepre}threads t, {$tablepre}forums f WHERE t.fid<>'$fid' 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));
if($rthread['highlight']) {
    $string = sprintf('%02d', $rthread['highlight']);
    $stylestr = sprintf('%03b', $string[0]);
    $rthread['highlight'] = 'style="'
    $rthread['highlight'] .= $stylestr[0] ? 'font-weight: bold;' : ''
    $rthread['highlight'] .= $stylestr[1] ? 'font-style: italic;' : ''
    $rthread['highlight'] .= $stylestr[2] ? 'text-decoration: underline;' : ''
    $rthread['highlight'] .= $string[1] ? 'color: '.$colorarray[$string[1]] : ''
    $rthread['highlight'] .= '"'
  } else {
    $rthread['highlight'] = ''
  }

    $new_reply_threadlist[] = $rthread;
}
//回覆//


3.修改Discuz.htm


<div style="width: {TABLEWIDTH}; clear: both; overflow: hidden;">

<div class="left" style="line-height: 18px;">
<span class="bold"><!--{if $gid || !$discuz_uid}--><a href="$indexname">$bbname</a><!--{else}-->$discuz_user<!--{/if}-->
<!--{if $supe_status && $discuz_uid}-->
-
    <!--{if !$xspacestatus}-->
          <a href="$supe_siteurl/index.php?action/register" target="_blank">{lang supe_signin_xspace}</a>
    <!--{else}-->
          <a href="$supe_siteurl/index.php?action/space/uid/$discuz_uid" target="_blank">{lang supe_myxspace}</a>
    <!--{/if}-->
<!--{/if}-->
</span>
<br>
{lang credits}: <span class="bold smalltxt">$credits</span> <span id="creditlist">{lang credits_detail}<script type="text/javascript">menuregister(false, "creditlist", true)</script></span> / {lang index_status}:
<!--{if $validdays}-->
    <a href="member.php?action=groupexpiry"><span class="bold">$grouptitle</span>($validdays)</a>
<!--{else}-->
    <span class="bold">$grouptitle</span><!--{/if}-->
<!--{if $allowinvisible && $discuz_uid}-->{lang online_status}:
    <!--{if !empty($invisible)}-->
          <a href="member.php?action=switchstatus" title="{lang login_switch_normal_mode}">{lang login_invisible_mode}</a>
    <!--{else}-->
          <a href="member.php?action=switchstatus" title="{lang login_switch_invisible_mode}">{lang login_normal_mode}</a>
    <!--{/if}-->
<!--{/if}--><br>
{lang your_lastvisit} <span class="smalltxt">$lastvisittime</span><br>
</div>

<div class="right" style="line-height: 18px;">
<a href="search.php?srchfrom=$newthreads&searchsubmit=yes">{lang show_newthreads}</a> |
<!--{if $discuz_uid}-->
    <!--{if $allowuseblog}-->
          <a href="blog.php?uid=$discuz_uid" target="_blank">{lang blog}</a> |
    <!--{/if}-->
<!--{/if}-->
<a href="digest.php">{lang digest}</a> |
<a href="member.php?action=markread">{lang mark_read}</a>
<!--{if $rssstatus}--><a href="rss.php?auth=$rssauth" target="_blank"><img src="images/common/xml.gif" border="0" class="absmiddle" alt="{lang rss_subscribe_all}" /></a><!--{/if}-->
<br>
{lang total} <span class="smalltxt">$threads</span> {lang index_threads} / <span class="smalltxt">$posts</span> {lang index_posts} / {lang index_today} <span class="smalltxt">$todayposts</span> {lang index_posts}<br>
{lang total} <span class="smalltxt">$totalmembers</span> {lang index_members} / {lang welcome_newmember} <a href="viewpro.php?username=$memberenc"><span class="bold">$lastmember</span></a>
</div>

</div><br>

<!--{if empty($gid)}-->
    <!--{if !empty($announcements)}-->
          <div id="announcement" style="clear: both; width: {TABLEWIDTH}">$announcements</div>
          <script type="text/javascript">announcement();</script>
    <!--{/if}-->
    <!--{if $qihoo_status && $searchboxstatus}-->
          <div class="subtable" style="clear: both; width: {TABLEWIDTH}">
          <div class="right">
          <form method="post" action="search.php?srchtype=qihoo" onSubmit="this.target='_blank'">
          <input type="hidden" name="searchsubmit" value="yes">
          <input type="text" name="srchtxt" value="$qihoo_searchboxtxt" size="30" class="input" style="{BGCODE};" onmouseover="this.focus();this.value=''this.onmouseover=null;">
          <select name="stype"><option value="" selected>{lang qihoo_search_filltext}</option><option value="1">{lang qihoo_search_title}</option><option value="2">{lang qihoo_search_author}</option></select>
          <input name="searchsubmit" class="button" type="submit" value="{lang search}">
          </form>
          </div>
          <!--{if $qihoo_links['keywords']}-->
                <span class="bold">{lang qihoo_hot_searches}</span>
                <!--{loop $qihoo_links['keywords'] $link}-->
                    $link
                <!--{/loop}-->
          <!--{/if}-->
          </div>
          <div class="subtable" style="clear: both; width: {TABLEWIDTH}">
          <div class="right">
          <!--{if $customtopics}-->
                <span class="bold">{lang qihoo_custom_topics}</span> $customtopics [<a href="###" onclick="window.open('misc.php?action=customtopics', '', 'width=320,height=450,resizable=yes,scrollbars=yes');">{lang edit}</a>]
          <!--{/if}-->
          </div>
          <!--{if $qihoo_links['topics']}-->
                <span class="bold">{lang qihoo_topics}</span>
                <!--{loop $qihoo_links['topics'] $url}-->
                    {$url}
                <!--{/loop}-->
          <!--{/if}-->
          </div>
    <!--{/if}-->
<!--{/if}-->


修改為

<!--{if !empty($announcements)}-->
          <div id="announcement" style="clear: both; width: {TABLEWIDTH}">$announcements</div>
          <script type="text/javascript">announcement();</script>
    <!--{/if}-->
<!--{if empty($gid)}-->
{template indexfour}
<!--{/if}-->


本帖包含附件
zip indexfour.rar   (2022-06-09 14:02 / 2 KB)  
說明:
下載次數:34


[ 此文章被ajdfajdfl在2007-01-31 09:09重新編輯 ]




獻花 x0 回到頂端 [樓 主] From:臺灣中華HiNet | Posted:2007-01-30 14:10 |

首頁  發表文章 發表投票 回覆文章
Powered by PHPWind v1.3.6
Copyright © 2003-04 PHPWind
Processed in 0.035502 second(s),query:15 Gzip disabled
本站由 瀛睿律師事務所 擔任常年法律顧問 | 免責聲明 | 本網站已依台灣網站內容分級規定處理 | 連絡我們 | 訪客留言