[問題]關於文章隱藏

phpBB 2 MOD Support
無論是官方或非官方認證之外掛,安裝與使用問題討論。
(發表文章請按照公告格式發表,違者砍文)

版主: 版主管理群

emn178
星球公民
星球公民
文章: 44
註冊時間: 2004-03-05 20:57

文章 emn178 »

我已經在寫出for phpbb 版本了

並重新發表在非官方推薦外掛

http://phpbb-tw.net/phpbb/viewtopic.php?p=142841#142841

還有什麼問題在提出來討論吧
●架設主機作業系統:Windows Xp Pro
●快速架站程式:RaidenHTTPD
●您的上網方式:學術網
●您安裝的程式:RaidenHTTPD + php + MySql 3.x + MDaemon 6.0.8
●您的 phpBB2 版本:phpBB plus 1.3 中文版

小殘的窩 :
http://emn178.idv.st/
webspirit
竹貓忠實會員
竹貓忠實會員
文章: 1354
註冊時間: 2004-02-16 12:01
來自: 精靈國度

文章 webspirit »

在phpBB裡沒有/profilcp/profilcp_public_base.php
emn178
星球公民
星球公民
文章: 44
註冊時間: 2004-03-05 20:57

文章 emn178 »

已經改好了

不過忘了回覆了 = =
●架設主機作業系統:Windows Xp Pro
●快速架站程式:RaidenHTTPD
●您的上網方式:學術網
●您安裝的程式:RaidenHTTPD + php + MySql 3.x + MDaemon 6.0.8
●您的 phpBB2 版本:phpBB plus 1.3 中文版

小殘的窩 :
http://emn178.idv.st/
basang
星球普通子民
星球普通子民
文章: 28
註冊時間: 2003-07-27 02:04

文章 basang »

此MOD在引言和查詢 XXXX 發表的所有文章
在這兩這地方都沒有隱藏起來
是否能請你修正一下
webspirit
竹貓忠實會員
竹貓忠實會員
文章: 1354
註冊時間: 2004-02-16 12:01
來自: 精靈國度

文章 webspirit »

呵呵\r
您是第一次寫外掛
而我則是第一次改外掛安裝文件 ^^

代碼: 選擇全部

#################################################################
## Mod Title: 區分發表主題與回覆(Separate Topics and Replies MOD)
## Mod Version: v1.1
## Author: emn178 - http://emn178.idv.st
## 
## Description: 此Mod能夠將使用者的文章數區分為主題數和回覆數,但是僅在安裝
##                       之後才能夠區分,舊的資料仍把安裝前的回覆數視為主題數,除非手
##                       動更改資料庫\r
## Installation Level: Easy
## Installation Time: 5 Minutes
## Files To Edit: 7
##                         memberlist.php
##                         viewtopic.php
##                         includes/functions_post.php
##                         includes/usercp_viewprofile.php
##                         templates/subSilver/memberlist_body.tpl
##                         templates/subSilver/profile_view_body.tpl
##                         templates/subSilver/viewtopic_body.tpl
## Included Files: N/A
#################################################################

在SQL資料庫的phpbb_users資料表格中,增加一個user_reply欄位在user_posts後面\r

欄位      類型      長度   屬性      Null      內定值      額外
user_reply   MEDIUMNIT   8   UNSIGNED   not null   0
#
#-----[ 開啟 ]------------------------------------------
#
includes/functions_post.php
#
#-----[ 尋找 ]------------------------------------------
#
$sign = ($mode == 'delete') ? '- 1' : '+ 1';
#
#-----[ 前面加上 ]------------------------------------------
#
//reply and posts mod
$reply = false;
$sqlp = "SELECT p.post_id, p.topic_id
      FROM " . POSTS_TABLE . " p
      WHERE forum_id = $forum_id";
$resultat = $db->sql_query($sqlp);
while($row = $db->sql_fetchrow($resultat))
{
   if($topic_id == $row['topic_id'])
      $postid[] = $row['post_id'];
}
if(count($postid) > 1)
{
   for($i = 0;$i < count($postid);$i++)
   {
      if($post_id > $postid[$i])
         $reply = true;
   }
}
if($mode == 'reply')
   $replysign = '+ 1';
if($mode == 'delete' && $reply == true)
   $replysign = "- 1";
//reply and posts mod
#
#-----[ 尋找 ]------------------------------------------
#
if ($mode != 'poll_delete')
{
   $sql = "UPDATE " . USERS_TABLE . "
         SET user_posts = user_posts $sign
         WHERE user_id = $user_id";
#
#-----[ 改成 ]------------------------------------------
#
if ($mode != 'poll_delete')
{
   $sql = "UPDATE " . USERS_TABLE . "
         SET user_posts = user_posts $sign,
         user_reply = user_reply $replysign
         WHERE user_id = $user_id";
#
#-----[ 開啟 ]------------------------------------------
#
viewtopic.php
#
#-----[ 尋找 ]------------------------------------------
#
$poster_posts = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Posts'] . ': ' . $postrow[$i]['user_posts'] : '';
#
#-----[ 後面加上 ]------------------------------------------
#
$poster_topic = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Topics'] . ': ' . ($postrow[$i]['user_posts'] - $postrow[$i]['user_reply']) : '';
$poster_reply = ( $postrow[$i]['user_id'] != ANONYMOUS ) ? $lang['Replies'] . ': ' . $postrow[$i]['user_reply'] : '';
#
#-----[ 尋找 ]------------------------------------------
#
'POSTER_POSTS' => $poster_posts,
#
#-----[ 後面加上 ]------------------------------------------
#
'POSTER_TOPICS' => $poster_topic,
'POSTER_REPLIES' => $poster_reply,
#
#-----[ 開啟 ]------------------------------------------
#
templates/subSilver/viewtopic_body.tpl
#
#-----[ 尋找 ]------------------------------------------
#
{postrow.POSTER_POSTS}<br />
#
#-----[ 後面加上 ]------------------------------------------
#
{postrow.POSTER_TOPICS}<br />
{postrow.POSTER_REPLIES}<br />
#
#-----[ 開啟 ]------------------------------------------
#
includes/usercp_viewprofile.php
#
#-----[ 尋找 ]------------------------------------------
#
$posts_per_day = $profiledata['user_posts'] / $memberdays;
#
#-----[ 後面加上 ]------------------------------------------
#
$topic = $profiledata['user_posts'] - $profiledata['user_reply'];
$reply = $profiledata['user_reply'];
#
#-----[ 尋找 ]------------------------------------------
#
'POSTS' => $profiledata['user_posts'],
#
#-----[ 後面加上 ]------------------------------------------
#
'TOPICS' => $topic,
'REPLIES' => $reply,
#
#-----[ 尋找 ]------------------------------------------
#
'L_TOTAL_POSTS' => $lang['Total_posts'],
#
#-----[ 後面加上 ]------------------------------------------
#
'L_TOTAL_TOPICS' => $lang['Topics'],
'L_TOTAL_REPLIES' => $lang['Replies'],
#
#-----[ 開啟 ]------------------------------------------
#
templates/subSilver/profile_view_body.tpl
#
#-----[ 尋找 ]------------------------------------------

		<tr>
		  <td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_TOTAL_POSTS}: </span></td>
		  <td valign="top"><b><span class="gen">{POSTS}</span></b><br /><span class="genmed">[{POST_PERCENT_STATS} / {POST_DAY_STATS}]</span> <br /><span class="genmed"><a href="{U_SEARCH_USER}" class="genmed">{L_SEARCH_USER_POSTS}</a></span></td>
		</tr>
#
#-----[ 改成 ]------------------------------------------
#
      <tr>
        <td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_TOTAL_POSTS}: </span></td>
        <td valign="top"><b><span class="gen">{POSTS}</span></b></td>
      </tr>
      <tr>
      <td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_TOTAL_TOPICS}: </span></td>
        <td valign="top"><b><span class="gen">{TOPICS}</span></b></td>
      </tr>
      <tr>
      <td valign="top" align="right" nowrap="nowrap"><span class="gen">{L_TOTAL_REPLIES}: </span></td>
        <td valign="top"><b><span class="gen">{REPLIES}</span></b><br />
        <span class="genmed">[{POST_PERCENT_STATS} / {POST_DAY_STATS}]</span><br /><span class="genmed"><a href="{U_SEARCH_USER}" class="genmed">{L_SEARCH_USER_POSTS}</a></span></td>
      </tr>
#
#-----[ 開啟 ]------------------------------------------
#
memberlist.php
#
#-----[ 尋找 ]------------------------------------------
#
$sql = "SELECT username, user_id, user_viewemail, user_posts, user_regdate, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_avatar, user_avatar_type, user_allowavatar
#
#-----[ 後面加上 ]------------------------------------------
#
, user_reply
#
#-----[ 變成 ]------------------------------------------
#
$sql = "SELECT username, user_id, user_viewemail, user_posts, user_regdate, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_avatar, user_avatar_type, user_allowavatar, user_reply
#
#-----[ 尋找 ]------------------------------------------
#
'L_POSTS' => $lang['Posts'],
#
#-----[ 後面加上 ]------------------------------------------
#
'L_TOPICS' => $lang['Topics'],
'L_REPLIES' => $lang['Replies'],
#
#-----[ 尋找 ]------------------------------------------
#
$posts = ( $row['user_posts'] ) ? $row['user_posts'] : 0;
#
#-----[ 後面加上 ]------------------------------------------
#
$topic = ( $row['user_posts'] ) ? ($row['user_posts'] - $row['user_reply']) : 0;
$reply = ( $row['user_reply'] ) ? $row['user_reply'] : 0;
#
#-----[ 尋找 ]------------------------------------------
#
'POSTS' => $posts,
#
#-----[ 後面加上 ]------------------------------------------
#
'TOPICS' => $topic,
'REPLIES' => $reply,
#
#-----[ 開啟 ]------------------------------------------
#
templates/subSilver/memberlist_body.tpl
#
#-----[ 尋找 ]------------------------------------------
#
<th class="thTop" nowrap="nowrap">{L_POSTS}</th>
#
#-----[ 改成 ]------------------------------------------
#
<th class="thTop" nowrap="nowrap" width = "150">{L_POSTS}/{L_TOPICS}/{L_REPLIES}</th>
#
#-----[ 尋找 ]------------------------------------------\r
#
<td class="{memberrow.ROW_CLASS}" align="center" valign="middle"><span class="gen">{memberrow.POSTS}</span></td>
#
#-----[ 改成 ]------------------------------------------
#
<td class="{memberrow.ROW_CLASS}" align="center" valign="middle"><span class="gen">{memberrow.POSTS} / {memberrow.TOPICS} / {memberrow.REPLIES}</span></td>
#
#-----[ 儲存並關閉所有檔案 ]------------------------------------------
#
# EoM
您可與原文件比對一下其中差異(尤其是程式段之修改順序)
對您日後編寫此文件時也許會有些幫助\r
感謝您 ^^
webspirit
竹貓忠實會員
竹貓忠實會員
文章: 1354
註冊時間: 2004-02-16 12:01
來自: 精靈國度

文章 webspirit »

發表數隱藏文章MOD
在phpBB及plus的
language/lang_chinese_traditional_taiwan/lang_main.php中\r
均找不到\r
$lang['bbcode_sc_help'] = '你可以使用此功能產生不同的表情符號'; =.=|||
emn178
星球公民
星球公民
文章: 44
註冊時間: 2004-03-05 20:57

文章 emn178 »

關於引言和會員所有文章的部分已經解決掉了

lang的部分,其實隨便加在哪裡都行

不過為了分類所以會指定加在某處

既然沒有$lang['bbcode_sc_help'] = '你可以使用此功能產生不同的表情符號';

就改成尋找$lang['bbcode_f_help'] = '字型大小: [size=x-small]small text[/size]';
也已經在發表的地方更正了

另外也使用了webspirit建議的編寫方法ㄌ

感謝大家幫忙測試讓我也能夠發現遺漏的部分~
●架設主機作業系統:Windows Xp Pro
●快速架站程式:RaidenHTTPD
●您的上網方式:學術網
●您安裝的程式:RaidenHTTPD + php + MySql 3.x + MDaemon 6.0.8
●您的 phpBB2 版本:phpBB plus 1.3 中文版

小殘的窩 :
http://emn178.idv.st/
basang
星球普通子民
星球普通子民
文章: 28
註冊時間: 2003-07-27 02:04

文章 basang »

我適用PHPBB2.0.8架設
對於引言我按下去就會出現錯誤
訊息如下
Fatal error: Call to undefined function: post_hide_in_quote() in c:\appserv\www\phpbb2\posting.php on line 826
這一行程式碼剛好在826行是這一行
$message = post_hide_in_quote($message);

還有在版面的個人資料裡面按進去觀看"查詢 emn178 發表的所有文章"
看到滴文章是沒有隱藏滴\r

能否請你修正一下
emn178
星球公民
星球公民
文章: 44
註冊時間: 2004-03-05 20:57

文章 emn178 »

抱歉又漏掉一個function已經更正了是bbcode.php的部分

我在我的論壇上查詢我的文章 結果是有隱藏阿
●架設主機作業系統:Windows Xp Pro
●快速架站程式:RaidenHTTPD
●您的上網方式:學術網
●您安裝的程式:RaidenHTTPD + php + MySql 3.x + MDaemon 6.0.8
●您的 phpBB2 版本:phpBB plus 1.3 中文版

小殘的窩 :
http://emn178.idv.st/
basang
星球普通子民
星球普通子民
文章: 28
註冊時間: 2003-07-27 02:04

文章 basang »

可是我照這樣滴修改方式
我測試2次\r
都沒裝任何MOD滴外掛
還是一樣的問題
就是文章會直接顯示出來
我跑去你滴站台測試結果是正常滴
請問是否是我哪邊有修改錯誤
emn178
星球公民
星球公民
文章: 44
註冊時間: 2004-03-05 20:57

文章 emn178 »

原來是search.php的部分又少改一段程式碼而已 = =

我自己有改只是忘了寫進去...
●架設主機作業系統:Windows Xp Pro
●快速架站程式:RaidenHTTPD
●您的上網方式:學術網
●您安裝的程式:RaidenHTTPD + php + MySql 3.x + MDaemon 6.0.8
●您的 phpBB2 版本:phpBB plus 1.3 中文版

小殘的窩 :
http://emn178.idv.st/
webspirit
竹貓忠實會員
竹貓忠實會員
文章: 1354
註冊時間: 2004-02-16 12:01
來自: 精靈國度

文章 webspirit »

真的非常感謝
但仍希望能於安裝後
經由一update程序更新原發表及回覆數\r
不然無法應用於舊論壇
安裝說明文件亦有改善空間
程式碼部份
配合原文件之位置與格式較佳
emn178
星球公民
星球公民
文章: 44
註冊時間: 2004-03-05 20:57

文章 emn178 »

webspirit 寫:真的非常感謝
但仍希望能於安裝後
經由一update程序更新原發表及回覆數\r
不然無法應用於舊論壇
^^^^^^^^^^^^^^
關於上面的問題我剛剛有想到一個方法可以更新\r

有想法沒語法就是了

繼續努力吧\r

不過要期中考ㄌ...


安裝說明文件亦有改善空間
程式碼部份
配合原文件之位置與格式較佳\r
^^^^^^^^^^^^^^^^^
這是什麼意思?
●架設主機作業系統:Windows Xp Pro
●快速架站程式:RaidenHTTPD
●您的上網方式:學術網
●您安裝的程式:RaidenHTTPD + php + MySql 3.x + MDaemon 6.0.8
●您的 phpBB2 版本:phpBB plus 1.3 中文版

小殘的窩 :
http://emn178.idv.st/
emn178
星球公民
星球公民
文章: 44
註冊時間: 2004-03-05 20:57

文章 emn178 »

好...

我已經寫出在舊有資料可更新的版本了

試試看吧
●架設主機作業系統:Windows Xp Pro
●快速架站程式:RaidenHTTPD
●您的上網方式:學術網
●您安裝的程式:RaidenHTTPD + php + MySql 3.x + MDaemon 6.0.8
●您的 phpBB2 版本:phpBB plus 1.3 中文版

小殘的窩 :
http://emn178.idv.st/
拭銀布
星球公民
星球公民
文章: 66
註冊時間: 2003-11-18 19:44
來自: yakuza

文章 拭銀布 »

剛剛安裝時發現在區分發表主題與回覆安裝說明在 viewtopic.php 修改部分漏了下面的步驟喔!

代碼: 選擇全部

# 
#-----[ 開啟 ]------------------------------------------ 
# 
viewtopic.php 
# 
#-----[ 找到 ]------------------------------------------ 
#
//
// Go ahead and pull all data for this topic
//
$sql = "SELECT u.username, u.user_id, u.user_posts,
# 
#-----[ 之中找到 ]------------------------------------------ 
# 
u.user_posts,
# 
#-----[ 後面加上 ]------------------------------------------ 
# 
u.user_reply,
# 
#-----[ 儲存並關閉所有檔案 ]------------------------------------------ 
# 
# EoM
希望大大修改一下安裝說明,也感謝大大提供此外掛!受益良多! :lol:
主題已鎖定

回到「外掛問題討論」