view posts since last visit

Allgemeiner Support zum phpBB 2 Board und phpBB 2 Modifikationen
Forumsregeln
Auch wenn hier der Support für phpBB 2 weiterhin aufrecht erhalten bleibt, weisen wir darauf hin, dass das phpBB 2 nicht mehr offiziell unterstützt und weiterentwickelt wird!
Antworten
Kiss News
Beiträge: 389
Registriert: So 25.Jul, 2004 18:22

view posts since last visit

Beitrag von Kiss News »

Hallo!
Habe noch eine Frage, und zwar habe ich diesen Mod installiert:
##############################################################
## MOD Title: Number of Posts Since Last Visit
## MOD Author: mitsubishi <mitsubishiuk@aol.com> (Adam Ismay) http://www.boardz.tk/
## MOD Author, Secondary: N/A <mac@kingoftheserver.com> (Iain Staffell) http://mb.kingoftheserver.com
## MOD Author, Secondary: AbelaJohnB <abela@phpbb.com> (John B. Abela) http://www.JohnAbela.Com/
## MOD Description: This MOD will add the number of new posts on the index page to view new posts.
## Total number of posts remains until your session expires or you log-out.
## MOD Version: 1.0.2
##
## Installation Level: Easy
## Installation Time: ~1 Minute
## Files To Edit: index.php
## Included Files: none
##############################################################
## 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:
##
## The number in brackets is posts. When you click it and search,
## the results are given as topics.
##
##############################################################
## MOD History:
##
## 2003-9-19 - Version 1.0.2
## Updated For phpBB 2.0.6 <abela@phpbb.com>
##
## 2003-05-24 - Version 1.0.1
## - your own posts are no longer counted <mac@kingoftheserver.com>
##
## 2002-04-08 - Version 1.0.0
## - original for phpBB 2.03 <mitsubishiuk@aol.com>
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ OPEN ]-------------------------------------
#
index.php

#
#-----[ FIND ]-------------------------------------
#
//
// End session management
//

#
#-----[ AFTER, ADD ]-------------------------------------
#
if( $userdata['session_logged_in'] )
{
$sql = "SELECT COUNT(post_id) as total
FROM " . POSTS_TABLE . "
WHERE post_time >= " . $userdata['user_lastvisit'] . "
AND poster_id != " . $userdata['user_id'];

$result = $db->sql_query($sql);
if( $result )
{
$row = $db->sql_fetchrow($result);
$lang['Search_new'] = $lang['Search_new'] . " (" . $row['total'] . ")";
}
}

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Leider ist der nicht "based on permission", er zeigt mir also bei manchen Usern mehr Beiträge an, da er auch die neuen Beiträge mitzählt in den Foren, zu denen der User keine Berechtigung hat. Wäre es denn möglich, das auch "based on permission" zu machen?
Gruß,
Gerhard
Benutzeravatar
oxpus
Administrator
Beiträge: 28735
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Beitrag von oxpus »

Dann musst Du den Mod so einbauen:

Code: Alles auswählen

##############################################################
## Mod Title: Number of Posts Since Last Visit
## Mod Author: mitsubishi <mitsubishiuk@aol.com> (Adam Ismay) http://www.boardz.tk/
## Mod Author, Secondary: N/A <mac@kingoftheserver.com> (Iain Staffell) http://mb.kingoftheserver.com
## Mod Author, Secondary: AbelaJohnB <abela@phpBB.com> (John B. Abela) http://www.JohnAbela.Com/
## Mod Description: This Mod will add the number of new posts on the index page to view new posts.
## Total number of posts remains until your session expires or you log-out.
## Mod Version: 1.0.3
##
## Installation Level: Easy
## Installation Time: ~1 Minute
## Files To Edit: index.php
## Included Files: none
##############################################################
## 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:
##
## The number in brackets is posts. When you click it and search,
## the results are given as topics.
##
##############################################################
## Mod History:
##
## 2004-10-11 - Version 1.0.3
## Add check for permissions by OXPUS <webmaster@oxpus.de>
##
## 2003-9-19 - Version 1.0.2
## Updated For phpBB 2.0.6 <abela@phpBB.com>
##
## 2003-05-24 - Version 1.0.1
## - your own posts are no longer counted <mac@kingoftheserver.com>
##
## 2002-04-08 - Version 1.0.0
## - original for phpBB 2.03 <mitsubishiuk@aol.com>
##
##############################################################
## Before Adding This Mod To Your Forum, You Should Back Up All Files Related To This Mod
##############################################################

