[2.0.13] Forum Watch

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

Rating:

Excellent!
32
78%
Very Good
3
7%
Good
3
7%
Fair
0
No votes
Poor
3
7%
 
Total votes: 41

geefjemening.tk
Registered User
Posts: 28
Joined: Thu Mar 23, 2006 1:13 pm

Re: [2.0.13] Forum Watch

Post by geefjemening.tk »

aaah, than that was the part i missed, that i had to delete it...
i thought that i had to do the thing there, to find this, and replace by that, but your solution was how the mod had to be changed... i did not understood that :P
i'll try

geefjemening.tk
Registered User
Posts: 28
Joined: Thu Mar 23, 2006 1:13 pm

Re: [2.0.13] Forum Watch

Post by geefjemening.tk »

hmm, it says
Parse error: syntax error, unexpected $end in /home/web0143/domains/musicalwognum.nl/public_html/leden/phpBB2/posting.php on line 1130
thats (*after the change) the line wich ends the php ( ?> ) ad the end of the file :S
anyone?

etatus
Registered User
Posts: 6
Joined: Mon Dec 10, 2007 6:40 pm

Re: [2.0.13] Forum Watch

Post by etatus »

I think I commented (in red) one more line than necessary (close bracket)... try this:
if ($error_msg == '' && $mode != 'poll_delete')
{
if ($mode == 'newtopic')
{
user_notification_forum($post_data, $subject, $post_info['forum_name'], $forum_id, $topic_id, $post_id);
user_notification($mode, $post_data, $post_info['topic_title'], $forum_id, $topic_id, $post_id, $notify_user);
}
}

geefjemening.tk
Registered User
Posts: 28
Joined: Thu Mar 23, 2006 1:13 pm

Re: [2.0.13] Forum Watch

Post by geefjemening.tk »

YES!
worked... of course i could have seen it at my self it was one line to much... :S much thanks..

geefjemening.tk
Registered User
Posts: 28
Joined: Thu Mar 23, 2006 1:13 pm

Re: [2.0.13] Forum Watch

Post by geefjemening.tk »

hmm, but now he doesn't make me waching when replay to an toic i'm not watching, maybe copy the line outsite the if else... i'll try

geefjemening.tk
Registered User
Posts: 28
Joined: Thu Mar 23, 2006 1:13 pm

Re: [2.0.13] Forum Watch

Post by geefjemening.tk »

ok, for who's searching for the problem that you'r not subscribet to at new posted topic, even if you chcked the box that you want to be subscribed.... here the right code:

Code: Select all

		if ($error_msg == '' && $mode != 'poll_delete')
		{
			if ($mode == 'newtopic')
			{
				user_notification_forum($post_data, $subject, $post_info['forum_name'], $forum_id, $topic_id, $post_id);
				user_notification($mode, $post_data, $post_info['topic_title'], $forum_id, $topic_id, $post_id, $notify_user);
			} else {
				user_notification($mode, $post_data, $post_info['topic_title'], $forum_id, $topic_id, $post_id, $notify_user);
			}
		}

Jamshed
Registered User
Posts: 1
Joined: Tue Mar 04, 2008 9:01 am

Re:

Post by Jamshed »

