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
(06-24-2016 11:16 PM)Destroy666 Wrote: [ -> ]Mainly the 2 mentioned above, perhaps also format_time_duration. The rest is not really usable in templates.
Thanks, I've added it to the code and should be available on next release.

(08-27-2016 05:56 AM)xQu Wrote: [ -> ]Why when i using

Code:
<?php include 'file.php'; ?>

in Chrome Developer Tools in Source i can see

Code:
<!--?php include 'file.php'; ?--!>


Mybb change < to <!--

I don't get that at all, but Template Conditionals doesn't allow PHP like that anyway.
So how i can include file to index template?
Please read the first post in this thread.
Is it possible to pull a count of how many users are in X group?

Also is it possible to pull a count of how many users in said X group have a custom profile field set to yes or no?

I'm thinking 'census' like here. So for example I have

Faction 1 (usergroup)
Faction 2 (usergroup)
Sex (profile field = male or female)

I want to count how many are in Faction 1, then I would like to count how many males are in faction one and how many females)
And repeat for Faction 2.
Assuming you know how to do that (the query and etc), use the PHP in Templates / Complex Templates plugin or use dedicated script/plugin.
I actually don't know how to do that query wise. Which is why I was wondering if it was just something that could be done quickly by a statement lol.

I'm assuming not now, so I'll look into creating a script/plugin and see what I can figure out.
Hi, I would like ask you for a small advise:
I use this type of custom field:
- input field type: file
- editable/required by: everyone
- valid file expression: gif|png|jpg|jpeg
- maximum file size: 2097152
- image thumbnail generator: 90x135|320x240

I need to set into the field: Blank replacement Value - show a default image (myboard.com/defaultimage.png) automatically if there is no image added by user. How to do that, thank you!
(08-10-2017 01:21 AM)eldenroot Wrote: [ -> ]Hi, I would like ask you for a small advise:
I use this type of custom field:
- input field type: file
- editable/required by: everyone
- valid file expression: gif|png|jpg|jpeg
- maximum file size: 2097152
- image thumbnail generator: 90x135|320x240

I need to set into the field: Blank replacement Value - show a default image (myboard.com/defaultimage.png) automatically if there is no image added by user. How to do that, thank you!

You should do an else statement then. Something like this:

Code:
<if $userfields['fid#'] then>{$userfields['fid#']}<else then><else />The stuff to show up if profile field is not filled in should be placed here.</if>

I just realized you didn't include the my_setcookie() and my_unsetcookie() functions into the white list file. Is there any reasoning behind it or you just didn't feel like adding them ?

I found it useful recently for my personal site but I'm unsure if there might be "issues" in more "collaborative" settings (where users can edit templates, at least) that I should take into consideration.
Thank you very much for this plugin.

I'm trying to show ADVs on specific foruns , but i'm get one error whe i'm using the IF statment.. see:

<if $GLOBALS['style']['fid'] != '9'  then>{myadvertisements[zone_1]}</if>
<if $GLOBALS['style']['fid'] ==  '9'  then>{myadvertisements[zone_4}</if>

If i use "!=" it works ok... but if i use "==" it don't work ... it prints on the page "{myadvertisements[zone_4}"

If i use a single "=" it not work too ...

I'm using the 1.8.16 mybb ... How can i solve this ?

Can i use CASE THEN statment ?
Pages: 1 2 3 4 5 6 7 8 9 10 11
Reference URL's