[11/02/07] New then Unread PMs after login

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in here. No new MODs will be accepted into the MOD Database for phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.

Rating:

Excellent!
2
100%
Very Good
0
No votes
Good
0
No votes
Fair
0
No votes
Poor
0
No votes
 
Total votes: 2

Extensions Robot
Extensions Robot
Extensions Robot
Posts: 28684
Joined: Sat Aug 16, 2003 7:36 am

[11/02/07] New then Unread PMs after login

Post by Extensions Robot »

MOD Name: New then Unread PMs after login
Author: lefty74
MOD Description: Normally, phpbb shows the number of new messages. With this Mod once the amount of new messages have been displayed and the user starts browsing in the forum, the display will change to the amount of unread messages in his/her inbox. The display will be in a different colour to the standard until all messages have been read.


MOD Version: 1.0.3 (Updated 02/11/07)
Tested on phpBB Version: 2.0.22

Download File: New_then_Unread_PMs_after_login_1_0_3.zip
mods overview page: View
File Size: 4276 Bytes



Support for this MOD needs to be asked within this topic. The phpBB Teams are not responsible or required to give anyone support for this MOD. By installing this MOD, the phpBB Support Team or phpBB MODifications Team may not be able to provide support.

This MOD has only been tested by the phpBB MOD Team with the phpBB version listed in the topic. It may not work in any other versions of phpBB.
Last edited by Extensions Robot on Mon Apr 30, 2007 12:30 am, edited 1 time in total.
(this is a non-active account manager for the phpBB Extension Customisations Team)
ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

MOD Validated/Released

Notes:
This MOD would be more informative than the default phpBB's PM notification feature.
User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL
Contact:

Post by lefty74 »

Thanks very much the validation :)


EDIT:
Wasn't sure whether this makes sense, if not, please let me know.
Updated also my first post to include these

EDIT2 (15 Apr 2007):
Version 1.0.4 has just been released, while the MODs database is down for submission, here is the release.
New then Unread PMs after login

Screenshots:
1. New Messages have arrived
Image

___________________________________________________

2. Total Messages unread
Image
_____________________________________________________

3. After reading a message, remaining Messages unread
Image
Last edited by lefty74 on Sun Apr 15, 2007 1:57 pm, edited 3 times in total.
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.
nuttynovas
Registered User
Posts: 63
Joined: Wed Jun 14, 2006 6:22 pm
Location: Liverpool [UK]
Contact:

Post by nuttynovas »

New_then_Unread_PMs_after_login_1_0_1.txt needs changing as it reads

Installation Level: (Easy)
## Installation Time: 5 Minutes
## Files To Edit: index.php,
## includes/page_header.php,
## language/lang_english/lang_main.php,
## templates/subSilver/overall_header.tpl



index.php needs to be changed to privmsg.php :wink:
User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL
Contact:

Post by lefty74 »

nuttynovas wrote: New_then_Unread_PMs_after_login_1_0_1.txt needs changing as it reads

Installation Level: (Easy)
## Installation Time: 5 Minutes
## Files To Edit: index.php,
## includes/page_header.php,
## language/lang_english/lang_main.php,
## templates/subSilver/overall_header.tpl



index.php needs to be changed to privmsg.php :wink:

It sure does. :oops: Thanks for pointing that out. :wink:
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Post by IPB_Refugee »

Hello lefty74,

maybe you should add one line in page_header.php:
else
{
if ( $userdata['user_unread_privmsg'] )
{
$l_message_unread = ( $userdata['user_unread_privmsg'] == 1 ) ? $lang['Unread_pm'] : $lang['Unread_pms'];
$l_privmsgs_text = sprintf($l_message_unread, $userdata['user_unread_privmsg']);
}
else
{
$l_privmsgs_text = $lang['No_unread_pm'];
$s_privmsg_new = 0;
}
}
}
else
{
$icon_pm = $images['pm_no_new_msg'];
$l_privmsgs_text = $lang['Login_check_pm'];
$s_privmsg_new = 0;
}


If you don´t do it, you get a javascript error in some cases because of this code in overall_header.tpl:

Code: Select all

