Oh, damn, my bad... can we move this thread to the appropriate forum?
1 2005-07-06 07:08
Re: Plugin Idea - RedirLART (3 replies, posted in PunBB 1.2 modifications, plugins and integrations)
2 2005-07-06 06:36
Topic: Plugin Idea - RedirLART (3 replies, posted in PunBB 1.2 modifications, plugins and integrations)
I would very much like to have a LART (Luser Attitude Readjustment Tool) plugin that would allow me to set a specified duration of time during which the specified user would, upon login, be redirected to the URL of my choice. The redirect URL should be independently configurable for each user being LARTed, thus allowing admins not only to punish users without banning them outright, but also to hammer home the point of the punishment. For instance, if a user posts a commercial advertisement, you could redirect him to the URL referenced in the ad for a few days.
Each time the user attempts to login, a table is consulted, and if the user appears on the table, he/she is redirected to the corresponding URL. Before redirecting the user, a brief notice stating that the user is being punished in this fashion (and why, and for how long) should be displayed.
Any coder cowboys interested in riding this bronc to reality?
3 2005-07-03 13:06
Re: Mark topics as read v1.1 (92 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Aha, I went over it and discovered that it was an installation error... however, it was an error that could have been easily avoided with a small change in the install instructions at 46.
The current install instructions say:
=========================================================
#
#---------[ 46. FIND (line: 105) ]--------------------------------------------
#
$result = $db->query('SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, s.user_id AS is_subscribed FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'subscriptions AS s ON (t.id=s.topic_id AND s.user_id='.$pun_user['id'].') LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id='.$id.' AND t.moved_to IS NULL') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
#
#---------[ 47. REPLACE WITH ]------------------------------------------------
#
// MOD: MARK TOPICS AS READ - 1 LINE MODIFIED CODE FOLLOWS
$result = $db->query('SELECT t.subject, t.closed, t.num_replies, t.sticky, t.last_post, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, s.user_id AS is_subscribed FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'subscriptions AS s ON (t.id=s.topic_id AND s.user_id='.$pun_user['id'].') LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id='.$id.' AND t.moved_to IS NULL') or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
=====================================================================
The problem with this is that there are two lines that are both very very long and very very similar to each other in the immediate vicinity of line 105. Add a mod or two and it becomes pretty hazy which one is the right one to modify. I had the wrong one, and that generated the notice I mentioned, plus killed the function of the mod.
4 2005-07-03 01:15
Re: Mark topics as read v1.1 (92 replies, posted in PunBB 1.2 modifications, plugins and integrations)
Hi Miles et al,
I've installed the 1.1.3 version of this mod on my punBB 1.2.5 board... the mod is not working, and users (not admins) are seeing this error at the top of the page:
Notice: Undefined index: last_post in /var/www/cinema-obscura.com/viewtopic.php on line 118
I hope we can resolve this; I really hate the default behavior of the 'new posts' indicators.