private message coloured notification

Guides & Snippets for phpBB3.
Try the Snippets here and share Your own Snippets

private message coloured notification

Post by Steve »

This little phpbb3 snippet displays unread private messages as red.

Can be used on other styles other than prosilver and subsilver2
instructions

prosilver

open styles/prosilver/template/overall_header.html

find:

Code: Select all

<!-- IF S_DISPLAY_PM --> (<a href="{U_PRIVATEMSGS}">{PRIVATE_MESSAGE_INFO}</a>)<!-- ENDIF -->
replace with:

Code: Select all

<!-- IF S_USER_NEW_PRIVMSG or PRIVATE_MESSAGE_INFO_UNREAD --><a href="{U_PRIVATEMSGS}" style=" color: #FF0000;">({PRIVATE_MESSAGE_INFO})<!-- IF S_USER_NEW_PRIVMSG --><!-- ELSE --><!-- ENDIF --></a>
		                <!-- ELSE -->(<a href="{U_PRIVATEMSGS}" >{PRIVATE_MESSAGE_INFO}</a>)<!-- ENDIF -->
to display unread pm info,
use this code:

Code: Select all

	<!-- IF S_USER_LOGGED_IN --><!-- IF S_USER_NEW_PRIVMSG -->(<a href="{U_PRIVATEMSGS}" style="color:#FF0000;">{PRIVATE_MESSAGE_INFO}</a>)<!-- IF S_USER_NEW_PRIVMSG --><!-- ELSE --><!-- ENDIF -->
		<!-- ELSE -->(<a href="{U_PRIVATEMSGS}" >{PRIVATE_MESSAGE_INFO}</a>)<!-- ENDIF --><!-- ENDIF -->
		<!-- IF PRIVATE_MESSAGE_INFO_UNREAD -->
		(<a href="{U_PRIVATEMSGS}" style="color:#FF0000;">{PRIVATE_MESSAGE_INFO_UNREAD}</a>)<!-- ENDIF -->
unr.PNG
Image

subsilver2

open styles/subsilver2/template/overall_header.html
find:

Code: Select all

<!-- IF S_DISPLAY_PM --> &nbsp;<a href="{U_PRIVATEMSGS}"><img src="{T_THEME_PATH}/images/icon_mini_message.gif" width="12" height="13" alt="*" /> {PRIVATE_MESSAGE_INFO}<!-- IF PRIVATE_MESSAGE_INFO_UNREAD -->, {PRIVATE_MESSAGE_INFO_UNREAD}<!-- ENDIF --></a><!-- ENDIF -->
replace with:

Code: Select all

					<!-- IF S_USER_NEW_PRIVMSG or PRIVATE_MESSAGE_INFO_UNREAD --> &nbsp;<a href="{U_PRIVATEMSGS}" style=" color: #FF0000;"><img src="{T_THEME_PATH}/images/icon_mini_message.gif" width="12" height="13" alt="*" /> {PRIVATE_MESSAGE_INFO}<!-- IF S_USER_NEW_PRIVMSG --><!-- ELSE --><!-- ENDIF --></a>
                    <!-- ELSE --> &nbsp;<a href="{U_PRIVATEMSGS}" ><img src="{T_THEME_PATH}/images/icon_mini_message.gif" width="12" height="13" alt="*" /> {PRIVATE_MESSAGE_INFO}</a><!-- ENDIF -->
to display unread pm info,
use this code:

Code: Select all

	    <!-- IF S_USER_LOGGED_IN --><!-- IF S_USER_NEW_PRIVMSG --><a href="{U_PRIVATEMSGS}" style="color:#FF0000;"><img src="{T_THEME_PATH}/images/icon_mini_message.gif" width="12" height="13" alt="*" /> {PRIVATE_MESSAGE_INFO}</a><!-- IF S_USER_NEW_PRIVMSG --><!-- ELSE --><!-- ENDIF -->
        <!-- ELSE --><a href="{U_PRIVATEMSGS}" >{PRIVATE_MESSAGE_INFO}</a><!-- ENDIF --><!-- ENDIF -->
        <!-- IF PRIVATE_MESSAGE_INFO_UNREAD -->
        <a href="{U_PRIVATEMSGS}" style="color:#FF0000;"> , {PRIVATE_MESSAGE_INFO_UNREAD}</a><!-- ENDIF -->
spur.PNG
Image

This tweak can also be done using images for unread/read pm messages ;)

Re: private message coloured notification

Post by Fire-Fox »

Great :)

thanks

Re: private message coloured notification

Post by Inner Circle »

awesome!

thanks for the snippet!

Re: private message coloured notification

Post by Oliver »

Thats good, but if you have black nawbar then the normall pm links not show.

skybule theme,, there are "white" links.

Re: private message coloured notification

Post by Fire-Fox »

Then replace with some color that match the theme :)

Re: private message coloured notification

Post by cisco007 »

yes oliver replace this #FF0000 with whichever color you want!

Re: private message coloured notification

Post by Oliver »

We need a different code skyblue theme. Where do I put this code, then it does not become a private message to the entire region is not displayed on a black background. In this style comes standard with white links. If I switch to that color of what you said so, it seems only arrived of detail in the message.




That my original code.. Style is Skyblue...

Code: Select all

<!-- IF S_DISPLAY_PM --> (<a  class="white" href="{U_PRIVATEMSGS}">{PRIVATE_MESSAGE_INFO}</a>)<!-- ENDIF -->
Last edited by Oliver on 25 Mar 2010, 19:54, edited 2 times in total.

Re: private message coloured notification

Post by Steve »

Oliver » 25 Mar 2010, 20:51 wrote:We need a different code skyblue theme. Where do I put this code, then it does not become a private message to the entire region is not displayed on a black background. In this style comes standard with white links. If I switch to that color of what you said so, it seems only arrived of detail in the message.




That my original code.. Style is Skyblue...

Code: Select all

<!-- IFS S_DISPLAY_PM --> (<a  class="white" href="{U_PRIVATEMSGS}">{PRIVATE_MESSAGE_INFO}</a>)<!-- ENDIF -->

try this:

Code: Select all

                   <!-- IF S_USER_NEW_PRIVMSG or PRIVATE_MESSAGE_INFO_UNREAD --> &nbsp;<a href="{U_PRIVATEMSGS}" style=" color: #FF0000;"><img src="{T_THEME_PATH}/images/icon_mini_message.gif" width="12" height="13" alt="*" /> {PRIVATE_MESSAGE_INFO}<!-- IF S_USER_NEW_PRIVMSG --><!-- ELSE --><!-- ENDIF --></a>
                        <!-- ELSE --> &nbsp;<a class="white" href="{U_PRIVATEMSGS}" ><img src="{T_THEME_PATH}/images/icon_mini_message.gif" width="12" height="13" alt="*" /> {PRIVATE_MESSAGE_INFO}</a><!-- ENDIF -->

Re: private message coloured notification

Post by Oliver »

Thanks Vectra. Its perfect ;)

Re: private message coloured notification

Post by kevinviet »

Thank you very much vectra-mods, very useful Snippet :)