Hi all.
I`m installed this mod and its works fine.
I just want to add some feature, i found addon that allows to create a default forum watch list for subscribing new users, but i need to subscribe a existing users to this default forum watch list over the admin panel, open edit user profile by admin panel and add subscribe to default forum watch list, is there any way to do this?
antoonvdr wrote:
antoonvdr wrote: I am currently working on a little addon to make a default list of forums to which any new user can subscribe automatically. Both MODs depend on the exact same database, so it should work for both.
If you are interested in this addon, you can download it here: http://www.chathamkiwanis.com/BB/dload. ... file_id=25
;)

klincicome
Registered User
Posts: 6
Joined: Sun Jun 22, 2003 11:47 pm
Contact:

Re: [2.0.13] Forum Watch

Post by klincicome »

where in ACP do you set Forum Watch in phpbb3? I have subscribed to a category but still do not get emails when a topic is created in any of the forums in that category. Do I have to subscribe to all the forums individually?

geefjemening.tk
Registered User
Posts: 28
Joined: Thu Mar 23, 2006 1:13 pm

Re: [2.0.13] Forum Watch

Post by geefjemening.tk »

i dont know for sure, but i think this is only for phpbb2... i thought forum watch in an standart option now in phpbb3, so theres no plugin needed anymore.

Pimpala03
Registered User
Posts: 6
Joined: Wed Aug 01, 2007 5:17 am

Re: [2.0.13] Forum Watch

Post by Pimpala03 »

I used to have a mod to this mod that allowed the user to receive a new email message upon every New Topic being posted in a watched forum. Does anyone know where I can find this information?

I looked through all 21 pages of this thread but didn't see it right off.

Can anyone help?
Last edited by Paul on Wed Mar 12, 2008 10:35 pm, edited 1 time in total.
Reason: Removed unneeded bbcode.

geefjemening.tk
Registered User
Posts: 28
Joined: Thu Mar 23, 2006 1:13 pm

Re: [2.0.13] Forum Watch

Post by geefjemening.tk »

ii have deleted this stupid code, just use the one beneath:
Last edited by geefjemening.tk on Thu Mar 13, 2008 9:16 am, edited 1 time in total.

geefjemening.tk
Registered User
Posts: 28
Joined: Thu Mar 23, 2006 1:13 pm

Re: [2.0.13] Forum Watch

Post by geefjemening.tk »

i have found an other way to mail everyone whos waching, and not only the ones who have readen the last post, at my posting.php is the folowing code at line 736, so search near there for the folowing code:

Code: Select all

$sql = "SELECT u.user_id, u.user_email, u.user_lang
		FROM " . FORUMS_WATCH_TABLE . " fw, " . USERS_TABLE . " u
		WHERE fw.forum_id = $forum_id
			AND fw.user_id NOT IN (" . $userdata['user_id'] . ", " . ANONYMOUS . $user_id_sql . ")
			AND fw.notify_status = " . TOPIC_WATCH_UN_NOTIFIED . "
			AND u.user_id = fw.user_id";
	if (!($result = $db->sql_query($sql)))
	{
		message_die(GENERAL_ERROR, 'Could not obtain list of forum watchers', '', __LINE__, __FILE__, $sql);
	}
en replace by:

Code: Select all

$sql = "SELECT u.user_id, u.user_email, u.user_lang
		FROM " . FORUMS_WATCH_TABLE . " fw, " . USERS_TABLE . " u
		WHERE fw.forum_id = $forum_id
			AND fw.user_id NOT IN (" . $userdata['user_id'] . ", " . ANONYMOUS . $user_id_sql . ")
			AND u.user_id = fw.user_id";
	if (!($result = $db->sql_query($sql)))
	{
		message_die(GENERAL_ERROR, 'Could not obtain list of forum watchers', '', __LINE__, __FILE__, $sql);
	}
so the only thing that happens is remove the line
AND fw.notify_status = " . TOPIC_WATCH_UN_NOTIFIED . "
i did not liked the way i did it at myself too, becouse i used the notify status to check if people have readen the last posted topic... this new one lets the status intact, but also mails everyone at an new topic, not on an new reply, if you also want people to be mailen when a new reply is posted, you'll need to the the same a few lines obove this, in the "notification on new post" part....
What the code is doing:
i dont know if you know how this works, so i'm explaining:
- in the beginning, when you have users, but no user is notifyd, the FORUMS_WATCH_TABLE is empty.
- when someone wants to be notified, and click the link, an row is added, with the user id, forum number, and status.
- the status is 0 at the beginning.
- when someone posts an new topic:
- everybody in the table is selected (SELECT u.user_id, u.user_email, u.user_lang FROM " . FORUMS_WATCH_TABLE)
- but only when the user is watching that forum (WHERE fw.forum_id = $forum_id)
- and also only when your not anonymous (AND fw.user_id NOT IN (" . $userdata['user_id'] . ", " . ANONYMOUS . $user_id_sql . ") )
- and also only when your status is 0 (AND fw.notify_status = " . TOPIC_WATCH_UN_NOTIFIED . ")
everyone who meats tat is mailed.
so when you remove the line
AND fw.notify_status = " . TOPIC_WATCH_UN_NOTIFIED . "
every user is selected whos watching the forum, not only the ones with status 0.
and thats important, becouse, after mailing, every user is set to status 1, so when someone post 2 topics with 1 minute between, normally nobody has to be mailen.
when a user visits the forum, the status is set to 0, so when somebody posts an new topic, hes mailed again.
i had the problem that we use the forum for members of an club, and some members dont look much at the forum, but i want, the who's watching, always get an mail, not only when he has opened the forum, so than this is an perfect solution.

now for who want to play big brother, and want to know if users have readen your important new message? i have the page permissions plugin of pagedoctor, so i dont know for sure if this page is also working when you dont have installed it. just give it a try:
you can make an page called whoswatching.php:

Code: Select all

<?php

// Blank phpBB page created to be used as a tutorial
// for adding a new php page to your phpBB forum
// environment. The latest version of this file
// and the associated template (which includes
// the content of the tutorial) can be downloaded
// from www.phpbbdoctor.com and is included as 
// bonus material in the Page Permissions MOD.
// © www.phpBBDoctor.com

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//

$page_title = 'Abonnementen lijst.';

include($phpbb_root_path . 'includes/page_header.'.$phpEx);?>


<br />
<font color=red>no</font> = not subscribed to this forum.<br />
<font color=green>yes 0</font> = subscribed and readen after last new topic.<br />
<font color=orange>yes 1</font> = subscribed but not readen after last new topic.<br />
<br />
<table>
<tr><td style="border: solid 1px gray;">username</td><td border="1" style="layout-flow: vertical-ideographic; border: solid 1px gray;">Site Beheer</td><td border="1" style="layout-flow: vertical-ideographic; border: solid 1px gray;">Projecten</td><td border="1" style="layout-flow: vertical-ideographic; border: solid 1px gray;">Repetities</td><td border="1" style="layout-flow: vertical-ideographic; border: solid 1px gray;">Geld</td><td border="1" style="layout-flow: vertical-ideographic; border: solid 1px gray;">Bestuur</td><td border="1" style="layout-flow: vertical-ideographic; border: solid 1px gray;">Activiteiten</td><td border="1" style="layout-flow: vertical-ideographic; border: solid 1px gray;">Overig</td><td border="1" style="layout-flow: vertical-ideographic; border: solid 1px gray;">Vereniging</td><td border="1" style="layout-flow: vertical-ideographic; border: solid 1px gray;">mp3 s</td><td border="1" style="layout-flow: vertical-ideographic; border: solid 1px gray;">test</td></tr>
<?php

include('config.php');
$query = mysql_query("SELECT * FROM phpbb_users ORDER BY username ASC") or die(mysql_error());
while($object = mysql_fetch_object($query)){
	echo '<tr><td style="border: solid 1px gray;">';
	echo $object->username;
	echo ' (';
	echo $object->user_id;
	echo ')';
	echo '</td><td style="border: solid 1px gray;">';	
	$lid = mysql_query("SELECT * FROM phpbb_forums_watch WHERE user_id='".$object->user_id."' AND forum_id='1'") or die(mysql_error());
	$abbo = "<font color=red>no</font>";
	while($lidabbo = mysql_fetch_object($lid)){
		if($lidabbo->notify_status == 1){
			$abbo = "<font color=orange>yes 1</font>";
		}
		else if($lidabbo->notify_status == 0){
			$abbo = "<font color=green>yes 0</font>";
		}
		else{
			$abbo = "<font color=black>fout</font>";
		}
	}
	echo $abbo;
	echo '</td><td style="border: solid 1px gray;">';	
	$lid = mysql_query("SELECT * FROM phpbb_forums_watch WHERE user_id='".$object->user_id."' AND forum_id='2'") or die(mysql_error());
	$abbo = "<font color=red>no</font>";
	while($lidabbo = mysql_fetch_object($lid)){
		if($lidabbo->notify_status == 1){
			$abbo = "<font color=orange>yes 1</font>";
		}
		else if($lidabbo->notify_status == 0){
			$abbo = "<font color=green>yes 0</font>";
		}
		else{
			$abbo = "<font color=black>fout</font>";
		}
	}
	echo $abbo;
	echo '</td><td style="border: solid 1px gray;">';	
	$lid = mysql_query("SELECT * FROM phpbb_forums_watch WHERE user_id='".$object->user_id."' AND forum_id='3'") or die(mysql_error());
	$abbo = "<font color=red>no</font>";
	while($lidabbo = mysql_fetch_object($lid)){
		if($lidabbo->notify_status == 1){
			$abbo = "<font color=orange>yes 1</font>";
		}
		else if($lidabbo->notify_status == 0){
			$abbo = "<font color=green>yes 0</font>";
		}
		else{
			$abbo = "<font color=black>fout</font>";
		}
	}
	echo $abbo;
	echo '</td><td style="border: solid 1px gray;">';	
	$lid = mysql_query("SELECT * FROM phpbb_forums_watch WHERE user_id='".$object->user_id."' AND forum_id='4'") or die(mysql_error());
	$abbo = "<font color=red>no</font>";
	while($lidabbo = mysql_fetch_object($lid)){
		if($lidabbo->notify_status == 1){
			$abbo = "<font color=orange>yes 1</font>";
		}
		else if($lidabbo->notify_status == 0){
			$abbo = "<font color=green>yes 0</font>";
		}
		else{
			$abbo = "<font color=black>fout</font>";
		}
	}
	echo $abbo;
	echo '</td><td style="border: solid 1px gray;">';	
	$lid = mysql_query("SELECT * FROM phpbb_forums_watch WHERE user_id='".$object->user_id."' AND forum_id='5'") or die(mysql_error());
	$abbo = "<font color=red>no</font>";
	while($lidabbo = mysql_fetch_object($lid)){
		if($lidabbo->notify_status == 1){
			$abbo = "<font color=orange>yes 1</font>";
		}
		else if($lidabbo->notify_status == 0){
			$abbo = "<font color=green>yes 0</font>";
		}
		else{
			$abbo = "<font color=black>fout</font>";
		}
	}
	echo $abbo;
	echo '</td><td style="border: solid 1px gray;">';	
	$lid = mysql_query("SELECT * FROM phpbb_forums_watch WHERE user_id='".$object->user_id."' AND forum_id='6'") or die(mysql_error());
	$abbo = "<font color=red>no</font>";
	while($lidabbo = mysql_fetch_object($lid)){
		if($lidabbo->notify_status == 1){
			$abbo = "<font color=orange>yes 1</font>";
		}
		else if($lidabbo->notify_status == 0){
			$abbo = "<font color=green>yes 0</font>";
		}
		else{
			$abbo = "<font color=black>fout</font>";
		}
	}
	echo $abbo;
	echo '</td><td style="border: solid 1px gray;">';	
	$lid = mysql_query("SELECT * FROM phpbb_forums_watch WHERE user_id='".$object->user_id."' AND forum_id='7'") or die(mysql_error());
	$abbo = "<font color=red>no</font>";
	while($lidabbo = mysql_fetch_object($lid)){
		if($lidabbo->notify_status == 1){
			$abbo = "<font color=orange>yes 1</font>";
		}
		else if($lidabbo->notify_status == 0){
			$abbo = "<font color=green>yes 0</font>";
		}
		else{
			$abbo = "<font color=black>fout</font>";
		}
	}
	echo $abbo;
	echo '</td><td style="border: solid 1px gray;">';	
	$lid = mysql_query("SELECT * FROM phpbb_forums_watch WHERE user_id='".$object->user_id."' AND forum_id='8'") or die(mysql_error());
	$abbo = "<font color=red>no</font>";
	while($lidabbo = mysql_fetch_object($lid)){
		if($lidabbo->notify_status == 1){
			$abbo = "<font color=orange>yes 1</font>";
		}
		else if($lidabbo->notify_status == 0){
			$abbo = "<font color=green>yes 0</font>";
		}
		else{
			$abbo = "<font color=black>fout</font>";
		}
	}
	echo $abbo;
	echo '</td><td style="border: solid 1px gray;">';	
	$lid = mysql_query("SELECT * FROM phpbb_forums_watch WHERE user_id='".$object->user_id."' AND forum_id='9'") or die(mysql_error());
	$abbo = "<font color=red>no</font>";
	while($lidabbo = mysql_fetch_object($lid)){
		if($lidabbo->notify_status == 1){
			$abbo = "<font color=orange>yes 1</font>";
		}
		else if($lidabbo->notify_status == 0){
			$abbo = "<font color=green>yes 0</font>";
		}
		else{
			$abbo = "<font color=black>fout</font>";
		}
	}
	echo $abbo;
	echo '</td><td style="border: solid 1px gray;">';	
	$lid = mysql_query("SELECT * FROM phpbb_forums_watch WHERE user_id='".$object->user_id."' AND forum_id='10'") or die(mysql_error());
	$abbo = "<font color=red>no</font>";
	while($lidabbo = mysql_fetch_object($lid)){
		if($lidabbo->notify_status == 1){
			$abbo = "<font color=orange>yes 1</font>";
		}
		else if($lidabbo->notify_status == 0){
			$abbo = "<font color=green>yes 0</font>";
		}
		else{
			$abbo = "<font color=black>fout</font>";
		}
	}
	echo $abbo;
	echo '</td><tr>';
}
?>
</table>
<br /><br />
<?php
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

?>
you have to add the forums manualy!
you see one tr with the names of my forums, you can put the names of your forums to there, and delete or add cells if you have more or less forums as me.
then youll see much the same blocks. every block is one forum, so also let this blocks correspons with the forums you added in the first tr.
aware: the last blok is a bit diferent becouse he has to close the row, so only copy paste or delete blocks before it, and only change the forum number of the last one.
when you upload the file you will see a table witch all users, and after all users youll see a red no if they are not watching a forum, a green "yes 0" when they have status 0, so they have readen the forum since last topic, or a orange "yes 1" when they have status 1, so they have not readen the forum since last topic.

Post Reply

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