Advertisement:

Author Topic: Mark Selected Topics As Read  (Read 39919 times)

Offline ITA003

  • Jr. Member
  • **
  • Posts: 145
  • Gender: Male
    • SalsaBergamo.it
Re: Mark Selected Topics As Read
« Reply #60 on: October 22, 2008, 05:41:32 PM »
Very nice!!
I change something in the mod because I saw some errors at this line (for me line 239):

Code: [Select]
$topics = explode('-', $_REQUEST['topics']);
I'd like to know if you think to update SMF 2.0, if no, I can make the update to the mod.

In the next week I must to test SMF 2.0 in my test forum... and I'd to continue to use this mod.

Offline ITA003

  • Jr. Member
  • **
  • Posts: 145
  • Gender: Male
    • SalsaBergamo.it
Re: Mark Selected Topics As Read
« Reply #61 on: October 27, 2008, 07:29:22 PM »
I read that 2.0 beta 4 put checkbox in unread topic if you set the

Show quick-moderation on message index as

checkboxes

In the 1.1.x not...

Offline AlaStar

  • Jr. Member
  • **
  • Posts: 139
Re: Mark Selected Topics As Read
« Reply #62 on: December 18, 2008, 11:10:45 AM »
I am with the same error...

if any checkboxes be not selected i get this error:

Quote
Undefined index: topics
Ficheiro: /home/nemigue/public_html/Sources/Subs-Boards.php
Linha: 239

and

Quote
The following errors are fouling up your forum:
Topic #0 is marked as read for one or more people, but does not exist.

Would you like to fix these errors?
Yes - No

some ideas?

this MOD is very important for me...

I have this problems too.  :(
I'm using version 1.1.7 and dilbermc theme.
How can I solved this  ???

Offline AlaStar

  • Jr. Member
  • **
  • Posts: 139
Re: Mark Selected Topics As Read
« Reply #63 on: December 27, 2008, 02:51:11 AM »
*bump*

anyone solved this problems ?

Offline digit

  • Sophist Member
  • *****
  • Posts: 1,364
  • Gender: Male
Re: Mark Selected Topics As Read
« Reply #64 on: July 20, 2009, 02:37:54 PM »

I change something in the mod because I saw some errors at this line (for me line 239):

Code: [Select]
$topics = explode('-', $_REQUEST['topics']);

Is THIS the fix?  (it sounds like you solved it somehow - but that line IS line 239)

The error is still occurring for me.....

SIGH

Thanks.
Happily using a heavily modified 1.1.16 version of SMF!

2748011 Posts in 320998 Topics by 50986 Members


SOLD my website - thanks it was a good run - they converted to vbadvanced. (and screwed it up good!)

Offline heavyccasey

  • Jr. Member
  • **
  • Posts: 212
Re: Mark Selected Topics As Read
« Reply #65 on: August 14, 2009, 05:40:18 AM »
I wrote the following code with inspiration from this mod. This is for 1.1.10, although it might work for earlier. Make sure you understand what I'm doing so you don't mess the code up, since my instructions can be a bit ambiguous.

KEEP A BACKUP. PLEASE. I'M WARNING YOU. I applied changes directly to my forum, so I'm unsure if this list of instructions is correct or complete. Use at your own risk.

Recent.template.php
Repeat the following for both the template_unread() function and the template_replies() function. They are both extremely similar, and so we are applying the same changes to both. Follow the below instructions twice for each of the two functions.


1. Find the $mark_read array and add this item to it:
Code: [Select]
'markselected' => array('text' => 'mark_selected', 'lang' => true, 'url' => 'javascript:document.quickModForm.submit();')

2. Find this right after it...
Code: [Select]
echo '
</tr>
</table>

...And add this form element:
Code: [Select]
<form action="', $scripturl, '?action=markasread;sa=unreadreplies;return=', urlencode(base64_encode(serialize($_GET))), ';sesc=', $context['session_id'], '" method="post" accept-charset="', $context['character_set'], '" name="quickModForm" id="quickModForm" style="margin: 0;">

3. For template_unread(), find:
Code: [Select]
</td><td width="24%">
<a href="', $scripturl, '?action=unread', $context['showing_all_topics'] ? ';all' : '', $context['querystring_board_limits'], ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[111], $context['sort_by'] == 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a>
</td>
For template_replies(), find:
Code: [Select]
<td width="24%"><a href="', $scripturl, '?action=unreadreplies', $context['querystring_board_limits'], ';sort=last_post', $context['sort_by'] == 'last_post' && $context['sort_direction'] == 'up' ? ';desc' : '', '">', $txt[111], $context['sort_by'] == 'last_post' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>
Add after that:
Code: [Select]
<td class="windowbg2" valign="middle" width="4%" align="center">
<input type="checkbox" onclick="invertAll(this, this.form, \'topic_array[]\');" class="check" />
</td>


4. Find:
Code: [Select]
<td class="windowbg2" valign="middle" width="22%">
<a href="', $topic['last_post']['href'], '"><img src="', $settings['images_url'], '/icons/last_post.gif" alt="', $txt[111], '" title="', $txt[111], '" style="float: right;" /></a>
<span class="smalltext">
', $topic['last_post']['time'], '<br />
', $txt[525], ' ', $topic['last_post']['member']['link'], '
</span>
</td>

Add after:
Code: [Select]
<td class="windowbg2" valign="middle" width="4%" align="center">
<input type="checkbox" name="topic_array[]" class="check" value="', $topic['id'], '" />
</td>


5. Find:
Code: [Select]
echo '
</table>
</td></tr>
</table>

And add after:
Code: [Select]
</form>

6. Replace any...
Code: [Select]
colspan="7"...in the function with...
Code: [Select]
colspan="8"


Modifications.english.php
Add this to it:
Code: [Select]
$txt['mark_selected'] = 'Mark Selected as Read';


Subs-Boards.php.

Find:
Code: [Select]
// Make sure all the boards are integers!
Replace the line after with:
Code: [Select]
$topics = !empty($_POST['topic_array']) ? $_POST['topic_array'] : explode('-', !empty($_REQUEST['topics']) ? $_REQUEST['topics'] : '');

Find:
Code: [Select]
if (isset($_SESSION['topicseen_cache']))
$_SESSION['topicseen_cache'] = array();

Replace the redirectexit() line with:
Code: [Select]

if (!empty($_REQUEST['return'])) {
$link = '';
foreach (unserialize(base64_decode($_REQUEST['return'])) as $i => $value)
$link .= $i . '=' . $value . ';';
} else
$link = 'action=unreadreplies';

redirectexit($link);
      
And that should do it. Test it.

If you understood that, then you are probably capable of writing a mod, so if you would like to distribute these edits as a mod, feel free to do so. You must link to this post, if you do though.

Offline samurai-lupin

  • Full Member
  • ***
  • Posts: 522
Re: Mark Selected Topics As Read
« Reply #66 on: August 05, 2010, 12:51:28 AM »
update... found a major glitch in it. (well its major for my site)..lol. Went today and clicked on Show Unread Posts Since Last Visit and then I scrolled down and clicked on "All Unread Posts" so I could see all of them not just those. I always start at the very last page and work forward. Read a few on the last page, the rest were not ones I needed to read so I selected them - and "marked selected read". My page refreshed but it went back to where it was only showing "unread posts since last visit" not all the unread posts. You have to scroll back down and click on All Unread every time you select some and mark them as being read.


Any fix for this so it wont kep reverting back to just the unread since last visit?

Thanks :)

Sorry for bringing up this old problem but I am looking for a solution for the exact same thing. Any advice is most appreciated. Thank you!

Offline emanuele

  • SMF Super Hero
  • *******
  • Posts: 14,156
  • Gender: Male
  • THERE'S JUST ME
Re: Mark Selected Topics As Read
« Reply #67 on: August 09, 2010, 03:26:48 PM »
In Recent.template.php
find:
Code: [Select]
<form action="', $scripturl, '?action=markasread;sa=unreadreplies;sesc=', $context['session_id'], ';ut" method="post" name="markasread" accept-charset="', $context['character_set'], '" style="margin: 0;">replace with:
Code: [Select]
<form action="', $scripturl, '?action=markasread' , $context['showing_all_topics'] ? ';all' : '' , ';sa=unreadreplies;sesc=', $context['session_id'], ';ut" method="post" name="markasread" accept-charset="', $context['character_set'], '" style="margin: 0;">
find:
Code: [Select]
<form action="', $scripturl, '?action=markasread;sa=unreadreplies;sesc=', $context['session_id'], '" method="post" name="markasread" accept-charset="', $context['character_set'], '" style="margin: 0;">replace with:
Code: [Select]
<form action="', $scripturl, '?action=markasread' , $context['showing_all_topics'] ? ';all' : '' , ';sa=unreadreplies;sesc=', $context['session_id'], '" method="post" name="markasread" accept-charset="', $context['character_set'], '" style="margin: 0;">
In Subs-Boards.php
find:
Code: [Select]
if (isset($_REQUEST['ut']))
redirectexit('action=unread');
replace with:
Code: [Select]
if (isset($_REQUEST['ut']))
redirectexit('action=unread' . ((isset($_REQUEST['all'])) ? ';all' : ''));

It should work. :)


Take a peek at what I'm doing! ;D



Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non รจ una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

Offline samurai-lupin

  • Full Member
  • ***
  • Posts: 522
Re: Mark Selected Topics As Read
« Reply #68 on: August 10, 2010, 01:52:32 AM »
Thank you so much! It works excellent now! You really releaved me from a severe headache! Thanks a lot!

Offline 1.1Nerd

  • Semi-Newbie
  • *
  • Posts: 48
Re: Mark Selected Topics As Read
« Reply #69 on: September 02, 2020, 01:02:29 PM »
I have been using this mod with great joy on a SMF 1.1 Board and wonder if there is something similar available for SMF 2.0?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 72,949
Re: Mark Selected Topics As Read
« Reply #70 on: September 02, 2020, 01:39:53 PM »
You could turn on quick moderation as checkboxes from your profile, which will let you select topics to mark as read from boards/unread/unread replies.

Works for non-moderators too to mark things read - I have it set that way here even though I'm not a moderator, just so I can mark a bunch of threads read without having to visit them.

Offline 1.1Nerd

  • Semi-Newbie
  • *
  • Posts: 48
Re: Mark Selected Topics As Read
« Reply #71 on: September 02, 2020, 03:22:34 PM »
Great! Thank you very much!