I create in "
ACP >
Configuration >
Help Pages >
a new help page" with the following content:
PHP Code:
Here comes the content of the test_page.php:
Test 1 = Start with Path:
<?php include ("./folder/test page.php"); ?>
End.
|||
Test 2 = Start with URL/Path:
<?php include ("https://url/folder/test_page.php"); ?>
End.
|
The content of the test_page.php is not displayed. It will be displayed:
Here comes the content of the test_page.php: Test 1 = Start with Path: End. ||| Test 2 = Start with URL/Path: End.
The above page definition integrated in "ACP > Templates & Styles > any template" works.
What am I doing wrong?
Oh... The plugin name is PHP in Templates, so it only works in templates.
so i told you!
Is there (or would anyone have) a solution how to implement "php-include" in help_pages?
You could achieve this with a simple plugin (I'd use something like Hooks or Patches to avoid a plugin for this). In
misc.php find:
PHP Code:
$plugins->run_hooks("misc_help_helpdoc_end");
|
Add after:
PHP Code:
$templates->cache['helpdoc_'.$helpdoc['hid']] = $helpdoc['document'];
$document = eval($templates->render('helpdoc_'.$helpdoc['hid']));
|
Then, in your misc_help_helpdoc template search {$helpdoc['document']} and replace with {$document}.
BTW, nice to see you around @RateU!
It works as desired.
Many thanks for the solution.
(06-23-2020 02:45 AM)RateU Wrote: [ -> ]Oh... The plugin name is PHP in Templates, so it only works in templates.
I have integrated this
code from Sama34 into the plugin.
Look here: [
attachment=1307]
I think / hope it's a good idea.
If not, please delete my post.
Nice to see you again
I'm trying to show a specific userfield reflecting the lastposter on the forum index. When i try using the 'username' version it shows me the correct name for the lastposter. However, when I try the fid option this doesn't work. It only shows the logged in user's own userfields and ignores the lastposter's of everyone else.
<?php $user = get_user($lastpost_data['lastposteruid']); echo $user['username']; ?>
^ gives me the correct username of the lastposter
<?php $user = get_user($lastpost_data['lastposteruid']); echo $user['fid4']; ?>
^ however only gives the user logged in the user's lastpost userfield, hides others
(11-17-2018 11:23 AM)own3mall Wrote: [ -> ]I'm new to using this plugin. When I use this plugin on the latest version of MyBB, I get this error when trying to use a custom global template I've created:
Parse error: syntax error, unexpected 'ob_start' (T_STRING) in /{PATH_REMOVED}/global.php(872) : eval()'d code on line 9
In the header template for one of my themes, I have the following:
Urgh, PHP in a nested template is problematic - I'll work out a fix.
(12-28-2018 10:17 AM)ahmedwaill Wrote: [ -> ]hello , i don't know whether this Plugin still supported and updating or not , but please if you can make it able to use while statement it will be amazing , tried using while statement but failed with many things the only thing that will work if i use the code i want bbut instead of while i use "if" but it won't do things looped
here is the code i wanna use !!
The while statement must be
complete within <?php ... ?> blocks, i.e. you can't ever have
while(...) { ?> ... <?php }.
(10-14-2020 12:11 AM)leeloo Wrote: [ -> ]<?php $user = get_user($lastpost_data['lastposteruid']); echo $user['fid4']; ?>
^ however only gives the user logged in the user's lastpost userfield, hides others
get_user doesn't pull userfields.
Updated plugin to hopefully fix <template> handling for templates with <?php snippets.