[外掛]Stop Author View Increase( 檢視自己發表的文章時不增加文章的觀看次數)

phpBB 大部分皆是由竹貓星球提供資料!
頭像
yehrussell
忍辱、精進、靜慮、般若波羅密
忍辱、精進、靜慮、般若波羅密
主題中的帖子: 1
文章: 1133
註冊時間: 2006-01-20 , 10:19
個人狀態: 非常忙碌中!
性別: 公仔

[外掛]Stop Author View Increase( 檢視自己發表的文章時不增加文章的觀看次數)

未閱讀文章 yehrussell »

[外掛]Stop Author View Increase

http://phpbb-tw.net/phpbb/viewtopic.php?t=21396

--------------------------------------------------------------------------------

[php:1:29cdbc21f1]

代碼: 選擇全部

############################################################## 
## MOD Title: Stop Author View Increase 
## MOD Author: DanielT < savi.mods@danielt.com > (Daniel Taylor) http://www.danielt.com 
## MOD Description: Does not increase viewed count when author is viewing his/her own topic 
## MOD Version: 1.0.1 
## 
## Installation Level: easy 
## Installation Time: ~1 Minutes 
## Files To Edit: viewtopic.php 
## Included Files: n/a 
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/ 
############################################################## 
## Author Notes: n/a 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 
# 
#-----[ OPEN ]------------------------------------------ 
# 
viewtopic.php 
# 
#-----[ FIND ]------------------------------------------ 
# 
$sql = "UPDATE " . TOPICS_TABLE . " 
SET topic_views = topic_views + 1 
WHERE topic_id = $topic_id"; 
if ( !$db->sql_query($sql) ) 
{ 
message_die(GENERAL_ERROR, "Could not update topic views.", '', __LINE__, __FILE__, $sql); 
} 
# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 
if (!($postrow[0]['user_id'] == $userdata['user_id'])) { 

$sql = "UPDATE " . TOPICS_TABLE . " 
SET topic_views = topic_views + 1 
WHERE topic_id = $topic_id"; 
if ( !$db->sql_query($sql) ) 
{ 
message_die(GENERAL_ERROR, "Could not update topic views.", '', __LINE__, __FILE__, $sql); 
} 

} 
# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM[/php:1:29cdbc21f1] 
來源:phpbb 官方網站
翻譯:不需要
功能:當作者檢視自己發表的文章時不增加文章的觀看次數
版面鎖定 主題已鎖定

回到「phpBB2」