#
#-----[ OPEN ]-------------------------------------
#
index.php

#
#-----[ FIND ]-------------------------------------
#
//
// End session management
//

#
#-----[ AFTER, ADD ]-------------------------------------
#
$sql = "SELECT * FROM ". FORUMS_TABLE;
if (!$result = $db->sql_query($sql))
{
	message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
}
$forum_data = array();
while( $row = $db->sql_fetchrow($result) )
{
	$forum_data[] = $row;
}

$is_auth_ary = array();
$is_auth_ary = auth(AUTH_ALL, AUTH_LIST_ALL, $userdata, $forum_data);
for ($i = 0; $i < count($forum_data); $i++)
{
	if (($is_auth_ary[$forum_data[$i]['forum_id']]['auth_read']) or ($is_auth_ary[$forum_data[$i]['forum_id']]['auth_view']))
	{
		if ($auth_forum_id == '')
		{
			$auth_forum_id = $forum_data[$i]['forum_id'];
		}
		else
		{
			$auth_forum_id .= ',' . $forum_data[$i]['forum_id'];
		}
	}
}

if( $userdata['session_logged_in'] )
{
$SQL = "SELECT COUNT(post_id) as total
FROM " . POSTS_TABLE . "
WHERE post_time >= " . $userdata['user_lastvisit'] . "
AND poster_id != " . $userdata['user_id'] . "
AND forum_id IN (" . $auth_forum_id . ")";

$result = $db->sql_query($SQL);
if( $result )
{
$row = $db->sql_fetchrow($result);
$lang['Search_new'] = $lang['Search_new'] . " (" . $row['total'] . ")";
}
}

#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM 
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Benutzeravatar
AmigaLink
Beiträge: 5843
Registriert: Mi 03.Mär, 2004 09:05
Wohnort: NRW
Kontaktdaten:

Beitrag von AmigaLink »

:lol: Womit du jetzt der 3. wärst der Hand an diesen Mod legt, oxpus.
Du hättest noch die Versionsnummer hochsetzen und die Autoreninfo ergämzen sollen. :)
[center].: Web Relax .::. Essen mit Freude .::. AmigaLink.de :.
______________________________________

Kein Support per PM, ICQ oder eMail!!!
[/center]
Benutzeravatar
oxpus
Administrator
Beiträge: 28735
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Beitrag von oxpus »

Nö, daß lass ich mal ;)
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Benutzeravatar
Bootenks
Beiträge: 1836
Registriert: Sa 29.Mai, 2004 23:36
Wohnort: G?rlitz (?stlichste Stadt Deutschlands)

Beitrag von Bootenks »

ist ne luistige sache mit dem mod ^^""" obwohl der gar net gross ist *grins*
Nur ein Informatik Student. ^^
Benutzeravatar
oxpus
Administrator
Beiträge: 28735
Registriert: Mo 27.Jan, 2003 22:13
Wohnort: Bad Wildungen
Kontaktdaten:

Beitrag von oxpus »

Ja, wenns lustig ist, hab ich die Version des Mods mal rauf gesetzt ;)
Karsten Ude
-={ Das Mädchen für alles }=-
Kein Support per Messenger, Email oder PN! Unaufgeforderte Nachrichten werden ignoriert!
No support per Messenger, Email or PM. Each unasked message will be ignored!
Antworten