<!-- BEGIN switch_enable_pm_popup -->
<script language="Javascript" type="text/javascript">
<!--
	if ( {PRIVATE_MESSAGE_NEW_FLAG} )
	{
		window.open('{U_PRIVATEMSGS_POPUP}', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');;
	}
//-->
</script>
<!-- END switch_enable_pm_popup -->
<!-- BEGIN switch_report_popup -->
In the produced HTML source code of phpBB this line is empty when there are no new pms which leads to the mentioned javascript error:

Code: Select all

	if (  )
BTW: Is the second ";" right at the end of the following line?
window.open('{U_PRIVATEMSGS_POPUP}', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');;


Greetings from Austria!
Wolfgang
faraaz
Registered User
Posts: 8
Joined: Fri Feb 03, 2006 7:28 pm

Post by faraaz »

nice mod, but by some people on my forum it doesn't work? they see that they have unread messages, while there isn't any new message, even when their inbox is empty, it still shows that there are some unread messages? any solution to this?

thanx in advance!
User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL
Contact:

Post by lefty74 »

IPB_Refugee wrote: Hello lefty74,

maybe you should add one line in page_header.php:
else
{
if ( $userdata['user_unread_privmsg'] )
{
$l_message_unread = ( $userdata['user_unread_privmsg'] == 1 ) ? $lang['Unread_pm'] : $lang['Unread_pms'];
$l_privmsgs_text = sprintf($l_message_unread, $userdata['user_unread_privmsg']);
}
else
{
$l_privmsgs_text = $lang['No_unread_pm'];
$s_privmsg_new = 0;
}
}
}
else
{
$icon_pm = $images['pm_no_new_msg'];
$l_privmsgs_text = $lang['Login_check_pm'];
$s_privmsg_new = 0;
}


If you don´t do it, you get a javascript error in some cases because of this code in overall_header.tpl:

Code: Select all

<!-- BEGIN switch_enable_pm_popup -->
<script language="Javascript" type="text/javascript">
<!--
	if ( {PRIVATE_MESSAGE_NEW_FLAG} )
	{
		window.open('{U_PRIVATEMSGS_POPUP}', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');;
	}
//-->
</script>
<!-- END switch_enable_pm_popup -->
<!-- BEGIN switch_report_popup -->
In the produced HTML source code of phpBB this line is empty when there are no new pms which leads to the mentioned javascript error:

Code: Select all

	if (  )
BTW: Is the second ";" right at the end of the following line?
window.open('{U_PRIVATEMSGS_POPUP}', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');;


Greetings from Austria!
Wolfgang

Many thanks for this fix. With Firefox I never get these messages. Having said that I do not know too much about programming. I will include it in the next release.
Thanks again.

EDIT:
I just looked at it in IE and if I am not mistaken there needs to be a second line added to get rid of the Javascript error when there are unread messages. It worked when I tried it but if anyone knows more please let me know.

else
{
if ( $userdata['user_unread_privmsg'] )
{
$l_message_unread = ( $userdata['user_unread_privmsg'] == 1 ) ? $lang['Unread_pm'] : $lang['Unread_pms'];
$l_privmsgs_text = sprintf($l_message_unread, $userdata['user_unread_privmsg']);
$s_privmsg_new = 0;
}
else
{
$l_privmsgs_text = $lang['No_unread_pm'];
$s_privmsg_new = 0;
}
}
}
else
{
$icon_pm = $images['pm_no_new_msg'];
$l_privmsgs_text = $lang['Login_check_pm'];
$s_privmsg_new = 0;
}
Last edited by lefty74 on Tue Sep 12, 2006 10:23 pm, edited 1 time in total.
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.
User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL
Contact:

Post by lefty74 »

faraaz wrote: nice mod, but by some people on my forum it doesn't work? they see that they have unread messages, while there isn't any new message, even when their inbox is empty, it still shows that there are some unread messages? any solution to this?

thanx in advance!

hmm, I never encountered that. As I mentioned before my programming skills are very minimal.

I will see whether I can somehow reproduce that and try to find a solution unless someone else knows straight away why this is happening.
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.
User avatar
warmweer
Jr. Extension Validator
Posts: 6501
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Post by warmweer »

lefty74 wrote: I will see whether I can somehow reproduce that and try to find a solution unless someone else knows straight away why this is happening.

I haven't looked at your mod yet, but I also made something similar some years ago (as an add-on to the flashing PM mod) and the same problem arose when a PM was sent but the sender then deleted it.

Suppose you use a counter which increments when a PM is sent, but doesn´t decrement when it´s deleted: bingo. A possible solution is to calculate the number of unread messages on the fly, no conflicts with other mods either.
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Post by IPB_Refugee »

lefty74 wrote: EDIT:
I just looked at it in IE and if I am not mistaken there needs to be a second line added to get rid of the Javascript error when there are unread messages. It worked when I tried it but if anyone knows more please let me know.

else
{
if ( $userdata['user_unread_privmsg'] )
{
$l_message_unread = ( $userdata['user_unread_privmsg'] == 1 ) ? $lang['Unread_pm'] : $lang['Unread_pms'];
$l_privmsgs_text = sprintf($l_message_unread, $userdata['user_unread_privmsg']);
$s_privmsg_new = 0;
}
else
{
$l_privmsgs_text = $lang['No_unread_pm'];
$s_privmsg_new = 0;
}
}
}
else
{
$icon_pm = $images['pm_no_new_msg'];
$l_privmsgs_text = $lang['Login_check_pm'];
$s_privmsg_new = 0;
}


You are right, lefty74! Thank you for pointing that out! :P
warmweer wrote: I haven't looked at your mod yet, but I also made something similar some years ago (as an add-on to the flashing PM mod) and the same problem arose when a PM was sent but the sender then deleted it.

Suppose you use a counter which increments when a PM is sent, but doesn´t decrement when it´s deleted: bingo. A possible solution is to calculate the number of unread messages on the fly, no conflicts with other mods either.


Interesting point. Hope you´ll find a solution because I really like this mod!

Good night!
Wolfgang
User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL
Contact:

Post by lefty74 »

warmweer wrote:
lefty74 wrote:I will see whether I can somehow reproduce that and try to find a solution unless someone else knows straight away why this is happening.

I haven't looked at your mod yet, but I also made something similar some years ago (as an add-on to the flashing PM mod) and the same problem arose when a PM was sent but the sender then deleted it.

Suppose you use a counter which increments when a PM is sent, but doesn´t decrement when it´s deleted: bingo. A possible solution is to calculate the number of unread messages on the fly, no conflicts with other mods either.

I use the phpbb updater that is already existing in phpbb. I tried the deletion of unread PMs and it still decreases so I still cannot reproduce this error. Having said that, I will have a look into your suggestion warmweer. Thanks :)

IPB_Refugee
I thank you for pointing this out in the first place :)
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.
User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL
Contact:

Post by lefty74 »

faraaz wrote: nice mod, but by some people on my forum it doesn't work? they see that they have unread messages, while there isn't any new message, even when their inbox is empty, it still shows that there are some unread messages? any solution to this?

thanx in advance!


faraaz,
I have still not been able to reproduce this issue, I have tried everything I can think of, it still worked for me which tells me the counter as it is now works. Are you using the latest version of phpbb?

I even went into the database of my live forum and looked up the fields for the new and unread posts in phpbb_privmsgs and compared them to the user_unread_messages and user_new_messages fields in the phpbb_users table to see whether any of my members have the same problem. There are also no discrepancies.

Since I do not know enough about php or databases, my attempt for an alternative counter failed.

How many users are we talking about? I know this is not ideal but the only solution I can offer at the moment is to reset their user_unread_messages to 0 via phpMyAdmin.

I am sure that there are better ones but the sql commands I used in phpMyAdmin to compare the values were

Code: Select all

SELECT `user_id` , `username` , `user_new_privmsg` , `user_unread_privmsg`
FROM `phpbb_users`
WHERE `user_new_privmsg` >0
OR `user_unread_privmsg` >0
ORDER BY `user_id` ASC
and

Code: Select all

SELECT `privmsgs_id` , `privmsgs_to_userid` , `privmsgs_type`
FROM `phpbb_privmsgs`
WHERE `privmsgs_type` = "1"
OR `privmsgs_type` = "5"
ORDER BY `privmsgs_to_userid` ASC 
Sorry, I hope this helps anyway.
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.
User avatar
lefty74
Registered User
Posts: 3649
Joined: Wed Sep 14, 2005 8:26 pm
Location: NL
Contact:

Post by lefty74 »

I think I have found the problem. When a user gets deleted and there is still one or more PMs in his/her outbox, they do not seem to get deleted(deducted) from the recipients user_new_privmsg and/or user_unread_privmsg fields.

Since I do not know how to do the other counter, I have reported it as a bug.

To reset the unread postcount, I had to go and manually set the user_unread_privmsg field to 0.

Sorry I cant be of more help. If anyone knows how to do the other counter, I would be grateful if you could share this :)
lefty74
zoocrew.eu - help us save our wildlife
My MODS | Due to lack of time I unfortunately am unable to work on my mods anymore, anyone who has ideas to improve them and would like to take any of them over, please PM me.
ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

MOD Updated to version 1.0.1a
See first post for Download Link
Post Reply

Return to “[2.0.x] MOD Database Releases”