This is a nice tutorial you have, I have read many, but this one is very clear and simple. But from all the tutorials I've tried, I can never get this to work. I want to have a php file output into the postbit_legacy template. So I made a plugin following this tutorial, using this:
Hook Location: global_start
Title: Testing
Execution Order: 5
And the PHP Code:
PHP Code:
ob_start();
require_once('http://**********/creds.php');
$php_include = ob_get_contents();
ob_end_clean();
vB_Template::preRegister('postbit_legacy',array('php_include' => $php_include))
Then in the postbit_legacy template I added in {vb:raw php_include} where it should go. Nothing shows up, and I get an error at the top of the page:
PHP Code:
Parse error: syntax error, unexpected $end in /home/****/public_html/forums/global.php(29) : eval()'d code on line 7
I get that error on pages that have posts on it. On the forum homepage, nothing shows up except:
PHP Code:
Parse error: syntax error, unexpected $end in /home/mmodis/public_html/forums/global.php(29) : eval()'d code on line 7
Fatal error: Call to undefined function print_portal_output() in /home/mmodis/public_html/index.php on line 46
If anyone can help me with this thanks, I have had problems with using plugins to include php files in the templates for too long. It always worked perfectly fine for me in vB 3.4. Thankyou for your time.
Note: Where the "****" are, just for posting the code here, I put those in to censor where the files are, just to be safe. I really do have the correct paths in the files uploaded to the site.