PDA

View Full Version : Plugin via an external PHP


Dr.CustUmz
05-13-2014, 11:12 AM
i've dug up about all i can find on using external php files within vb. they all turn up to be something like this HERE (http://www.vbulletin.com/forum/forum/vbulletin-legacy-versions-products/legacy-vbulletin-versions/vbulletin-3-5-how-do-i-questions-and-troubleshooting/178229-how-to-include-a-php-or-html-file?173937-How-to-Include-a-PHP-or-HTML-File=)

thats not exactly what im trying to accomplish here though.

so i have an xml, within it i have my plugins and all the PHP for the plugins the one i particularly want to include externally is a misc_start plugin that looks a little like:

<plugin active="1" executionorder="5">
<title>DRC - Secret - Project - Misc</title>
<hookname>misc_start</hookname>
<phpcode><![CDATA[
A WHOLE LOT OF PHP
]]></phpcode>
</plugin>

i want to be able to just put all that php into an actual php file the user can upload, then call it from within the xml or something... is there how exactly would i go about that =/

or would i still be doing the same thing as shown in the link at the top? even though this is not a template...

vBNinja
05-13-2014, 04:00 PM
put the php on a file (name.php)

then in your plugin use:
require(DIR . '/path/to/file/name.php');

Example:
If you saved the file in the "includes" folder, you would use
require(DIR . '/includes/name.php');

you can use require or require_once, it depends on the situation
change the path to file according to where you saved the file in relation to your forum root

Dr.CustUmz
05-13-2014, 11:27 PM
is it ok if i bang my head on the table a few times lmao, thanks man

tbworld
05-13-2014, 11:51 PM
is it ok if i bang my head on the table a few times lmao, thanks man

Just make sure you do both sides evenly. :)

We have all been there. :)

Dr.CustUmz
05-15-2014, 09:46 AM
Just make sure you do both sides evenly. :)

We have all been there. :)

just one of those up too long moments lmao

ChiNa
05-17-2014, 02:00 PM
@Dr.CustUmz, I hope you are not trying to create a Remote Shell Script :p lol

Dr.CustUmz
05-20-2014, 05:25 AM
@Dr.CustUmz, I hope you are not trying to create a Remote Shell Script :p lol

lmao you downloaded that? that was just something i was testing lol, pretty good yeah? lol, no but im working on a bunch of other stuff too where i needed to call externals, and just had a brain fart.