Firefox PHP

display new pm in header.tpl

Posted by artisites 
display new pm in header.tpl
September 13, 2007 07:34AM
hello phorum community!

i have added some forum menus to the header of my website, and im having some difficulty displaying if a user has "new" private messages.

i have added the code

{LOOP PM_FOLDERS}{/IF}{IF PM_FOLDERS->new} ({PM_FOLDERS->new} {LANG->newflag}){/IF} {/LOOP PM_FOLDERS}
to the end of the "private messages" menu item, however it only seems to work in the browser when we are on the pm.php page.

what do i have to include in my header.tpl so this information will display as soon as the user logs in?

many thanks for your time!
Re: display new pm in header.tpl
September 13, 2007 10:53AM
You would need to put a *lot* of code from the pm.php script into a module, to fill all that data on pages other than the PM page itself. Phorum itself does not fill that data for every page.


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Re: display new pm in header.tpl
September 14, 2007 09:51AM
Looking at the templates I believe this variable might help you:
{IF NEW_PRIVATE_MESSAGES}{/IF}
It is populated in common.php so it should appear for any page.


Joe Curia (aka Azumandias)
Modules: l0Admin Mass Email00000000l000000Automatic Time Zones000ll.l00000Enhanced Custom Profiles0.00Google Calendar0000l.l000000Post Previews
000000000Admin Security Suite000000000000Check Modules for Upgrades0000External Authentication000000Group Auto-Email00000.00000Private Message Alerts
000000000Attachment Download Counter0000Custom Attachment Icons000ll.ll00Favorite Forums000000.00000Highlighted Search Terms0000Self-Delete Posts Option
000000000Attachment Watermarks0l00000000Custom Language Database00l.l.0Forum Lockdown00000.00000Ignore Forums0000000000000Threaded Tree View
000000000Automatic Message Pruning00.llll.00Easy Color Scheme Manager0l.l00Forum Subscriptions0000lll000Moderated User Group
Templates:lGeneric Integration000000000 0000Simple Rounded000000 00000000Tabbed Emerald
Re: display new pm in header.tpl
September 14, 2007 11:27AM
Azumandias is right. Based on the fact that you were looping the folders, I asumed that you were adding a list of PM folders to the menu dynamically. But for only adding a new flag if the user has any new PM messages, the variable that Azumandias mentioned is the one to use.

In Phorum 5.1
{IF NEW_PRIVATE_MESSAGES}
  {LANG->newflag}
{/IF}

For future reference: in Phorum 5.2 (current development release)
{IF USER->new_private_messages}
  {LANG->newflag}
{/IF}


Maurice Makaay
Phorum Development Team
my blog linkedin profile secret sauce
Sorry, only registered users may post in this forum.

Click here to login