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![]()
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;
}
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 -->
Code: Select all
if ( )
window.open('{U_PRIVATEMSGS_POPUP}', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');;
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:
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
<!-- 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 -->
BTW: Is the second ";" right at the end of the following line?Code: Select all
if ( )
window.open('{U_PRIVATEMSGS_POPUP}', '_phpbbprivmsg', 'HEIGHT=225,resizable=yes,WIDTH=400');;
Greetings from Austria!
Wolfgang
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;
}
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!
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.
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;
}
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.
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.
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!
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
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