Seite 1 von 1

MOD Title: Stop Author View Increase

Verfasst: 10.05.2004 12:24
von Kryo
Hallo, habe folgenden MOD auf 2.06 durchgeführt - hat auch geklappt! Da ich aber das Forum für unregistrierte Gäste offen habe, nimmt der counter überhaupt nicht mehr zu, wenn Gast X einen Thread eröffnet und sich die Gäste A-Z den ansehn! Kann ich den MOD umkonfigurieren, dass das bei den Gästen nicht so ist?







Code: Alles auswählen

############################################################## 
## 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

Verfasst: 13.05.2004 02:18
von Kryo
*malwiederanschieb*

Verfasst: 13.05.2004 02:53
von rabbit
da gäste alle die selbe user-id haben, nämlich -1, dürfte das schwierig werden, denke ich...