The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
including class files inside of hooks for extra functionality
I have been trying to add a custom made php class file inside a hook but it keeps on messing up the entire page by resulting in a completely blank page with no content at all.
From trial and error the problem seems to be with the include of a class not the content, so I am curious to know if there is proper method of achieving the same result. example of include line added: class_exists('myclass') || require_once('custom_includes/myclass.php'); What I need to be able to do is include the class and create an instance of it to be able to access the functionality within the class. example: $mClass = new myclass(); But unfortunately I cannot get passed the including of the class into any hook through the admin tools or by including it directly into the vbulletin php files. Any and all attempts keep resulting in a completely blank white page with no content at all. I would appreciate anyone shedding some light on this matter so I can put it behind me and move forward with my additions. |
#2
|
|||
|
|||
PHP Code:
|
#3
|
|||
|
|||
Thank you for the quick reply and I think from the sample that you gave that you are implying that the the whole class should be stored within the database as a plugin.
Even though I am sure that method would work we diecided to go a slightly different approach being that we would put the class and some logic all contained within a single php file. And the php file was included within the plugin/hook as well as a function call to perform the appropriate tasks that where required. here is what the plugin/hook looks like: PHP Code:
|
#4
|
||||
|
||||
PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|