[2.0.10] View new topics since last visit

The cleanup is complete. This forum is now read only.

Rating:

Excellent!
3
75%
Very Good
1
25%
Good
0
No votes
Fair
0
No votes
Poor
0
No votes
 
Total votes: 4

rspir
Registered User
Posts: 7
Joined: Sat Jul 24, 2004 10:21 am
Location: Paris, France

Post by rspir » Thu Apr 07, 2005 7:56 pm

I tried this :

Code: Select all

//number of topics since last visit
if( $userdata['session_logged_in'] )
{
$sql = "SELECT COUNT (p.post_id) as tot_topic
	       FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE . " t
	       WHERE p.post_id = t.topic_first_post_id
           AND t.topic_time >= " . $userdata['user_lastvisit'] ."
           AND p.poster_id != " . $userdata['user_id'];

   $result = $db->sql_query($sql);
   if( $result )
   {
      $row = $db->sql_fetchrow($result);
      $lang['Search_new_topics'] = $lang['Search_new_topics'] . " (" . $row['tot_topic'] . ")";
   }
   else
       $lang['Search_new_topics'] = $lang['Search_new_topics'] . " (" . X . ")";
}
//number of topics since last visit
But it does not work.
Maybe with a little help ...
rspir

Wo1f
Registered User
Posts: 2039
Joined: Fri Jan 28, 2005 3:20 am

Post by Wo1f » Thu Apr 07, 2005 10:18 pm

Try this!

Code: Select all

if( $userdata['session_logged_in'] ) 
{
	$sql = "SELECT COUNT(topic_id) as total 
		FROM " . TOPICS_TABLE . "
		WHERE topic_time >= " . $userdata['user_lastvisit'] . "
		AND topic_poster != " . $userdata['user_id'] . "
		AND topic_first_post_id > " . 0 ;
		
	$result = $db->sql_query($sql); 
	if( $result ) 
	{ 
		$row = $db->sql_fetchrow($result); 
		$lang['Search_new_topics'] = $lang['Search_new_topics'] . " (" . $row['total'] . ")"; 
	}
$db->sql_freeresult($result);
}
... which will give you this result (click on link below). As per previous posts, if I understood well, this is what you want.

  • View image
[/url]

Hope this helps!
Wolf

Kinsman
Registered User
Posts: 207
Joined: Sun Jan 02, 2005 6:04 am
Contact:

Post by Kinsman » Fri Apr 08, 2005 4:59 am

wel done mate, works a treat, thanks! :D

Oggys
Registered User
Posts: 14
Joined: Fri Mar 11, 2005 3:24 am

Post by Oggys » Sat Sep 17, 2005 5:10 am

Robert Tetenman wrote: The MOD works fine but is there a way to see the number of new topics? I have a mod for Posts that shows me the number of new posts sine last visit and would like this to do the same.


Me too!!!

Kinsman
Registered User
Posts: 207
Joined: Sun Jan 02, 2005 6:04 am
Contact:

Post by Kinsman » Sat Sep 17, 2005 5:17 am

Wo1f wrote: Try this!

Code: Select all

if( $userdata['session_logged_in'] ) 
{
	$sql = "SELECT COUNT(topic_id) as total 
		FROM " . TOPICS_TABLE . "
		WHERE topic_time >= " . $userdata['user_lastvisit'] . "
		AND topic_poster != " . $userdata['user_id'] . "
		AND topic_first_post_id > " . 0 ;
		
	$result = $db->sql_query($sql); 
	if( $result ) 
	{ 
		$row = $db->sql_fetchrow($result); 
		$lang['Search_new_topics'] = $lang['Search_new_topics'] . " (" . $row['total'] . ")"; 
	}
$db->sql_freeresult($result);
}


thats what you want right there. :D

Oggys
Registered User
Posts: 14
Joined: Fri Mar 11, 2005 3:24 am

Post by Oggys » Sat Sep 17, 2005 5:24 am

which file do I add that too, and where? thanks alot!

Oggys
Registered User
Posts: 14
Joined: Fri Mar 11, 2005 3:24 am

Post by Oggys » Sat Sep 17, 2005 6:45 am

I figured it out! Index.php

Thanks alot it workd fine ;)

DougB
Registered User
Posts: 136
Joined: Mon Nov 08, 2004 10:06 pm
Location: West Vancouver, BC Canada
Contact:

Post by DougB » Wed Oct 12, 2005 12:31 am

Every time I try and download this file it tries to save as a Winamp media file? Any suggestions? TIA

DougB
more coffee needed...

NightriderXP
Registered User
Posts: 1418
Joined: Sat Oct 09, 2004 8:17 am
Location: Florida, US
Contact:

Post by NightriderXP » Wed Oct 12, 2005 2:02 am

Doug, the download for this MOD is just a text file. Try this link:

http://www.phpbb.com/files/mods/View%20 ... v1.0.2.mod

If that doesn't work, I will send it to you through PM if necessary. It's possible that winAmp is treating this file type like a media file. Do you have a download accellerator program that you can use???

:lol:

DougB
Registered User
Posts: 136
Joined: Mon Nov 08, 2004 10:06 pm
Location: West Vancouver, BC Canada
Contact:

Post by DougB » Wed Oct 12, 2005 4:10 am

Hey NightriderXP,

I've managed to open it after I changed the file permissions and got 151 lines of code with 4 files identified that require changing (search.php; include/page_header.php; language/lang_english/lang_main.php; templates/subSilver/index_body.tpl.

Could you please let me know if this is it and many thanks again...
DougB
more coffee needed...

NightriderXP
Registered User
Posts: 1418
Joined: Sat Oct 09, 2004 8:17 am
Location: Florida, US
Contact:

Post by NightriderXP » Wed Oct 12, 2005 4:23 am

Yep, that's it Doug. Don't forget to use EasyMod to install it...

:lol:

DougB
Registered User
Posts: 136
Joined: Mon Nov 08, 2004 10:06 pm
Location: West Vancouver, BC Canada
Contact:

Post by DougB » Wed Oct 12, 2005 5:04 am

Thanks NightRider,

Much appreciated!
DougB
more coffee needed...

User avatar
Ramon Fincken
Registered User
Posts: 4835
Joined: Thu Oct 14, 2004 1:04 am
Location: NL, The Netherlands Amsterdam area @GMT +1
Contact:

Post by Ramon Fincken » Sat Nov 12, 2005 9:01 pm

Kinsman wrote: would it be possible to adapt this mod to display the nuber of new topics like this (3) ?

i noticed there is a similar mod for posts! :D



--update--

ow shoot!!

You wanted the topics right?
You can edit it like

Code: Select all

GROUP BY topic_id
So every topic get's counted once, even if it has MORE new replies in it..

Ciao!
Rfn


http://www.phpbb.com/phpBB/viewtopic.ph ... 08#1847208

download at
http://phpbb2italia.za.net/phpbb2/viewtopic.php?t=173


Here it is...
Fully working and running on live boards.

Only thing left: handle marking forums

Code: Select all

############################################################## 
## MOD Title: View number of new posts since last visit
## MOD Author: CreativePulses.nl < forumsoftware@creativepulses.nl > (Ramon Fincken) www.CreativePulses.nl
## MOD Description: Show number of newposts like: "View posts since last visit (13)"
##                   -counts every unseen post
##		     -does not count YOUR posts 
##                   -- every post in newtopic 
##                   -- every reply since the last visit 
##                   -decreases count when you visited a topic 
##                   -decreases count when you hit the mark all forums read 
##                      ( and increases for every post after that ... ) 
##                   -only counts posts in forum you have READ access to... 
##
## MOD Version: 1.3
## Tested on: PhpBB 2.0.17
##	Should be phpBB version independent, if not let me know
## 
## Installation Level: easy
## Installation Time: 2 Minutes
## Files To Edit: (1)  root/includes/page_header.php
## Included Files: (1) MOD_view_number_of_posts_since_last_visit.php
############################################################## 

############################################################## 
## Authors Notes: 
##	Check 
##         	http://phpbb2italia.za.net/phpbb2/viewforum.php?f=12 
##		for updates, update manuals, support and screenshots
##
##    	Version History:
##
##		Only thing left: handle marking forums
##		1.3  -  21112005  -  Allmost the real thing :) 
##		1.1/2-  05112005  -  Minor update
##            	1.0  -  31062005  -  first version
##
##	If you like this mod add your phpbb forum url to: www.rfn-online.tk
##
##	Thanks to:
##		3Di, http://phpbb2italia.za.net/phpbb2
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 
Dutch quality fully managed WordPress hosting - ManagedWPHosting.nl

Before changing a file, some code or installing a MOD >> Make a backup first!

Do you like my mods? paypal me $1 :) forumsoftware[AT}creativepulses[DOT}nl [/size]
PhpBBantispam.com || Instant find your mod here

troubledteen
Registered User
Posts: 9
Joined: Wed Jan 03, 2007 7:05 pm

EasyMOD

Post by troubledteen » Wed Jan 03, 2007 8:31 pm

Using EasyMOD seems to be a fruitful way of dealing with the problem indeed.Removed>Jim_UK

e31
Registered User
Posts: 2
Joined: Mon Oct 22, 2007 6:16 pm

Re: [2.0.10] View new topics since last visit

Post by e31 » Mon Oct 22, 2007 6:23 pm

Is there a simple way to track updates in a specific forum. I looked at the link to a specific forum and saw that there is a "viewforum.php" passing the forum number "f=25". http://www.xyz.org/xyzforums/viewforum.php?f=25

So a functionality which enables view new posts within f=25 or multiple forum numbers will be very helpful.

Post Reply

Return to “[2.0.x] MOD Database Cleanup”