Username:
Password: Forgot?
Register
-/+
Shoutbox - History
sivart0 : we could put sivquest in this arcade :D
sivart0 : Moo
Kesha : Testing out Qutebrowser, works pretty good
Kesha : An HTML5 arcade would be cool, not sure how HTML5 games are distributed these days, wonder if there's a way to collect them for an arcade system?
Sean : finally got rid of the arcade link. Took a while to find where it was, lol
sivart0 : Hmmmm
sivart0 : Mobole test
momo : hi sean, i found a new php arcade and who adapted HTML game on it
Sean : I'm much better at it than I was back then for sure
sivart0 : anybody can write one, been done to death
 
template conditionals!
boss.
Posts: 961
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
^ Top
I take JaxBoards seriously
Posts: 890
Status: Offline
Group: Admin
Member: #5
Quote
what about inequalities
^ Top
boss.
Posts: 961
Status: Offline
Group: Admin
Member: #1
Quote
guess I can put that in
^ Top
boss.
Posts: 961
Status: Offline
Group: Admin
Member: #1
Quote
added

(> < >= <= all work now)

Edited by: Sean , Oct 29th, 2010 @ 12:47 pm
^ Top
I take JaxBoards seriously
Posts: 890
Status: Offline
Group: Admin
Member: #5
Quote
B)
^ Top
I take JaxBoards seriously
Posts: 890
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
^ Top
boss.
Posts: 961
Status: Offline
Group: Admin
Member: #1
Quote
I guess I could make a userbox-new-messages or something
^ Top
I take JaxBoards seriously
Posts: 890
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!
^ Top
boss.
Posts: 961
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.
^ Top
I take JaxBoards seriously
Posts: 890
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
^ Top
-/+
Users Viewing This Topic