Gossamer Forum
Quote Reply
tricky else if statement
Hi Andy,
I'm using this code in detail.html.
At the moment it is possible that more messages are displayed at the same time.
But I don't want to have more than one message.
Is there a way (must be something with elseif!) to show only the first right message and not the others.

Code:
<%if Jump_Clicks > 500 and user_links_anzahl < 2%>
Message: Add a new link
<%endif%>

<%if user_reviews_anzahl < 3 and Jump_Clicks > 500%>
Message: Write a review
<%endif%>

<%if user_reviews_anzahl > 2%>
<%get_last_additions_for_user($user.Username)%>
<%if days_since_last_review > 365%>
Message: Write a review
<%endif%>
<%endif%>

<%if user_links_anzahl > 1%>
<%get_last_additions_for_user($user.Username)%>
<%if days_since_last_link > 365%>
Message: Add a new link
<%endif%>
<%endif%>

Thanks

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] tricky else if statement In reply to
haha I love the way you always address posts to me directly Tongue

Try this:

Code:
<%if Jump_Clicks > 500 and user_links_anzahl < 2%>
Message: Add a new link

<%elsif user_reviews_anzahl < 3 and Jump_Clicks > 500%>

Message: Write a review

<%elsif user_reviews_anzahl > 2%>
<%get_last_additions_for_user($user.Username)%>
<%if days_since_last_review > 365%>
Message: Write a review
<%endif%>

<%elsif user_links_anzahl > 1%>

<%get_last_additions_for_user($user.Username)%>
<%if days_since_last_link > 365%>
Message: Add a new link
<%endif%>

<%endif%>

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] tricky else if statement In reply to
Andy wrote:
haha I love the way you always address posts to me directly Tongue

Yes, I know it's a forum, but there are not many users left who can solve such problems. So the best way is to post you directly.
I could write a email or pm, but I think other users love your solutions, too.

Will try your code later.
Thanks

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] tricky else if statement In reply to
Quote:
I could write a email or pm, but I think other users love your solutions, too.

Good thinking Cool

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] tricky else if statement In reply to
Your code above works like a charm. What else ;-)
Thanks

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] tricky else if statement In reply to
Matthias70 wrote:
Your code above works like a charm. What else ;-)
Thanks

Cool Angelic

Cheers