[2.0.13] Forum Watch

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

Rating:

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

Extensions Robot
Extensions Robot
Extensions Robot
Posts: 27931
Joined: Sat Aug 16, 2003 7:36 am

[2.0.13] Forum Watch

Post by Extensions Robot » Wed Apr 13, 2005 8:33 am

MOD Name: Forum Watch
Author: skinmaster
MOD Description: Allows forum users to watch a forum for new topics.


MOD Version: 1.0.2

Download File: Forum-Watch-1.0.2.zip
mods overview page: View
File Size: 7315 Bytes

Security Score: 0
Last edited by Extensions Robot on Mon Apr 30, 2007 12:30 am, edited 1 time in total.
(this is a non-active account manager for the phpBB Extension Customisations Team)

ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 » Sun Apr 17, 2005 11:27 am

MOD Validated/Released

Notes:
Same as the default watch topic function, but this MOD allows users to watch a forum for new topics.

User avatar
onigumo
Registered User
Posts: 1755
Joined: Fri Oct 31, 2003 2:32 am
Contact:

Post by onigumo » Sun Apr 17, 2005 9:29 pm

I've noticed what I believe to be a problem with the mod. When clicking "Watch this forum for new topics" and going back to view forum, a gap may form between the page number and the now "Stop watching this forum". So, for instance, after clicking "Watch this forum for new replies" and going back to viewforum, I now get this:

Page 1 of 1 [ 20 Topics ]


Stop watching this forum

When those two should be close together like this:

Page 1 of 1 [ 20 Topics ]
Stop watching this forum

A simple refresh of the page fixes that, but it's still irritating to me.

The gap seems to appear at random. I went into another forum and the gap was there, even though I didn't click on "Watch this forum for new topics"
I write articles on community building
@ The Infinity Program.

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

Post by NightriderXP » Sun Apr 17, 2005 9:59 pm

I modified the code so that the new "Forum Watch" link was added to an existing table column. This is how I changed the code and it seems to display consistently on 12 different templates:

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#

templates/subSilver/viewforum_body.tpl
#
#-----[ FIND ]------------------------------------------
#
	  <td align="right" valign="bottom" class="nav" nowrap="nowrap"><span class="gensmall"><a href="{U_MARK_READ}">{L_MARK_TOPICS_READ}</a></span></td>
# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 
	  <td align="right" valign="middle" class="nav" nowrap="nowrap"><span class="gensmall"><a href="{U_MARK_READ}">{L_MARK_TOPICS_READ}</a><br />{S_WATCH_FORUM}</span></td>
This is how it displays:

Image

After making a few small modifications to the script to match my heavily modded board, this installed perfectly into 12 templates using EasyMod into phpBB 2.0.14. I've been hoping that someone would come up with this code, so now I'm a happy camper...

:lol:

skinmaster
Registered User
Posts: 32
Joined: Tue Feb 17, 2004 7:46 am

Post by skinmaster » Mon Apr 18, 2005 6:54 pm

onigumo wrote: I've noticed what I believe to be a problem with the mod. When clicking "Watch this forum for new topics" and going back to view forum, a gap may form between the page number and the now "Stop watching this forum".


I dont' see this behaviour on my forums using SubSilver as the theme. I have not tried with any alternative themes. I would suggest checking the HTML if you are using a custom theme.
I modified the code so that the new "Forum Watch" link was added to an existing table column.


Personally, I prefer it up there, but, since I have to mod subsilver for a mod release, I thought it best to place it in a consistant fashion. If a user is used to looking to the bottom left to watch the topic, then that's where they'll look to watch the forum.

I think it would be nicer top left though.

I'll include your mod clip in the contrib of any future version if that's ok.

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

Post by NightriderXP » Mon Apr 18, 2005 9:13 pm

I was thinking about adding a second link at the bottom too in the Authorization List panel. That way the members can use the link that best suits their needs. The pagination, member online list, and Index hyperlink are at the top and bottom. Why not this link too???

Your arrangement may look good for most users, so AFAIC, you can leave it in the location where you originally placed it. I've rearranged all the links so that they are standard on all 12 templates that I use. So I don't know whether the script that I provided will work for anyone else. I don't have immediate access to a vanilla board so I can't even check to make sure...

:lol:

patchesj
Registered User
Posts: 5
Joined: Tue Feb 01, 2005 8:26 pm

Error-You cannot make another post so soon after your last

Post by patchesj » Wed Apr 20, 2005 5:14 pm

When posting a new topic I get the following error: You cannot make another post so soon after your last; please try again in a short while.

The post gets posted into the forum OK. I am using the Spelling Cow mod, calendar and attachment mod. Not sure if these are interfering.

It looks like the code replacement in posting.php is causing the issue.

Thanks,

skinmaster
Registered User
Posts: 32
Joined: Tue Feb 17, 2004 7:46 am

Re: Error-You cannot make another post so soon after your la

Post by skinmaster » Wed Apr 20, 2005 6:19 pm

patchesj wrote: It looks like the code replacement in posting.php is causing the issue.


The replace in posting.php calls a different function to the regular one if a new topic is being posted, rather than anything else happening.

The called function is 90% a clone of the existing function, and contains no code related to flood control what-so-ever. It merely creates topic subscriptions if the "Notify me when a reply is posted" box is checked and creates notifications for anyone who is watching the forum in which the topic is posted.

If you have an issue with flood control after installing the mod, then I suspect you've either made a mistake with the install, or something else is broken. The mod doesn't touch on any of the flood control code.

patchesj
Registered User
Posts: 5
Joined: Tue Feb 01, 2005 8:26 pm

Post by patchesj » Wed Apr 20, 2005 6:24 pm

Going back to the original code in posting.php fixes the problem, even with all other code changes in place.

I've tried a few times re-inserting the code, same errors everytime.

side note: these are the line directly after the mod:

if ( $mode == 'newtopic' || $mode == 'reply' )
{
$tracking_topics = ( !empty($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_t']) : array();
$tracking_forums = ( !empty($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) ) ? unserialize($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_f']) : array();

if ( count($tracking_topics) + count($tracking_forums) == 100 && empty($tracking_topics[$topic_id]) )
{
asort($tracking_topics);
unset($tracking_topics[key($tracking_topics)]);
}

$tracking_topics[$topic_id] = time();

setcookie($board_config['cookie_name'] . '_t', serialize($tracking_topics), 0, $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']);
}

skinmaster
Registered User
Posts: 32
Joined: Tue Feb 17, 2004 7:46 am

Post by skinmaster » Wed Apr 20, 2005 6:30 pm

Can you send me your pre forumwatch mod postings.php? Then I can diff it against my post forumwatch watch mod postings.php and see what's going on. Also, the includes/functions_post.php file after you apply the forum watch mod. AS I suspect the problem is in there, it's just the call makes it appear.

skinmaster
Registered User
Posts: 32
Joined: Tue Feb 17, 2004 7:46 am

Post by skinmaster » Wed Apr 20, 2005 6:43 pm

Hmmm...

Flood control is handled in submit_post in functions_post.php around line 216:

Code: Select all

//
// Post a new topic/reply/poll or edit existing post/poll
//
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, &$post_username, &$post_subject, &$post_message, &$poll_title, &$poll_options, &$poll_length)
{
This is called in posting.php on line 554:

Code: Select all

			if ( $error_msg == '' )
			{
				$topic_type = ( $topic_type != $post_data['topic_type'] && !$is_auth['auth_sticky'] && !$is_auth['auth_announce'] ) ? $post_data['topic_type'] : $topic_type;

				submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("\'", "''", $username), str_replace("\'", "''", $subject), str_replace("\'", "''", $message), str_replace("\'", "''", $poll_title), $poll_options, $poll_length);
			}
			break;
The replace in posting.php for my code is around line 572, after the call to submit_post.

The message you report is in $lang['Flood_Error'] which I can only find in functions_post.php in the body of submit_post.

Having said that, I only have the files:

posting.php
lang_main.php
functions_post.php

Open here, the rest is up on my site.

In my instance of phpBB 2.0.14 with only my mod installed, everything works fine. There must be some collision in the functions_post.php file in your instance, or in the posting.php file.

skinmaster
Registered User
Posts: 32
Joined: Tue Feb 17, 2004 7:46 am

Post by skinmaster » Wed Apr 20, 2005 7:13 pm

I installed your functions_post.php into my site, replacing code here:

Code: Select all

//-- mod : calendar --------------------------------------------------------------------------------
// here we have added
//	, topic_calendar_time, topic_calendar_duration
//	, $topic_calendar_time, $topic_calendar_duration
// and
//	, topic_calendar_time = $topic_calendar_time, topic_calendar_duration = $topic_calendar_duration
//-- modify
to restore the original insert sql statement as I don't have the calendar topic tables in place, and everything worked fine.

I can't spend the time right now to apply the whole calendar mod and attachment mod to fully test, but there must be a collision happening somewhere.

If anyone else has any suggestions?

You can test mine here:
http://cgi.skinmaster.plus.com/phpBB2

jacksonpt
Registered User
Posts: 77
Joined: Wed Mar 30, 2005 2:18 pm

Post by jacksonpt » Wed Apr 20, 2005 11:07 pm

I downloaded the zip file, and the readme says I need to install the original mod FIRST... that this is a mod to that mod. Where is the original file? I found what I think to be in another site, but not here.

skinmaster
Registered User
Posts: 32
Joined: Tue Feb 17, 2004 7:46 am

Post by skinmaster » Thu Apr 21, 2005 6:42 am

jacksonpt wrote: I downloaded the zip file, and the readme says I need to install the original mod FIRST... that this is a mod to that mod. Where is the original file? I found what I think to be in another site, but not here.


The mod includes a mod to itself. The file Forum-Watch-1.0.2.mod is the Forum Watch mod. Install that. The file Forum-Watch-Topic-1.0.2.mod is a mod to apply after applying the main mod, if you want it.

The base forum watch mod gives people an email notification when new topics are posted to a forum when they are subscribed to that forum and allows them to subscribe and unsubscribe to the forum.

The forum-watch-topic-1.0.2.mod file extends this to automaticaly add a watch to each new topic for subscribed members, which is a feature I didn't think should be in the core mod but my company required in their forums.

In the zip file there is:

forum_notify.tpl - part of the mod
Forum-Watch-1.0.2.mod - The main mod file
readme.txt - Information about the contrib
/contrib/Forum-Watch-Topic-1.0.2.mod - an extension of the main mod.

jacksonpt
Registered User
Posts: 77
Joined: Wed Mar 30, 2005 2:18 pm

Post by jacksonpt » Thu Apr 21, 2005 10:01 am

OK... now I get it.

2 last questions, then you can get back to your real job :wink:

First...
Is there a way to set which forums users are allowed to watch? I didn't see a setting in the ACP, but I may have just missed it.

Second...
A request (as if you don't already have enough to do): Could it be setup so that when a user started watching a forum, they had the option to select whether they wanted e-mail notifications only when a new thread was created or if they wanted a notifcation for all new posts in that forum? Bascially, set it up so that when a user clicked the "watch this forum" link, they were prompted whether they wanted to use the first mod (new threads only) or the modded mod (new threads and new replies). Make sense?
Last edited by jacksonpt on Thu Apr 21, 2005 3:17 pm, edited 1 time in total.

Post Reply

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