News:

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

Main Menu

Count unread replies on index

Started by Rudolf, May 18, 2007, 08:36:50 PM

Previous topic - Next topic

Rudolf

Link to Mod

*****************************************************
Count unread replies on index - Modification for SMF
version 1.0
© 2007, Rudolf Martincsek
*****************************************************
This mod replaces the "Show unread posts since last visit." and "Show new replies to your posts." to show the number of unread posts and replies.
You will have to modify your custom themes for this to be visible on them.

Note: On large forums this mod could have a visible impact on performance.
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

pongsak

smf 1.1.2 with dilbermc themes.
> 50 mods installed.

digger

After i click "mark all as read" i see that

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND IFNULL(lt.ID_MSG, IFNULL(lmr.ID_MSG, 0)) < t.ID_LAST_MSG' at line 7

Rudolf

That's one very nasty bug indeed.
To fix it open up Load.php
Search for

{
// This query is pretty slow, but it's needed to ensure nothing crucial is ignored.
$request = db_query("
SELECT MIN(ID_MSG)
FROM {$db_prefix}log_topics
WHERE ID_MEMBER = $ID_MEMBER", __FILE__, __LINE__);
list ($earliest_msg) = mysql_fetch_row($request);
mysql_free_result($request);
}

And replace it with

{
// This query is pretty slow, but it's needed to ensure nothing crucial is ignored.
$request = db_query("
SELECT MIN(ID_MSG)
FROM {$db_prefix}log_topics
WHERE ID_MEMBER = $ID_MEMBER", __FILE__, __LINE__);
list ($earliest_msg2) = mysql_fetch_row($request);
mysql_free_result($request);

if ($earliest_msg2 == 0)
$earliest_msg2 = -1;
$earliest_msg = min($earliest_msg2, $earliest_msg);
}


I updated the mod so I suggest you reinstall the 1.1 version. Uninstall the old one first. SMF will say that the test failed on Load.php, but uninstall it anyway and remove manually the code between the lines (including the lines)
//Count unread replies on index MOD- Start
and
//Count unread replies on index MOD- End
Then re-install the new one.
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

Rudolf

Note: Everyone should upgrade to the 1.1 version as soon as possible before you lock out yourself from the forum, by clicking on the mark unread link.  :-\
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

wilsy

Is there a screenshot of this mod?

Regards,

Wilsy.



Busy RewindBikers offered to Good Home! 1000+ members, loads of mods, SMF Gallery PRO, TinyPortal installed with great use of blocks, ultimate profiles, PAID SUBSCRIPTIONS (works flawlessly), great theme, 1,500 posts per month - PM or email me if interested.

Rudolf

What for?
Instead of "Show unread posts since last visit" you will see "There are 123 unread posts since last visit", and instead "Show new replies to your posts" there will be "There are 123 new replies to your posts".
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

wilsy

Ah, I see. It wasn't clear to me initially.

Regards,

Wilsy.



Busy RewindBikers offered to Good Home! 1000+ members, loads of mods, SMF Gallery PRO, TinyPortal installed with great use of blocks, ultimate profiles, PAID SUBSCRIPTIONS (works flawlessly), great theme, 1,500 posts per month - PM or email me if interested.

AdviseorAnswers.com

I'm running SMF 1.1.3 and TP v0.9.8 with the SMF default theme.

I installed this mod and all checked out fine and it installed with ease. BUT nor I have this across the top all of my pages.....

Quote// Count unread replies on index MOD - Start $txt['unread_since_visit1'] = 'You have %s unread posts since last visit.'; $txt['show_unread_replies1'] = 'You have %s new replies to your posts.'; // Count unread replies on index MOD - End

I have tried uninstall but it times out. Any ideas people?
Social Networking


Rudolf

In the Modifications.english.php file look for that text after ?>. Move the text before the ?>.
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

AdviseorAnswers.com

Quote from: Rudolf on July 01, 2007, 05:16:54 PM
In the Modifications.english.php file look for that text after ?>. Move the text before the ?>.
Thanks that stopped the code from showing.
Social Networking


pongsak

I think i've found one problem in this mod.
My one member told me that he'd not read 6 posts yet, but he truely read it all.
Then i think his group, there're some board he can't read, then i think
that the cause for  the new posts  for him but he didn't seen because of board restriction.

How U think? and how to correct this point if i correct. Thanks.
smf 1.1.2 with dilbermc themes.
> 50 mods installed.

pongsak

There's another error in update version.

Line 94 must have a " } "  to end loadUserSetting function in your changes.xml
smf 1.1.2 with dilbermc themes.
> 50 mods installed.

MinasC

Quote from: pongsak on July 06, 2007, 05:27:40 AM
I think i've found one problem in this mod.
My one member told me that he'd not read 6 posts yet, but he truely read it all.
Then i think his group, there're some board he can't read, then i think
that the cause for  the new posts  for him but he didn't seen because of board restriction.

How U think? and how to correct this point if i correct. Thanks.

happened to me too ! any fix ?
thnx

Rudolf

For some reason if the user had unread posts before installing the mod, the values could prove incorrect. I couldn't figure out why.
However if you click on "Mark all messages read" it will reset the status and will track the correct numbers from then on.
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

Rudolf

Quote from: pongsak on July 06, 2007, 11:32:43 AM
There's another error in update version.

Line 94 must have a " } "  to end loadUserSetting function in your changes.xml

The package is correct. The } is not needed,  actually it's bad, and it will break your forum.
The code is injected in the LoadUSerSettings, and there's lots of code in that fucntion after my code.
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

pongsak

1. I use same method as U, mark all as read.
2. Strange , if i don't add " } " the forum break.
smf 1.1.2 with dilbermc themes.
> 50 mods installed.

Rudolf

Because you are missing it somewhere else.
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

MinasC


Mick.

What files needs to be redone for other themes other than default?  Im using DilberMC.

Advertisement: