PDA

View Full Version : Plugins VS Files for Addons


Bilderback
11-22-2008, 03:31 PM
What is the best way to build an addon for vBulletin?
I notice differences in the creation of products...
some use all plugins...
some use files (bitfields, xml, php)...

examples: Adding admincp options
Plugin way
Hook the useradmin edit to use print_table and other options
Bitfield way
Create the bitfield xml for options
File way
Add the code to an admin php file

Is one way better than the other?

Thanks

Dismounted
11-23-2008, 02:38 AM
WHat you use depends on teh task at hand. What kind of Admin CP options are we talking about? If it's categories under "vBulletin Options", you can add those freely by enabling Debug Mode.

Bilderback
11-23-2008, 10:07 PM
I am beginning to create products for vbulletin and just generalizing options.
Example: display some settings in the admincp for a mod-
1.-bitfield_myproduct.xml
2.-plugin (use print and admin hook)
3.-file (use print in custom admin file)

Or will it really depend on the nature of the mod and its script size?

Dismounted
11-24-2008, 03:25 AM
Again - display what settings and where?

Bilderback
11-24-2008, 05:13 AM
I am beginning to create products for vbulletin and just generalizing options.
Example: display some settings in the admincp for a mod-
1.-bitfield_myproduct.xml
2.-plugin (use print and admin hook)
3.-file (use print in custom admin file)

Or will it really depend on the nature of the mod and its script size?

A setting - Any setting
Enable Product
1.-using bitfields

<group name="myproduct">
<bitfield name="myproduct_enable">1</bitfield>
</group>


2.-using plugins
useradmin_edit_column1

print_table_break('', $INNERTABLEWIDTH);
print_table_header('My Product');
print_yes_no_row('Enable My Product', 'myproduct[enable]', $myproduct['enable']);


3.-using files

if ($_REQUEST['do'] == 'modify')
{
print_cp_header();
print_form_header('My Product Header', 'modify');
print_table_header(Enable My Product'], 1);
print_textarea_row('Enable My Product?', 'myproduct_enable');
print_submit_row("Submit!");
print_cp_footer();
}


Just trying to find the best ways to build addon scripts.

ReCom
11-24-2008, 08:32 AM
Actually there is an element tagged "options" in your product xml where you can define all these settings and have the built-in vBulletin Options section to take care all the displays, submissions and validations of your settings. Like Dismounted mentioned above, if you enable the Debug mode you can add these settings directly under vBulletin Options and later export them together with your product xml.