Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 3 Articles
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
[How-To] Product Managament (vBulletin 3.5 RC 1 and up)
Andreas's Avatar
Andreas
Join Date: Jan 2004
Posts: 6,863

 

Germany
Show Printable Version Email this Page Subscription
Andreas Andreas is offline 07-25-2005, 10:00 PM

This How-To is mainly meant for Hack-Developers, if you are only planning to use Hacks just read the End-User section.

Developers
vBulletin 3.5.0 RC1 introduces a new concept for customizing/modifying vBulletin: Products.
With Products, you can manage Plugins, Phrases, Settings and Templates in just one XML File.
Furthermore it supports Install/Uninstall Codes (for running queries, etc.), it also covers updating existing Hacks as you can add Codes for different Versions.

To start, you first have to turn on debug mode:
Put
PHP Code:
$config['Misc']['debug'] = true
in config.php.

Then go to ACP / Plugin System / Manage Products.
Click Add/Import Product.
In the second Form (Add New Product) fill in the Details for your Hack:
  • Product ID should be a unique ID for you Hack; it must not start with vb and should be lowercase only, not contain spaces or other special characters.
    Attention: The Product ID must not be longer then 15 characters.
  • Title should be the Title for your Hack
  • Version should be the Version.
    The Format shoud be Mainversion Subversion Subrelease
    Example: Myhack 1.0.0 Beta 1
  • Description should be a short description for you Hack, eg. what it does.

Afterwards, create all the Plugins, Phrases, Templates and Settings your Hack requires and make sure you select the Product you just created.
Important: Templates must be placed in the MASTER Style, Phrases in the MASTER Language

When you are finished, go to ACP / Plugin System / Manage Products and select Edit from the Dropdown next to your Product.

In the Form (Add New Install/Uninstall Code) add all Code necessary to install/uninstall your Hack (eg, Queries, etc.).
If you are updating an existing Hack, add new Install/Uninstall Codes for the new Version that just make the changes necessary to upgrade the previous Version; Product Management will make sure that all necessary Codes will be run.

If your Hack includes Usergroup Permissions/Bitfields, add the following Code to Install and Uninstall to rebuild the Bitfield cache:

PHP Code:
if (is_newer_version('3.5.1'$vbulletin->options['templateversion']))
{
    
// Rebuild Bitfields
    // Do this for vBulletin < 3.5.1 *ONLY*; later versions rebuild
    // automatically and calling the builder in install code causes
    // the bitfields NOT to be rebuild correctly
    
require_once(DIR '/includes/class_bitfield_builder.php');
    
vB_Bitfield_Builder::save($db);
    
build_forum_permissions();

When everything is done, go to ACP / Plugin System / Manage Products again and export the Product as XML; this will then include all Plugins, Templates, Phrases, Settings and Install/Uninstall Codes required.

End-Users
Go to ACP / Plugin System / Manage Products.
Click Add/Import Product, select the product XML File for the Hack you want to install.
If you are upgrading an existing Hack, make sure that Allow Overwrite is set to Yes

This How-To is (C) 2005 by KirbyDE and you are not allowed to redistribute it in any way without my explicit consent.
Reply With Quote
  #102  
Old 11-02-2005, 01:33 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<font size="3">Important change in vBulletin 3.5.1</font>

Product install code is now executed before the product gets inserted into the database; this way you can run any necessary pre-installation checks (mySQL Version, files are in place, etc.) and abort the instalation if necessary.
Reply With Quote
  #103  
Old 11-13-2005, 07:40 PM
Code Monkey's Avatar
Code Monkey Code Monkey is offline
 
Join Date: May 2004
Posts: 1,080
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What's the best way to go about updating a product?

Say you add a new field to a table with an update.

Do you just put an alter table?

Will it just skip it in future updates if they already have the field?

Or should you just have a seperate upgrade script?
Reply With Quote
  #104  
Old 11-13-2005, 07:58 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just put the alter statement for the new version upgrade code.
Reply With Quote
  #105  
Old 12-01-2005, 03:25 AM
timetunnel timetunnel is offline
 
Join Date: Sep 2005
Posts: 86
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is a wonderful thread...

This is my introduction to this feature. It sure puts a whole new light on the extent to what this software can do!

QUESTION: is it ok to leave the debug enabled or should it be disabled after the product is created, or does it matter? Is there any security issue to consider if left enabled 'permanently'?

Thanks in advance.
Reply With Quote
  #106  
Old 01-01-2006, 06:06 AM
DaveAK DaveAK is offline
 
Join Date: Dec 2005
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Revan
That's really anal. That's like saying "I refuse to zip my hacks because I hate the WinZip program. I am blatantly ignoring the fact that WinRar/WinAce/[insert name of unpacking software for Mac/Linux/Unix] can unpack these files."
Making the How-to's HARDER to use is IMHO completely against the point of making them. I consider this a kick in the nuts to the community. This paragraph (and only this) will be retracted if someone can show me a way to copy/paste from Adobe Reader. I refuse to install any other piece of software to be able to copy/paste from a .pdf document, as I do not feel the need to clutter my computer with crap that will be used 1 or 2 times.
At any rate, see if you can stop me from making CHM files on my own computer (not to distribute).

Now to get back on the actual topic:
Ive learned the hard way that settings have to be volatile for them to be able to export properly, but won't this erase them on upgrade? The code in the xml_import_settings() makes me think that if you are trying to re-import settings that are marked as volatile, it will recreate these settings. This is not a desired effect, so I hope someone can prove me wrong
Ever tried the "Select Text" tool in Adobe Reader? The one where you can highlight text, and copy it to the clipboard for pasting into other applications? Try it and then you can retract your paragraph.
Reply With Quote
  #107  
Old 01-20-2006, 08:23 PM
monotreme monotreme is offline
 
Join Date: Nov 2005
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is this the only way to export your plugins?
Reply With Quote
  #108  
Old 11-03-2006, 04:37 PM
echamberlain's Avatar
echamberlain echamberlain is offline
 
Join Date: Aug 2006
Location: San Francisco
Posts: 69
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a way to bundle php code within the product installation process?

It would be nice if the install was one xml file import and not an import, plus an upload.
Reply With Quote
  #109  
Old 11-03-2006, 10:06 PM
Cap'n Steve's Avatar
Cap'n Steve Cap'n Steve is offline
 
Join Date: Feb 2004
Location: Kalamazoo, MI, USA
Posts: 745
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When you edit a product, there's a place to put install and uninstall code.
Reply With Quote
  #110  
Old 03-01-2007, 03:23 PM
diades diades is offline
 
Join Date: Jul 2002
Location: Glasgow
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi

I am in the process of converting any hacks etc., to do this, I read the manual for any info and then looked at the xml files that came with the installation and some of the product hacks that are around.
I then wrote a basic product, imoported it and then exported it to see if there were any changes in the file.
This led to more research and that is the reason that I am posting here.

This is the basic "product" xml file (without values) that I have gleaned thus far:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<product xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="D:\Inetpub\wwwroot\webxpertz_net\products\product.xsd">
  <title></title>
  <description></description>
  <version></version>
  <url></url>
  <versioncheckurl></versioncheckurl>
  <dependencies maxversion="" minversion="" dependencytype=""></dependencies>
  <codes>
    <code version="">
      <installcode></installcode>
      <uninstallcode></uninstallcode>
    </code>
  </codes>
  <templates>
    <template date="" username="" name="" templatetype="" version=""></template>
  </templates>
  <plugins>
    <plugin executionorder="" active="">
      <title date="" username="" executionorder="" active="" version=""></title>
      <hookname></hookname>
      <phpcode></phpcode>
    </plugin>
  </plugins>
  <phrases>
    <phrasetype fieldname="" name="">
      <phrase date="" username="" name="" version=""></phrase>
    </phrasetype>
  </phrases>
  <options displayorder="" name="">
    <settinggroup varname="" displayorder="">
      <setting varname="" displayorder="">
        <datatype></datatype>
      </setting>
    </settinggroup>
  </options>
  <helptopics hasphrases="" product="" vbversion="">
    <helpscript name="">
      <helptopic disp="">
        <title date="" username="" version=""></title>
        <text date="" username="" version=""></text>
      </helptopic>
    </helpscript>
  </helptopics>
  <cronentries>
    <cron></cron>
  </cronentries>
  <faqentries>
    <faqtype>
      <faq></faq>
    </faqtype>
  </faqentries>
</product>
No I am trying to find out if the attributes are correct and, what, if any, are the attributes, child elements for the elements in red.
There does not seem to be a gui for that data in th cp (although I may have missed it) so, if someone can shed some light, I would be grateful.
I have written a schema for the file (as it is above) as I prefer to write the product offline as an xml file and then just import it. Thiat is also the reason for the schema, it makes life easier.
Thanks for any help.
Reply With Quote
  #111  
Old 03-01-2007, 10:01 PM
echamberlain's Avatar
echamberlain echamberlain is offline
 
Join Date: Aug 2006
Location: San Francisco
Posts: 69
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That data is all in AdminCP->vBulletin Options. Where you add/edit Settings groups and additional settings.

The xml format is really meant to be auto-generated for import/export and isn't intended to be edited by hand.

I find it much easier to develop mods in my development environment, then let the export generate the xml file.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:59 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08071 seconds
  • Memory Usage 2,336KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete