MyBB Hacks

Full Version: Template Conditionals
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11
I don't really understand these conditionals Frown

I want to do this:
if ({VALUE$1} == {VALUE$2})
return {VALUE$1};
else
return {VALUE$1} / {VALUE$2}; //that's a slash, not a math op.

Can you translate this to ZiNgA Conditionals?
Maybe something like this:

Code:
<if {VALUE$1} == {VALUE$2} then>
{VALUE$1}
<else>
{VALUE$1} / {VALUE$2}
</if>

Great, thanks!
What is the correct syntax for using functions with this plugin? I have tried many ways, bu didn't succeed.

Like:
<func format_name>$name, $usergroup, $adittionalgroups</func>
<func format_name>{$name}, {$usergroup}, {$adittionalgroups}</func>
<func format_name>($name, $usergroup, $adittionalgroups)</func>
<func format_name>({$name}, {$usergroup}, {$adittionalgroups})</func>

Haved tried many ways, even with other functions like get_(forum|thread|post|user) or get_(forum|thread|post|user)_link.

Will really appreciate some examples of how it is suppose to be the right way.
(03-14-2010 10:12 AM)ZiNgA BuRgA Wrote: [ -> ]The functions available, with the shortcut, are:
htmlspecialchars, htmlspecialchars_uni, intval, file_get_contents, floatval, urlencode, rawurlencode, addslashes, stripslashes, trim, crc32, ltrim, rtrim, chop, md5, nl2br, strrev, strtoupper, strtolower, my_strtoupper, my_strtolower, alt_trow, get_friendly_size, filesize, strlen, my_strlen, my_wordwrap, random_str, unicode_chr, bin2hex, str_rot13, str_shuffle, strip_tags, ucfirst, ucwords, basename, dirname, unhtmlentities

Note that these all have a single argument.
Use <?= ... ?> syntax for other functions.
Thanks!
(10-20-2011 06:40 AM)Patrick_ Wrote: [ -> ]I don't really understand these conditionals Frown

I want to do this:
if ({VALUE$1} == {VALUE$2})
return {VALUE$1};
else
return {VALUE$1} / {VALUE$2}; //that's a slash, not a math op.

Can you translate this to ZiNgA Conditionals?

What I am actually doing wrong there?


Code:
<if {$forum['fid']} != '16' then>
{$lastpost_subject}
</if>


I am trying to exclude something for a given forum on index page.

Your plugin obviously works. But I cannot make sence of this conditional. Please help!

Thank you
NZ

Code:
<if $forum['fid'] != '16' then>
{$lastpost_subject}
</if>

Assuming that $forum is even the correct variable.

(04-26-2012 09:01 AM)ZiNgA BuRgA Wrote: [ -> ]

Code:
<if $forum['fid'] != '16' then>
{$lastpost_subject}
</if>

Assuming that $forum is even the correct variable.


Does not work. Sorry. Simply shows nothing.

I can printout $forum['fid'] anywhere, and it shows correct values for forum. One of forum is #16.

I have clean install of mybb latest version. All your examples from the main post of the thread work ok.

Add.  I am trying to edit  forumbit_depth2_forum_lastpost is that matters

Thanks
NZ
Using the exact code above for that template, it seems to work perfect for me...
Pages: 1 2 3 4 5 6 7 8 9 10 11
Reference URL's