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
Just wanted to express thanks & appreciation for this plugin.  It works perfectly for my needs in mybb-1.8.26.
This works beautifully in forumdisplay.php for the forumdisplay template.

Code:
<if in_array($fid, $wcc_icboards_array) then>


However, in order to use that same code on the index.php for forumbit templates I have to change $fid to $forum['fid'] and the code stops working. Inside forumbit_depth2_forum template.

Code:
<if in_array($forum['fid'], $wcc_icboards_array) then>


Any idea what I'm doing wrong? I even tried it with just $fid but that's not a variable in index.php file... so I'm... lost.

Any help is appreciated!

MyBB-Version: 1.8.30

If the plugin is used under PHP 8.1.2 and MySQLi 10.6.7, the error message is always:
/inc/plugins/phptpl.php 92 errorHandler->error_callback
and
/inc/plugins/phptpl.php 109 preg_replace_callback_array
and
Undefined array key 2 - Line: 92 - File: inc/plugins/phptpl.php PHP 8.x.x (Linux)
and
/inc/plugins/phptpl.php(70) : eval()'d code 19 phptpl_parsetpl
and
inc/plugins/phptpl.php 118 Warning Undefined array key 2
displayed.

What needs to be adjusted in the plugin so that there are no more error messages under PHP 8.x?

Many thanks in advance for the information.

(Translated from German to English with Google Translator)
Hello, I am having some issues using this plugin. Whenever I try to use curly brackets inside of the php tags it throws me an error as such:

Parse error: syntax error, unexpected '}' in /home/hq/public_html/global.php(961) : eval()'d code(2) : eval()'d code on line 4

The code I am using is this:

<?php
if($mybb->user['uid'] > 0) {
die("TEST")
}
?>

However, whenever I remove the 2 curly brackets it works as expected. What could be causing this? Thanks.
(05-04-2022 06:25 PM)Gerti Wrote: [ -> ]MyBB-Version: 1.8.30

If the plugin is used under PHP 8.1.2 and MySQLi 10.6.7, the error message is always:
/inc/plugins/phptpl.php 109 preg_replace_callback_array
and
Undefined array key 2 - Line: 92 - File: inc/plugins/phptpl.php PHP 8.x.x (Linux)

What needs to be adjusted in the plugin so that there are no more error messages under PHP 8.x?

See this post in MyBB Community forums.
https://community.mybb.com/thread-31860-...https://community.mybb.com/thread-31860-post-1383426.html#
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