vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   [How-To] Product Managament (vBulletin 3.5 RC 1 and up) (https://vborg.vbsupport.ru/showthread.php?t=92953)

Andreas 07-25-2005 10:00 PM

[How-To] Product Managament (vBulletin 3.5 RC 1 and up)
 
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.

Dream 07-26-2005 08:03 PM

ohh thanks you are fast :P

edit: so the product ID is not a number, right? do all installations of the product will have the same product ID?

akanevsky 07-26-2005 08:13 PM

Thanks, Kirby, for this useful HowTo :)

Andreas 07-26-2005 08:18 PM

Quote:

Originally Posted by Dream
edit: so the product ID is not a number, right? do all installations of the product will have the same product ID?

The Product ID is an Identifier for your Product like myhack, welcomepm or profileviews (those are IDs of my Hacks).

They will be the same on every Installation.

akanevsky 07-26-2005 08:19 PM

Quote:

The Product ID is an Identifier for your Product like myhack, welcomepm or profileviews (those are IDs of my Hacks).

They will be the same on every Installation.
What if two different people make a mod that server the same function and therefore uses the same ID?

Andreas 07-26-2005 08:24 PM

That would not work, the user trying to install this would get a warning that this Product is already installed (if Allow Overwrite isn't selected).

akanevsky 07-26-2005 08:27 PM

Oh. So the product ID becomes the actual filename?

EDIT: Oh, and why turn on debug?

Andreas 07-26-2005 08:33 PM

You can enter just any Filename you want. But yes, it will use the Product ID as default.

You must turn on Debug Mode as you can only select Products and Master Style/Language when this is turned on.

Dream 07-26-2005 08:39 PM

well I guess its good to use "kirbydeWelcomePM" or "darkvisorMod" as product IDs, im gonna use that if I make something

are they case-sensitive?

akanevsky 07-26-2005 08:45 PM

Oh, and another question - why mustn't it contain "vb"?

Andreas 07-26-2005 08:46 PM

Doesn't seem to be case-sensitive.

It must not start with vb as this Prefix is reserved for Jelsoft :)

Logikos 07-26-2005 09:17 PM

Why do they get the vB Prefix, what makes them so darn special! ^^. Great how-to. This will help alot!

Christine 07-26-2005 09:20 PM

Thanks Kirby! :)

uae 07-27-2005 09:39 AM

First came the Plug-In system, took me a while to recreate an installation php files for my hacks.

Here comes the product thingy :(

It's not that I hate it or something, in fact I love it, but what about the time I have spent, gone for nothing ... nothing :cry: waaa

Andreas 07-27-2005 09:43 AM

Well, you could have waited until Gold ;)

loneranger 07-28-2005 07:05 PM

hi can somebody help me i have got this code from doing this tut but when i install this app it don't add the database please help me here also i think i need to build the phrases can anyone tell me what file i need to include and function to call in 3.5.0 think it's build_languages() don't know if it's changed
Code:

<?xml version="1.0" encoding="ISO-8859-1"?>

<product productid="imghost" title="Image Hosting final" description="Image Hosting" version="2.1 beta 2" active="1">
        <codes>
                <code version="2.1 beta 2">
                        <installcode><![CDATA[$db->query('CREATE TABLE '. TABLE_PREFIX .'image_host (
                                id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
                                userid INT NOT NULL,
                                img_file VARCHAR(225) NOT NULL,
                                img_name VARCHAR(255) NOT NULL,
                                file_size INT NOT NULL,
                                img_width INT NOT NULL,
                                img_height INT NOT NULL
                                )TYPE=MyISAM;');
               
        $db->query("ALTER TABLE ".TABLE_PREFIX ."usergroup ADD imghost INT( 10 ) UNSIGNED NOT NULL ;");

        $db->query("ALTER TABLE ".TABLE_PREFIX ."usergroup ADD imghostset INT( 10 ) UNSIGNED NOT NULL ;");
       
        $db->query("ALTER TABLE ".TABLE_PREFIX ."usergroup ADD imghost_width INT( 10 ) DEFAULT '100' NOT NULL ;");

        $db->query("ALTER TABLE ".TABLE_PREFIX ."usergroup ADD imghost_height INT( 10 ) DEFAULT '100' NOT NULL ;");
       
        $db->query("ALTER TABLE ".TABLE_PREFIX ."usergroup ADD imghost_files INT( 10 ) DEFAULT '100' NOT NULL ;");]]></installcode>


Andreas 07-28-2005 07:23 PM

1 Attachment(s)
The attached Product XML works fine for me.

Phrases, Templates, Settings will be installed/uninstalled automatically - you don't have to do anything for that (except assigning them to your Product of course).
Please keep in mind that they must be in MASTER Style/MASTER Language!

MrNase 07-29-2005 02:05 AM

Custom vBulletin settings must be added with a query? Or is there a function available with adds them without using a query?

Erwin 07-29-2005 03:01 AM

This is an amazing new feature for vB - this means that installing hacks can all be done via Admin CP with no need to edit files, run queries, add templates or phrases. :D

Guest190829 07-29-2005 03:26 AM

Another great 3.5 tutorial, Kirby! :)

Paul M 07-29-2005 04:49 AM

Now all we need is the ability for this to upload new files (extensions) edit templates & edit files. Then it will be a complete installation system.

Andreas 07-29-2005 08:17 AM

Quote:

Originally Posted by MrNase
Custom vBulletin settings must be added with a query? Or is there a function available with adds them without using a query?

Assign them to your Product, then Product Management will take care of Installing/Uninstalling :)

Andreas 07-29-2005 08:18 AM

Quote:

Originally Posted by Paul M
Now all we need is the ability for this to upload new files (extensions) edit templates & edit files. Then it will be a complete installation system.

I for one wouldn't like that. Especially editing Templates can be tricky, as you never know for sure how they will loke like.

Logikos 07-29-2005 08:46 AM

Quote:

Originally Posted by KirbyDE
I for one wouldn't like that. Especially editing Templates can be tricky, as you never know for sure how they will loke like.

Editing templates should be the users task only. Due to style customizations. But uploading files from the admincp would complete this! :)

MrNase 07-29-2005 10:39 AM

Quote:

Originally Posted by KirbyDE
Assign them to your Product, then Product Management will take care of Installing/Uninstalling :)

That must be done in the debug mode? Because all other things can be done without it..

Andreas 07-29-2005 10:50 AM

Templates, Phrases, Settings and Plugins must be created in Debug Mode - as stated in the first Post.

Erwin 07-29-2005 11:44 AM

Quote:

Originally Posted by Paul M
Now all we need is the ability for this to upload new files (extensions) edit templates & edit files. Then it will be a complete installation system.

I agree. And add a file editor to that, and you have everything. ;) Better yet, have ALL of the code in XML format. No more file edits... ever.

Andreas 07-29-2005 11:46 AM

I have to disagree. File and especially Template Edits should stay a User task, as they can be quite complicated keeping customized Styles and different Versions in mind.

deathemperor 07-29-2005 04:07 PM

Thanks Kirby, you should write books for vbulletin.

Dream 08-01-2005 11:43 AM

can I use version numbers like 1.0 or 1.9.5

Andreas 08-01-2005 11:48 AM

Yes. Version Numbers can have up to 3 dots, eg. 1.2.3.4

akanevsky 08-01-2005 12:09 PM

Quote:

Thanks Kirby, you should write books for vbulletin.
Yeah, uhm, actually it's a good idea...
Kirby.. How about making a CHM collection of all the HowTO's you've written so far? :P That would be really useful.

Andreas 08-01-2005 12:12 PM

If you could enlighten me what CHM is and how to create that - why not.
Hmm ... I could create a PDF.

akanevsky 08-01-2005 12:18 PM

Quote:

If you could enlighten me what CHM is and how to create that - why not.
Hmm ... I could create a PDF.
CHM is the file extension for Microsoft compressed HTML help files, in the other words it is the standard Windows format for storing help files. There are special software programs that allow you to create those CHM files...

As long as you make a table of contents, a PDF file would also be good. CHM files are usually neater and cleaner though...

This is an example of a CHM manual:
http://us3.php.net/get/php_manual_chm.zip/from/a/mirror

Andreas 08-01-2005 12:27 PM

I thought the standard Windows Helpfile-Format was .hlp?
As this is what I ship my Applications with ...

Anyway, I think PDF would be better then a "proprietary" Format that doesn't work on all Platforms.

akanevsky 08-01-2005 12:38 PM

Quote:

I thought the standard Windows Helpfile-Format was .hlp?
As this is what I ship my Applications with ...
A HLP format is old and generally deprecated. Read about it here:
http://msdn.microsoft.com/library/de...html/ch13g.asp

Concerning platform compatibility: In Windows it is integrated, Linux has KchmViewer, Macintosh X a CHMViewer1.1... I am sure other major platforms also have a viewer for such a common filetype, otherwise it wouldn't be used in so many eBooks.

P.S. I just looked in the HowTo forum, and discovered that there are also HowTo's by other authors. Therefore, in your compilation, could you please include these other HowTo's as well? Thanks :)

Revan 08-01-2005 12:40 PM

pdf is balls, Adobe is a bloated program when it just comes to reading pdf's. Also, it's very hard (I havent discovered how to) copy/paste something from a .pdf.
I'd like to see in chm too, that way I could even integrate it into Dreamweaver :D

Andreas 08-01-2005 12:43 PM

Sorry, no CHM from me.
And with this post I am also denying anybody else the right to pack my How-TOs into a CHM.

But I might do a PDF :)

akanevsky 08-01-2005 12:47 PM

Quote:

And with this post I am also denying anybody else the right to pack my How-TOs into a CHM.
Ah.. I see. I was just going to ask you about it :)
What's the reason for the denying, if not a secret?
Revan is right - Adobe Viewer for PDF is too bloated.. :(

Andreas 08-01-2005 12:49 PM

Reason = I don't like MS too much :)


All times are GMT. The time now is 11:31 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.01967 seconds
  • Memory Usage 1,832KB
  • 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
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete