Knowledge Base

Private_message_info as an image replacing the text link.
Article ID: 67
Written By: Dogs and things
Written On: Mon Jun 04, 2007 5:08 pm
Description: A built-in feature waiting to be activated.
link to this article on phpbb.com: Select All
[kb=private-message-info-as-an-image-replacing-the-text-link]Private_message_info as an image replacing the text link.[/kb]
link to this article on your own board: Select All
[url=http://www.phpbb.com/kb/article/private-message-info-as-an-image-replacing-the-text-link/]Knowledge Base - Private_message_info as an image replacing the text link.[/url]

If you want to use images instead of the standard text link showing the private message info in your forum header you will have to create two gif images. Name them pm_no_new_msg.gif and pm_new_msg.gif. Upload those to ./templates/your_template_name/images.

Next you will have to make the following edits:

Code: Select all
#------[ OPEN ]----------------------------
#
./templates/your_template_name/overall_header.tpl
#
#------[ FIND ]----------------------------
#
<a href="{U_PRIVATEMSGS}" class="mainmenu"><img src="templates/your_template_name/images/icon_mini_message.gif" width="12" height="13" border="0" alt="{PRIVATE_MESSAGE_INFO}" hspace="3" />{PRIVATE_MESSAGE_INFO}</a>
#
#------[ REPLACE WITH ]--------------------
#
<a href="{U_PRIVATEMSGS}" class="mainmenu"><img src="{PRIVMSG_IMG}" alt="{PRIVATE_MESSAGE_INFO}" hspace="3" />{PRIVATE_MESSAGE_INFO}</a>
#
#------[ OPEN ]----------------------------
#
./templates/your_template_name/your_template_name.cfg
#
#------[ FIND ]----------------------------
#
$images['pm_new_msg'] = "";
$images['pm_no_new_msg'] = "";
#
#------[ REPLACE WITH ]--------------------
#
$images['pm_new_msg'] = "$current_template_images/pm_new_msg.gif";
$images['pm_no_new_msg'] = "$current_template_images/pm_no_new_msg.gif";


If you want the new_pm.gif to show until all new PMs have been read instead of until the user enters his Inbox you have to make one additional edit:

Code: Select all
#
#------[ 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']);
   }
#
#------[ REPLACE WITH ]----------------------------
#
   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']);
      $icon_pm = $images['pm_new_msg'];
   }


For questions & comments, contact user: Dogs and things.