Firefox PHP

Differentiate between PM inbox and outbox

Posted by Nicola 
Differentiate between PM inbox and outbox
January 30, 2013 10:52AM
I am in progress of facelifting my 6 years old site. So I have put hand on the templates and everything is great up to when I got into the pm.tpl

Since I am adding icons, at the index I am a bit confused how to proceed.
More in detail I need to differentiate between the folders and don't know how to operate within the following syntax:
{LOOP PM_FOLDERS}
 <li><a {IF PM_FOLDERS->id FOLDER_ID}class="current" {/IF}href="{PM_FOLDERS->url}">{PM_FOLDERS->name}</a><small>{IF PM_FOLDERS->total}&nbsp;({PM_FOLDERS->total}){/IF}{IF PM_FOLDERS->new}&nbsp;(<span class="new-flag">{PM_FOLDERS->new} {LANG->newflag}</span>){/IF}</small></li>
{/LOOP PM_FOLDERS}


Of course anywhere I place an icon it will appear in both folders simultaneously.
Question: any ways to manage this?

Thanks!
N.
Re: Differentiate between PM inbox and outbox
January 30, 2013 12:19PM
You could check PM_FOLDERS->name
if it was equal to "Inbox" you could display icon for that and if it was "Sent Items" you could display the other icon. Customized folders wouldn't be easily categorized (probably not worth bothering about) You would also have more problems if you used multiple languages
Re: Differentiate between PM inbox and outbox
January 31, 2013 02:42AM
Thanks for your tip. I am not familiar with the IF sytax, maybe you or someone can help. I imagine it's something I need to insert after the HREF and should look similar to the following:
{IF PM_FOLDERS->name}="INBOX"} ICON {/IF}

Obviously this doesn't work because I am not acquainted with it.
Any help is highly appreciated. Thanks.
Re: Differentiate between PM inbox and outbox
January 31, 2013 06:19AM
just
Language: HTML
{IF PM_FOLDERS->name "INBOX"} ICON {/IF}

Should be fine or as David told using "Inbox" (not all uppercased and depending on how the inbox is named in your environment!)


Thomas Seifert
Re: Differentiate between PM inbox and outbox
January 31, 2013 06:31AM
Thanks Thomas.
Something is still not right.

Right now my syntax shows as follows:
<a {IF PM_FOLDERS->id FOLDER_ID} {/IF}href="{PM_FOLDERS->url}"><img src="{URL->TEMPLATE}/images/icons/icon_pm_mail.png" style="padding-left:5px; padding-right:6px">{PM_FOLDERS->name}
                        <span>{IF PM_FOLDERS->total}&nbsp;({PM_FOLDERS->total}){/IF}{IF PM_FOLDERS->new}&nbsp;
                        <small class="new-flag">({PM_FOLDERS->new} {LANG->newflag})</small>{/IF}</small></a>

This one shows just before the folder name a generic mail icon which is of course the same for both inbox and outbox.

I have attempted to insert your suggested IF code into the one above but nothing has happened at all. Tried both INDEX and Index but nothing. Any suggestions of what I'm doing wrong or I am not doing? Thanks!
Re: Differentiate between PM inbox and outbox
January 31, 2013 06:32AM
Again, how is the inbox named in your environment and language? Use that name.


Thomas Seifert
Re: Differentiate between PM inbox and outbox
January 31, 2013 06:37AM
I checked the lang file and it's the following:
        "INBOX"                 	=>	"Posta in arrivo",

Si it was my first choice obviously but neither worked for some reasons.
Re: Differentiate between PM inbox and outbox
January 31, 2013 06:38AM
{IF PM_FOLDERS->name "Posta in arrivo"} ICON {/IF}

Didn't work?


Thomas Seifert
Re: Differentiate between PM inbox and outbox
January 31, 2013 06:40AM
Oh I thought it had to be in the English source only. Let me try right away then. Thanks.
Re: Differentiate between PM inbox and outbox
January 31, 2013 06:52AM
Works perfectly, many thanks!
By instinct I thought since PHORUM is programmed to work contemporary with different languages then there would have been a solution within the core coding. This is why I didn't even think to base the code in the active language.
Sorry, only registered users may post in this forum.

Click here to login