joefish wrote: as the number of *unread* messages,
Code: Select all
//
// Obtain number of new private messages
// if user is logged in
//
Code: Select all
$pm_name = "pm";
Code: Select all
{
$s_privmsg_new = 0;
$icon_pm = $images['pm_new_msg'];
}
Code: Select all
$pm_name="pm_new";
Code: Select all
{
$l_message_unread = ( $userdata['user_unread_privmsg'] == 1 ) ? $lang['Unread_pm'] : $lang['Unread_pms'];
$l_privmsgs_text_unread = sprintf($l_message_unread, $userdata['user_unread_privmsg']);
Code: Select all
$pm_name="pm_new";
$icon_pm = $images['pm_new_msg'];
Code: Select all
'PRIVMSG_IMG' => $icon_pm,
Code: Select all
'PM_NAME' => $pm_name,
Code: Select all
<img src="templates/subSilver/images/icon_mini_profile.gif" width="12" height="13" border="0" alt="{L_PROFILE}" hspace="3" />
Code: Select all
<img src="{PRIVMSG_IMG}" width="12" height="13" border="0" alt="{PRIVATE_MESSAGE_INFO}" hspace="3" />
Code: Select all
ShowImage("{PRIVATE_MESSAGE_INFO}", "{U_PRIVATEMSGS}", "pm");
Code: Select all
ShowImage("{PRIVATE_MESSAGE_INFO}", "{U_PRIVATEMSGS}", "{PM_NAME}");
Code: Select all
$images['pm_new_msg'] = "$current_template_images/icon_mini_message.gif";
$images['pm_no_new_msg'] = "$current_template_images/icon_mini_no_message.gif";
Code: Select all
OPEN
templates/overall_header.tpl
FIND IN-LINE
{PRIVATE_MESSAGE_INFO}
REPLACE IN-LINE WITH
{PRIVATE_MESSAGE_INFO_UNREAD}
(note that this appears twice in that line so you need to replace it twice)
FIND
$l_privmsgs_text_unread = '';
REPLACE WITH
$l_privmsgs_text_unread = $lang['Login_check_pm'];
OPEN
includes/page_header.php
FIND
if ( $userdata['user_unread_privmsg'] )
{
$l_message_unread = ( $userdata['user_unread_privmsg'] == 1 ) ? $lang['Unread_pm'] : $lang['Unread_pms'];
$l_privmsgs_text_unread = sprintf($l_message_unread, $userdata['user_unread_privmsg']);
}
else
{
$l_privmsgs_text_unread = $lang['No_unread_pm'];
}
REPLACE WITH
if ( $userdata['user_unread_privmsg'] + $userdata['user_new_privmsg'] > 0 )
{
$l_message_unread = ( $userdata['user_unread_privmsg'] + $userdata['user_new_privmsg'] == 1 ) ? $lang['Unread_pm'] : $lang['Unread_pms'];
$l_privmsgs_text_unread = sprintf($l_message_unread, $userdata['user_unread_privmsg'] + $userdata['user_new_privmsg']);
}
else
{
$l_privmsgs_text_unread = $lang['No_unread_pm'];
}
Code: Select all
OPEN
templates/overall_header.tpl
FIND IN-LINE
{PRIVATE_MESSAGE_INFO_UNREAD}
skip a line just before before {PRIVATE_MESSAGE_INFO_UNREAD} (for legibility) and then
REPLACE WITH
<!-- BEGIN switch_unread_pm -->
<span class="gen"><font color=ff0000><font size=4><u><b>
<!-- END switch_unread_pm -->
{PRIVATE_MESSAGE_INFO_UNREAD}
<!-- BEGIN switch_unread_pm -->
</b></u>
<!-- END switch_unread_pm -->
OPEN
includes/page_header.php
FIND
if ( !empty($userdata['user_popup_pm']) )
{
$template->assign_block_vars('switch_enable_pm_popup', array());
}
AFTER, ADD
if ( $userdata['user_unread_privmsg'] + $userdata['user_new_privmsg'] > 0 )
{
$template->assign_block_vars('switch_unread_pm', array());
}
Code: Select all
OPEN
includes/page_header.php
FIND
if ( $userdata['user_unread_privmsg'] + $userdata['user_new_privmsg'] > 0 )
{
$l_message_unread = ( $userdata['user_unread_privmsg'] + $userdata['user_new_privmsg'] == 1 ) ? $lang['Unread_pm'] : $lang['Unread_pms'];
$l_privmsgs_text_unread = sprintf($l_message_unread, $userdata['user_unread_privmsg'] + $userdata['user_new_privmsg']);
}
else
{
$l_privmsgs_text_unread = $lang['No_unread_pm'];
}
(these are lines you tinkered with above)
REPLACE WITH
if ( $userdata['user_unread_privmsg'] + $userdata['user_new_privmsg'] > 0 )
{
$l_message_unread = ( $userdata['user_unread_privmsg'] + $userdata['user_new_privmsg'] == 1 ) ? $lang['Unread_pm'] : $lang['Unread_pms'];
$l_privmsgs_text_unread = sprintf($l_message_unread, $userdata['user_unread_privmsg'] + $userdata['user_new_privmsg']);
$icon_pm = $images['pm_new_msg'];
}
else
{
$l_privmsgs_text_unread = $lang['No_unread_pm'];
$icon_pm = $images['pm_no_new_msg'];
}
asinshesq wrote: This is pretty easy to mod. All you need to do is: ....
warmweer wrote: ...Come to think of it, it's actually simple to include an extra image for new PMs so as to have the "normal" image, a flashing one when a new PM arrives and another flashing one as long as unread messages remain.
warmweer wrote: ...One slight remark: size = 4 for the letters is slightly overkill for me (I use size = 2)....
warmweer wrote: ...Shouldn't someone (no, not me) write this as a mod (extension of the Flashing Gif mod)? I'm sure it will be used by many.
asinshesq wrote: It seems odd to me that the basic unmodded board is set up to distinguish between new pms and unread pms and that the standard template would choose to show new pms...I would have thought what we've done in this thread (set things up to show if you have any new OR unread pms) would be the preferred approach in a default board.