MyBB Hacks

Full Version: PHP in Templates / Complex Templates
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 12 13 14 15 16 17 18 19 20 21 22 23 24
This is a really dumb question...

How to make message like this

[Image: ehHXef9.png]

using this plugin Ouch

<if last post in thread older than one month then>
Some random message here 

Might not work, but perhaps something to get you started:

<if $thread['lastpost']+30*86400 < time() then>

hey there,

I tried to make this work in my new 1.8.5 (it worked on my 1.6.13 version, yesterday I upgraded to 1.8.5) but the main page doesn't load anymore since I've activated this plugin. It shows only a blank page, when I try to open my mybb.

Any idea where this comes from?

I use php in my header.tpl with:


thank you

You'll need to check your error logs, or enable PHP errors to be displayed.
If you don't know how to do this, you'll need to ask your host in regards to how they've set up PHP error logging / handling.
hi i have got half of this to work but i cant figger out why i cant get this rest to go thought

this part works

<if $mybb->user['usergroup'] == 4 then>
Admin private links

but when i get down to the second one it wont show or it wont if i use from group 10 up but anything under 9 it will i have about 40 groups and at sometime they will get their own links so need to find out a way to do this

	<if $mybb->user['additionalgroups'] == 22 then>
TVM Ops Links

ok got it to work but the number has to be the first one in the list in additionalgroups is their anyway to look thought them all

<if strpos(','.$mybb->user['additionalgroups'].',', ',22,') !== false then>

OMG thank you so much that has just put me about 2 weeks ahead now agen thank you
[01-Sep-2015 18:04:56 Europe/Berlin] PHP Deprecated:  preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /www/htdocs/xxx/inc/plugins/phptpl.php on line 99

php 5.6 from Provider, please make a update. thanks
Despite what the text says, preg_replace_callback cannot cover all the functionality offered by preg_replace/e

PHP7 does have a proper replacement, but you're probably not using it.

any time we have to add this code after our <if ... then>...<elseif ... then>...<else>...</if> code?

PHP Code:
<?php echo "Hi from PHP"; ?>


and is this possible to use MYCODE system and this plugin (PHP in Template) to
hide content for some user groups? for user group 1,5
content which inside [hide] tags


Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Reference URL's