廣告廣告
  加入我的最愛 設為首頁 風格修改
首頁 首尾
 手機版   訂閱   地圖  簡體 
您是第 22912 個閱讀者
 
發表文章 發表投票 回覆文章
  可列印版   加為IE收藏   收藏主題   上一主題 | 下一主題   
香吉士 手機
個人文章 個人相簿 個人日記 個人地圖
特殊貢獻獎 創作大師獎 創作大師獎-2 創作大師獎-3
知名人士
級別: 知名人士 該用戶目前不上站
推文 x234 鮮花 x555
分享: 轉寄此文章 Facebook Plurk Twitter 版主評分 複製連結到剪貼簿 轉換為繁體 轉換為簡體 載入圖片
推文 x0
[7.0][分享] 主題描述  (UTF-8)
精華文章
【插件資訊】

插件名稱:主題描述
適用版本:7.0
語言編碼:UTF-8
插件作者:tcshek (參考 NSC 的「主題描述 For D4.1」作出改良)
版權所屬:tcshek | 小修改:香吉士
原帖連結:http://www.alan888.com/Discuz/...-1-4.html###
支持網站:http://allen.ncc.to/viewthread.php?tid=93&extra=page%3D1

【插件說明】

數據升級: 一個
修改檔: ./post.php , ./include/newthread.inc.php , ./include/editpost.inc.php
修改範本: forumdisplay.htm , search_threads.htm, post.htm , viewthread.node.htm
修改語言包:message.lang.php
插件功能簡介: 在標題下加上主題描述。
備注1:轉貼請注明來源與作者。
備注2:由於過程蠻復雜,可能會有地方貼錯,請有問題者提出來討論。
備注3:因為我覺得他原來的不好看,所以小小修改 差不多跟數位男女一樣了 表情
範例:



修改開始








MYSQL:後台資料庫升級
複製程式
ALTER TABLE `cdb_threads` ADD `description` CHAR( 80 ) DEFAULT NULL AFTER `subject` ;









第一步:打開./post.php
搜索:複製程式
$subject = isset($subject) ? dhtmlspecialchars(censor(trim($subject))) : '';

下面加:複製程式
$description = isset($description) ? dhtmlspecialchars(censor(trim($description))) :'';

搜索:複製程式
 $subject = !empty($subject) ? str_replace("\t", ' ', $subject) : $subject;

下面加:$description = stripslashes($description);






第二步:打開./include/newthread.inc.php
搜索:複製程式
        if(!$sortid && !$special && $message == '') { 
                showmessage('post_sm_isnull'); 
        }

下面加:複製程式
               if(strlen(htmlspecialchars($description)) > 60) { 
                                showmessage('post_description_toolong'); 
                 } 

搜索: (搜尋第一個.第二個不要)
下面這個部份
db->query("INSERT INTO {$tablepre}threads (fid, readperm, price, iconid, typeid, sortid, author, authorid, subject,
複製程式
 authorid, subject, 

替代:複製程式
 authorid, subject, description,

搜索: (搜尋第一個.第二個不要)
下面這個部份
VALUES ('$fid', '$readperm', '$price', '$iconid', '$typeid', '$sortid', '$author', '$discuz_uid', '$subject',
複製程式
 '$discuz_uid', '$subject',

替代:複製程式
 '$discuz_uid', '$subject', '$description',









文件-第三步:打開./include/editpost.inc.php
搜索:複製程式
if(!submitcheck('editsubmit')) { 

下面加:複製程式
     if($isfirstpost) { 
        $query = $db->query("SELECT description FROM {$tablepre}threads WHERE tid='$tid' AND fid='$fid'"); 
        $threadinfo = $db->fetch_array($query); 
    }

搜索:複製程式
$postinfo['subject'] = str_replace('"', '"', $postinfo['subject']); 

下面加:複製程式
$threadinfo['description'] = str_replace('"', '"', $threadinfo['description']); 

搜索:複製程式
                         if(!$sortid && !$thread['special'] && $message == '') { 
                                showmessage('post_sm_isnull'); 
                        }

下面加:複製程式
                                                 if(strlen(htmlspecialchars($description)) > 60) { 
                                                                 showmessage('post_description_toolong'); 
                                                }

搜索:複製程式
 subject='$subject',

在這句之後加上:複製程式
description='$description', 








模版-第一步:打開./templates/default/forumdisplay.htm
搜索:複製程式
                                                         <!--{if $thread['new']}--> 
                                                                <a href="redirect.php?tid=$thread[tid]&goto=newpost$highlight#newpost" class="new">New</a> 
                                                        <!--{/if}-->

在之後加上:複製程式
$thread[multipage]<br><span style="color:#006600 "><FONT size=1><P align=right>$thread[description]</P></FONT></span> 

**   size= 可以調 我是條1  圖說:
上面的 color:#006600 這裡設成綠色,你可以改成你想要的顏色、<P align=right>看你要靠哪一邊? 我試設右邊(因為跟數位男女一樣)圖說:






模版-第二步:打開./templates/default/search_threads.htm

搜索:複製程式
 <!--{if $thread[multipage]}--><span class="threadpages">$thread[multipage]</span><!--{/if}-->

整段替換成:複製程式
<!--{if $thread[multipage]}--><SPAN class=threadpages>$thread[multipage]<BR><SPAN style="COLOR: #C0C0C0">$thread[description]</SPAN></SPAN><!--{/if}--> 







模版-第三步:打開./templates/default/viewthread.node.htm

搜索: 複製程式
 $thread[subject]

在這句之後加上:複製程式
 <br><FONT color=#009900>$thread[description]</FONT>

圖說:





模版-第四步:打開./templates/default/post.htm

搜索:複製程式
<!--{if !empty($modelid) && $threadsorts[modelid][$tsortid] == $modelid || empty($modelid)}--> 
                                                                <option value="$tsortid"{if $sortid == $tsortid} selected="selected"{/if}>{echo strip_tags($name);}</option> 
                                                        <!--{/if}--> 
                                                <!--{/loop}--> 
                                                </select> 
                                        </div> 
                                        <!--{/if}--> 

在下面加上:複製程式
<div class="altbg1" width="20%" align=left>副標題(可免填):<input type="text" name="description" size="50" value=" $threadinfo[description] " tabindex="4"></div> 

size="50" 依個人喜好調整  圖說:




語言包-第一步:打開./templates/default/messages.lang.php

搜索:複製程式
 'post_subject_toolong' => '對不起,您的標題超過 80 個字符,請返回修改標題長度。',

在下面加上:複製程式
 'post_description_toolong' => '對不起,您的主題描述超過 80 個字元,請返回修改描述長度。', 






更新緩存OK!


反安裝數據
複製程式
 ALTER TABLE `cdb_threads` DROP `description` ;




範例:


[ 此文章被香吉士在2009-09-10 21:44重新編輯 ]

此文章被評分,最近評分記錄
財富:100 (by aa) | 理由: 感謝分享..^^



獻花 x1 回到頂端 [樓 主] From:歐洲 | Posted:2009-09-09 20:21 |

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