News:

Wondering if this will always be free?  See why free is better.

Main Menu

Mark Selected Topics As Read

Started by JayBachatero, September 16, 2006, 02:43:30 AM

Previous topic - Next topic

ITA003

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

$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.

ITA003

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...

AlaStar

Quote from: ne.miguelito on July 25, 2008, 03:42:35 AM
I am with the same error...

if any checkboxes be not selected i get this error:

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

and

QuoteThe 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  ???

AlaStar

*bump*

anyone solved this problems ?

digit

Quote from: ITA003 on October 22, 2008, 05:41:32 PM

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

$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!)

heavyccasey

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:
'markselected' => array('text' => 'mark_selected', 'lang' => true, 'url' => 'javascript:document.quickModForm.submit();')


2. Find this right after it...
echo '
</tr>
</table>


...And add this form element:
<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:
</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:
<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:

<td class="windowbg2" valign="middle" width="4%" align="center">
<input type="checkbox" onclick="invertAll(this, this.form, \'topic_array[]\');" class="check" />
</td>



4. Find:
<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:

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



5. Find:

echo '
</table>
</td></tr>
</table>


And add after:
</form>


6. Replace any...
colspan="7"
...in the function with...
colspan="8"



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



Subs-Boards.php.

Find:
// Make sure all the boards are integers!

Replace the line after with:
$topics = !empty($_POST['topic_array']) ? $_POST['topic_array'] : explode('-', !empty($_REQUEST['topics']) ? $_REQUEST['topics'] : '');


Find:

if (isset($_SESSION['topicseen_cache']))
$_SESSION['topicseen_cache'] = array();


Replace the redirectexit() line with:

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.

samurai-lupin

Quote from: Kimmie on May 17, 2008, 01:48:20 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!

emanuele

In Recent.template.php
find:
<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:
<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:
<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:
<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:
if (isset($_REQUEST['ut']))
redirectexit('action=unread');

replace with:
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.

samurai-lupin

Thank you so much! It works excellent now! You really releaved me from a severe headache! Thanks a lot!

1.1Nerd

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?

Arantor

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.
Holder of controversial views, all of which my own.


1.1Nerd


Advertisement: