vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Extremely simplified PM alert mod. (https://vborg.vbsupport.ru/showthread.php?t=91201)

BLykMik 06-27-2005 07:03 PM

Extremely simplified PM alert mod.
 
I've seen a few different mods for making the PM give some sort of visual alert to the user, but I was hoping to add something much simpler and less intrusive.

What I'd like to be able to do is add 1 small .gif to the left of the word "Private Message" whenever there is an unread message. And clicking on that .gif should simply link you to the private message center the same way clicking on "Private Messages" does.

...that's it. :squareeyed: No blinking, or listing of who the messages are from, or direct linking to profiles or messages. I'm just looking for something that gives the user a slightly less subtle alert than the bold private message text.

I was going to try to modify a mod, but honestly I am not very good at coding.

Does anyone know how to do this?

Thanks!

edbri871 06-28-2005 01:53 AM

Open the NAVBAR template and find this code:

Code:

<a href="private.php?$session[sessionurl]">$vbphrase[private_messages]</a>
And right before it add this code:
Code:

<if condition="$bbuserinfo['pmunread']"><img src="image1" alt="Unread PMs" /><else /><img src="image2" alt="No Unread PMs" /></if>
Replace "image1" with the url to the image for if they have a pm, and image 2 to the url if they don't have a PM. :)

edit: btw if you want it to just have an image for unread PMs and not for if there's none then use this:

Code:

<if condition="$bbuserinfo['pmunread']"><img src="image1" alt="Unread PMs" /></if>

BLykMik 06-28-2005 03:35 AM

Hmmmm... I must be doing something wrong...

I've entered the following directly before the code you pasted above:
Code:

<tr><td class="thead">$vbphrase[miscellaneous]</td></tr>
                <if condition="$show['pmstats']"><tr><td class="vbmenu_option"><if condition="$bbuserinfo['pmunread']"><img src="images/statusicon/pm_new.gif" alt="Unread PMs" /></if><a href="private.php?$session[sessionurl]">$vbphrase[private_messages]</a></td></tr></if>

Did I get something wrong? No icon on any template when there is an unread message.

tomshawk 06-28-2005 05:02 AM

1 Attachment(s)
This is what I use

find

Code:

                        <if condition="$show['pmstats']"><br /><phrase 1="$vbphrase[unread_x_nav_compiled]" 2="$vbphrase[total_x_nav_compiled]" 3="$session[sessionurl]">$vbphrase[private_messages_nav]</phrase></if>
then place this after it

Code:

<if condition="$bbuserinfo[pmunread] == 0">
<img src="http://www.yourwebsite.com/forums/images/misc/pmoff.gif">
<else />
<img src="http://www.yourwebsite.com/forums/images/misc/pmon.gif">
</if>

Then just upload your images to the misc folder.
pmoff
pmon
the pmon is animated, so it gets your attention. ;)

mkdevo 06-28-2005 09:49 AM

Quote:

Originally Posted by tomshawk
This is what I use

(snip)

nicely done! thanks!

BLykMik 06-28-2005 02:12 PM

That works great Tomshawk... Thanks you very much!


All times are GMT. The time now is 01:38 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01462 seconds
  • Memory Usage 1,723KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete