Username:
Password: Forgot?
Register
-/+
Shoutbox - History
Bibby : #MakeJaxboardsGreatAgain
Sean : Always good to know how many of you still use Jaxboards - thanks for texting me about the domain expiration. I've renewed it and updated the email address so that it won't happen again. :)
Jimmy : is anyone else posting here in 2016? I am
Bryan : WOOO!
Kesha : always impressed by jaxboards loyal fanbase
Bibby : JaxBoards4ever
JJstorm : NEVER!!! LIVE JB LIVE! Doctor!!!
Thomas : rip jaxboards
Mario_Man : not till i pull the plug, anyway
Mario_Man : we will never die
1
 
template conditionals!
Avatar
boss.
Posts: 1130
Status: Offline
Group: Admin
Member: #1
Quote
I just coded in a little way to do conditionals in templates, it isn't very complex and in fact is pretty basic at the moment.

Anyway, works like this:

{if %#$s=5}whatever{/if}


or

{if %#$s!=5)}whatever{/if}


and it works just like you'd think it'd work.

right, now, nested conditionals don't work (you can't put a conditional inside another conditional).

I've opted to not do nested conditionals in favor of performance.

conditions can also use && (|| not implemented right now), so you can do:

{if %3$s!=0&&%3$s!=argument}hello!{/if}


and "hello!" will be there if %3$s is not "0" or "argument".

I'm pretty sure matt's going to be the only one using this for a while, so I won't work too much more on it. when more people get around to templating, I'll have to flesh this out a bit.

Edited by: Sean, Oct 28th, 2010 @ 10:42 am
Rate: Awesome!SadUmm....Surprising!Useful! (List)
^ Top
Avatar
I take JaxBoards seriously
Posts: 1054
Status: Offline
Group: Admin
Member: #5
Quote
what about inequalities
Rate: Awesome!SadUmm....Surprising!Useful! (List)
^ Top
Avatar
boss.
Posts: 1130
Status: Offline
Group: Admin
Member: #1
Quote
guess I can put that in
Rate: Awesome!SadUmm....Surprising!Useful! (List)
^ Top
Avatar
boss.
Posts: 1130
Status: Offline
Group: Admin
Member: #1
Quote
added

(> < >= <= all work now)

Edited by: Sean, Oct 29th, 2010 @ 12:47 pm
Rate: Awesome!SadUmm....Surprising!Useful! (List)
^ Top
Avatar
I take JaxBoards seriously
Posts: 1054
Status: Offline
Group: Admin
Member: #5
Quote
B)
Rate: Awesome!SadUmm....Surprising!Useful! (List)
^ Top
Avatar
I take JaxBoards seriously
Posts: 1054
Status: Offline
Group: Admin
Member: #5
Quote
only problem with using this for BOLDING the new messages stuff is that you gotta refresh for the bold to appear/dissapear
Rate: Awesome!SadUmm....Surprising!Useful! (List)
^ Top
Avatar
boss.
Posts: 1130
Status: Offline
Group: Admin
Member: #1
Quote
I guess I could make a userbox-new-messages or something
Rate: Awesome!SadUmm....Surprising!Useful! (List)
^ Top
Avatar
I take JaxBoards seriously
Posts: 1054
Status: Offline
Group: Admin
Member: #5
Quote
MY CONDITIONAL WISHLIST

- MATH!... mostly mod so i can check if something's odd or not
- OR function... maybe exclusive or too but i don't see that being that useful honestly lol
- work better with html... or at least work with my tiny issue i had lol
- else function? not sure exactly how that'd work on your end but it'd be useful for me!
Rate: Awesome!SadUmm....Surprising!Useful! (List)
^ Top
Avatar
boss.
Posts: 1130
Status: Offline
Group: Admin
Member: #1
Quote
Kesha
MY CONDITIONAL WISHLIST

- MATH!... mostly mod so i can check if something's odd or not
- OR function... maybe exclusive or too but i don't see that being that useful honestly lol
- work better with html... or at least work with my tiny issue i had lol
- else function? not sure exactly how that'd work on your end but it'd be useful for me!

OR function has been in for a while now kesh, get with the times!

{if %1$s=1||%2$s=2}etc{/if}


I do like the other ideas. Right off the top of my head, math will be a little too complicated to add, but I think I can come up with something similar to the way CSS3 nth-child selection works, which would be perfect.
Rate: Awesome!SadUmm....Surprising!Useful! (List)
^ Top
Avatar
I take JaxBoards seriously
Posts: 1054
Status: Offline
Group: Admin
Member: #5
Quote
maybe just an isodd function, but i was just thinking that other math might be useful to people in some circumstances
Rate: Awesome!SadUmm....Surprising!Useful! (List)
^ Top
-/+
Users Viewing This Topic
1