![]() |
Creating a product - what variables are available?
I am trying to create a new product with its own plugins and templates. When I add a new plugin to my product, how do I know what objects are created and available, and what variables are set? The vBulletin manual states:
Quote:
|
The product itself does nothing. It's just a container to your plugins. You have to look in each PHP file for the hook locations and then create a plugin which uses said hook. It will inject the code that you put into the plugin where you see ($hook= etc, etc)
|
Quote:
|
You read the code. Honestly, that's what I've seen a lot of other people say to do. It's personally how I learned how to program for vBulletin. You need to see what's defined in the PHP file for whatever you're trying to do. For example, if you want to do something right before a post is accepted and parsed into the database, you look for the proper hook (They have pretty easy to understand names) and then put in your code in that hook. The proper classes and functions that you'll need will be there elsewhere in the file.
The API is handy because it tells you the arguments for the functions and such, but it's not going to tell you what's in each of the files. |
vBulletin does not have some list somewhere that tells you exactly what has been defined already at every hook location. You need to look at the php page and see what has been defined already.
|
Quote:
|
So you did! :D
|
Quote:
|
'Reading' the code also helps to tell you the name of the variable you want to use ($group or $discussion for example) and tells you if some fields other than the fields in the table have already been 'calculated' or evaled for you. It really does help to find your hook in the code and look at the stuff around it.
|
Thank you very much guys!
|
Quote:
|
You also have to look out for things you must set, otherwise, weird things will happen.
|
All times are GMT. The time now is 04:04 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|