PDA

View Full Version : Skip a Forums New Posts - Add "Mark Forum Read" to New Posts search


Greebo
10-31-2005, 10:00 PM
Skip a Single Forums New Posts
Add "Mark Forum Read" to New Posts search

When doing a New Posts search (and only on a New Posts search), this hack adds a "Mark This Forum Read" link to the forum column. Users can click this link to mark a single forum read from the New Posts search results, thus "skipping" that forum from the new posts search.

When the link is clicked, the selected forum is marked read and the user is redirected back to a new New Posts search.

Negatives: If forum has a time limit on searches, the user will get the message about having to wait to conduct a search if they didn't wait that long before clicking the mark read link.

Version 1.0
vBulletin Compatibility: 3.5.0

Required changes: 1 Template Edit, 1 Code File Edit

Cyricx
11-01-2005, 01:03 PM
Very nice, great idea!

Greebo
11-01-2005, 01:10 PM
Thanks, but its not really my idea. In the 3.0.x series, I used this hack:
https://vborg.vbsupport.ru/showthread.php?t=67154

That hack included the same thing. But 3.5.0 makes that hack no longer necessary. I just liked the behavior and converted it to the 3.5.0 engine. :)

Snake
11-01-2005, 04:26 PM
Nice one!

yessir
11-01-2005, 09:45 PM
Awesome mod idea.

I'll hold out for a product and work around the search timeout feature. On many boards search times are limited. My board is one of these (and for good reason).

Greebo
11-02-2005, 01:02 PM
Don't hold out too long - the most appropriate hook for a plugin is forumdisplay_complete, and while that might work, it means the entire forumdisplay file will get processed before the redirect code is fired, where my code modification means the forum is marked read and the user is sent right back to the search, just as quick as possible.

I'll submit a hook request but.. don't hold yer breath. :)

SpanishHarlem
11-02-2005, 02:08 PM
Thank's. My member's will love this hack. With so many forum's they don't like to read all.

Andreas
11-05-2005, 03:17 PM
*** Untested ***

To avoid the fileedits:

redirect_generic

global $recursecheck_hdr;
if (!empty($_REQUEST['returnToSearch']) AND !$recursecheck_hdr);
{
$recursecheck_hdr = true;
$vbulletin->url = 'search.php?' . $vbulletin->session->vars['sessionurl'] . 'do=getnew';
eval(print_standard_redirect('markread_single'));
}



header_redirect

global $recursecheck;
if (!empty($_REQUEST['returnToSearch']) AND !$recursecheck);
{
$recursecheck = true;
exec_header_redirect('search.php?' . $vbulletin->session->vars['sessionurl'] . 'do=getnew');
}

Greebo
01-11-2006, 12:55 PM
Hmm, I tried those mods, Andreas, but they ended up hanging the forum. I don't have time atm to debug it so I'm sticking with me file edits for now. :)

JohnBee
06-28-2006, 04:46 PM
I love this idea - LOVE IT!

However it only works in IE and not Firefox... When I try in firefox(mark as read) it returns with an empty list after the first one. When I tested this in IE it works flawlessly by refreshing the list with the next thread in line.

Any ideas?

JohnBee
10-10-2006, 10:36 AM
As an update to this, Firefox RC1/2 run the html nicely.

However I noticed a slight anomaly under the circumstances. The ling string in the mark read url can potentially break the tables so I created a simple phrase to put things back into order.

(I have also been thinking of adding this as an icon instead of text to keep things cleaner.)
In any case it's a great hack, very useful to have. - thx

<if condition="$show['forumlink']">
<td class="alt1"><a href="forumdisplay.php?$session[sessionurl]f=$thread[forumid]">$thread[forumtitle]</a><br><if condition="$display['getnew']">$vbphrase[mark_forum_read]</if></td></if>

JohnBee
10-11-2006, 08:10 PM
Correction... id still does not work with Firefox properly.

Looks as though for some reason the browser is not able to process a single search request but marks the entire lot as read instead. ( no clue why but thats what I found during testing)

Most of my members use FF so I had to remove it again :(
To bad the hack has lots of potential imo.

Canis Firebrand
11-08-2006, 11:14 AM
Would love to see this updated and the issues fixed. I had it in place before and it sort of worked. It had the issues as mentioned above where it would mark an entire forum read.

JohnBee
11-09-2006, 01:03 AM
Would love to see this updated and the issues fixed. I had it in place before and it sort of worked. It had the issues as mentioned above where it would mark an entire forum read.
Actually this is how it works :(
Turns out this marks the entire forum as read and not the individual posts display'd in the new post search results. (to bad) I removed the hack since it was not what I was trying to achieve, as far as I know there is no modification that can do that.

PS. there is an html error in the template change. where it ends with <td> but it should be </td> messes up the layout.

jeremyalyea
10-02-2007, 02:53 AM
I have tried this with v3.6 but it does not work. Does anyone know how to make this work or is there another mod that does something similar. It is exactly what I'm looking for.

jeremyalyea
11-13-2007, 01:55 AM
Does anyone else find this hack useful? It is exactly what I need but it doesn't work on 3.6.x

dvbusuario
11-22-2007, 10:42 PM
In 3.6.8 don't work :(

Greebo
11-15-2010, 03:50 PM
Just reapplied this to 3.8.6 - works fine but the text to search in forumdisplay.php has changed:
Search for
eval(print_standard_redirect($mark_read_result['phrase']));replace with
if (empty($_REQUEST['returnToSearch']))
{
eval(print_standard_redirect($mark_read_result['phrase']));
}
else
{
exec_header_redirect('search.php?do=getnew');
}