Log in

View Full Version : PHP in vBulletin posts


vtte
09-12-2008, 09:19 AM
Hi everyone,

I have a manga viewer script that I wish to include in my forums.

It works by calling a php script however.

I have uploaded this script to my database.

However, I have been told by the admins at vBulletin.com forums that PHP in posts are not allowed and have been re-directed here.

I have searched but cannot find anything related ...

I would like to request a modification for PHP in vBulletin posts ... or if there is one already I would appreciate a link.

Thanks!

Lynne
09-12-2008, 02:34 PM
All you want to do is include the php in your showthread pages? You can just write a plugin to include the file.

vtte
09-12-2008, 09:25 PM
How would I do this? Could anyone help please, I have no experience in coding at all.

Lynne
09-12-2008, 10:36 PM
You could write a plugin that has the code (example stolen from the manual here - Optimizing Plugin Memory Usage (http://www.vbulletin.com/docs/html/optimizing_plugin_memory)):
include('./plugins/my_script.php');
where my_script.php is your script located in the directory /plugins . As for how you choose which hook to use for your plugin, you would use one that is called in the php page you want the script to be a part of. I can't be any more specific with the information given so far.


(And do you really mean you upload the script to your database? That doesn't really make sense to me so I'm not sure what to make of that.)

Opserty
09-12-2008, 10:50 PM
May help: Including External Files (http://www.vbulletin.com/docs/html/main/templates_externalfiles)

vtte
09-12-2008, 11:50 PM
Sorry if I have been a little unclear,

Basically I have this script:

<?php>

include("mangaviewer/script.php");

?>




And I just want it to run script.php which is in my directory. But I just want to implement this into a post so it displays in a post. That's all.

I will take a look now at the links you've given me. Thanks