vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Plugins VS Files for Addons (https://vborg.vbsupport.ru/showthread.php?t=196938)

Bilderback 11-22-2008 03:31 PM

Plugins VS Files for Addons
 
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

Quote:

Originally Posted by Bilderback (Post 1671616)
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
Code:

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

2.-using plugins
useradmin_edit_column1
Code:

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

3.-using files
Code:

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.


All times are GMT. The time now is 01:03 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01088 seconds
  • Memory Usage 1,725KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete