The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Need to Implement Custom Pages That Execute PHP Code
I've been doing a lot of searching around and have found a few guides that allow you to create custom pages within vbulletin, namely this guide: https://vborg.vbsupport.ru/showthread.php?t=228112
I followed it and it seems to work as advertised. Unfortunately, I want these pages to be able to execute PHP code, which doesn't seem to work with this method. I found http://www.vbulletin.com/docs/html/t..._externalfiles and tried to implement these changes for php/registering variables for vb4, but I can't seem to get it working. Basically what I am trying to achieve is a setup like this: http://tools.digitalpoint.com so some of my own PHP web applications are streamlined with my forums. I just need to manage some content/these web apps (most likely 10-30 pages). I tried vbadvanced which actually worked, but seemed like a huge amount of overkill for what I am trying to achieve, and I really didn't like how it was handling my pages, url issues, interference with other mods, etc.. I also tried https://vborg.vbsupport.ru/showthread.php?t=232207 but this mod seems outdated and gave me errors. I'm basically looking for a simple, easy to implement, and working solution that doesn't involve me adding my own plugins/templates for every single new page I want, if possible. Essentially I want to run already finished php webapps that do various tasks, into my forums in the fashion as shown on digitalpoint forums. I would really appreciate some assistance. I've been working on my forums for hours and this really is the only (but vital) thing I need to work out before they go live. --------------- Added [DATE]1274076562[/DATE] at [TIME]1274076562[/TIME] --------------- bump? |
#2
|
|||
|
|||
<a href="https://vborg.vbsupport.ru/showthread.php?t=228112" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=228112</a> should work
what did you exactly try? |
#3
|
|||
|
|||
Oh, that worked fine. The only problem is that it only seemed to work for only HTML/plaintext. I put in some PHP code to test an output (just a simple echo for testing purposes) and it just displays the code how I wrote it. I made the plugin as seen in the vbulletin manual:
Code:
ob_start(); include('path/to/this/file/myfile.php'); $includedphp = ob_get_contents(); ob_end_clean(); Code:
{vb:raw includedphp} I also added Code:
vB_Template::preRegister('FORUMHOME',array('includedphp ' => $includedphp)); I've been trying to get this working for nearly two days now with nothing but frustration |
#4
|
||||
|
||||
I can't imagine that you're using the FORUMHOME template for your custom php file, do you really? You are registering your variable for that template, but you need to register it for the template you actually use for your custom php page. If you want to output something on forumhome, you don't need a custom php page. You would put your code into a plugin.
|
#5
|
|||
|
|||
Quote:
|
#6
|
||||
|
||||
No, you did not follow the custom pages tutorial - at least not closely. You need to create your own template for your custom php page and register your variable for that template you created. You are registering it for FORUMHOME template, which most probably is wrong. What is the name of the template you created for your custom page?
|
#7
|
|||
|
|||
I followed the tutorial exactly as how it was written, just to try it out and made sure I was doing it properly. My file is test.php, and my template it called TEST just as the tutorial showed.
Text and html work fine. If I put on my page: <?php Print "Hello, World!"; ?>, it will not say "Hello, World!" but rather Print "Hello, World!"; ?> My variable registration looks like: Code:
vB_Template::preRegister('TEST',array('includedphp ' => $includedphp)); |
#8
|
||||
|
||||
Why at all do you use the preregister method? The (correct) method in the tutorial is different and does not use preregister:
PHP Code:
PHP Code:
PHP Code:
|
#9
|
|||
|
|||
Finally got it working! Thank you.
P.S. I followed what you said exactly and it STILL did not work. I was copying your line: $templater->register('includephp', $includephp); , but my variable was included, it took be about an hour to figure this out |
#10
|
|||
|
|||
I would like to see this code if possible.. in a working site..
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|