1

Topic: How to arrange the <!-- IFs --> in this case

Hi,

I've been trying with different arrangement for the <!-- IFs --> tags but still couldn't get it right.

What I'm trying to do is this:

When a user hasn't login -

1) To display a Member Login Form Div1.

After a user has loggedin -

2) To display a Div2 with "Welcome User Message + You have {number} new messages."

OR

3) To display a Div3 with "Welcome User Message + You have NO new messages."

I've tried the following but it either isn't displaying Div2 or isn't reflecting the {number} of new messages which I'm unsure of:

<!-- IF loggedin == "0" -->

    <div><form> Display Member Login Form Here </form></div>

<!-- ENDIF -->

<!-- IF loggedin == "1" -->
<!-- IF loggedin_newmessages > "1" -->

    <div> Welcome {loggedin_username}, you have {loggedin_newmessages} new message(s)!</div>

<!-- ELSE -->

    <div> Welcome {loggedin_username}, you have 0 new messages</div>

<!-- ENDIF -->
<!-- ENDIF -->

Try out here:

http://www.thaidatelink.com
User: demo
Pass: demo

2

Re: How to arrange the <!-- IFs --> in this case

May be 1 new message enough to notify member about new message smile

<!-- IF loggedin == "1" -->
    <!-- IF loggedin_newmessages > "0" -->
        <div> Welcome {loggedin_username}, you have {loggedin_newmessages} new message(s)!</div>
    <!-- ELSE -->
        <div> Welcome {loggedin_username}, you have 0 new messages</div>
    <!-- ENDIF -->  
<!-- ELSE -->
    <div><form> Display Member Login Form Here </form></div>
<!-- ENDIF -->
www.vldMagic.com - first choice customizations help desk
www.vldCrowd.com/radioact - my profile at vldCrowd

3

Re: How to arrange the <!-- IFs --> in this case

Hi,

This is how I have it on my page.

<!-- IF loggedin == "1" -->
<a href="index.php?m=account_profile" title="">Welcome, {loggedin_username}</a> {anchor:url1="account/logout/",url2="index.php?m=account_logout",name="core|usermenu_logout"}<br />
<!-- IF loggedin_newmessages > "0" --><a href="{virtual_path}{ifelse:system_enable_fancy_urls,"1","account/messages/","index.php?m=account_messages"}">You have ({loggedin_newmessages}) new message(s).</a><!-- ENDIF --><br />
<!-- IF loggedin_newfriends > "0" --><a href="{virtual_path}{ifelse:system_enable_fancy_urls,"1","account/friends/requests/","index.php?m=account_friends&p=requests"}">You have ({loggedin_newfriends}) new friend request(s).</a><!-- ENDIF -->
<!-- IF loggedin_newguestbooks > "0" --><a href="{virtual_path}{ifelse:system_enable_fancy_urls,"1","account/guestbook/unapproved/","index.php?m=account_guestbook&p=unapproved"}">You have ({loggedin_newguestbooks}) new guestbook entries.</a><!-- ENDIF -->
<!-- ELSE -->
Information for users that are not logged in.
<!-- ENDIF -->

It works pretty well, although I don't think the new guestbook entries tag is working.

Last edited by silverinck (2008-04-08 03:27:19)

4

Re: How to arrange the <!-- IFs --> in this case

Thanks Radioact,

You have pointed out what I did wrong smile

Thanks Silverinck,

Your method is better than what I have in mind and I'll be taking up your method smile

Thankzzz all! wink

5

Re: How to arrange the <!-- IFs --> in this case

<!-- IF loggedin_newguestbooks > "0" --> dosn't work for me...

- From the beginning I was intelligent, but since I learn something every day, I'm sure I'll end up wise as well -