Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
Create Multiple Options Per Forum (via Bitfields)
akanevsky
Join Date: Apr 2005
Posts: 3,972

by akanevsky akanevsky is offline 22 May 2006

Create Multiple Options Per Forum (via Bitfields)

This How-To should serve as a reference to coders, who have a basic knowledge of PHP and who want to make their own mods.
Help on writing hacks will NOT be provided, and any such posts will be ignored.

Whereever it says mybitoptionsfield, you'll need to replace that with the actual fieldname that you are going to use.
  • The following step is to create bitfield xml for vBulletin.
    Create a file named bitfield_myproductid.xml, where myproductid is the id of your product, with the following content, in ./includes/xml/:
    Note: In the <bitfield> tag, name="" must contain the desired title of the option. You are going to use that title to access the options later on. The title must contain ALPHANUMBERIC characters only, and it should not contain spaces. The digit in between the opening and closing <bitfield> tags is the bit value. Each consecutive bit value must be 2 x (Previous Value). Sample valid sequence: 1, 2, 4, 8, 16, 32.

    Block Disabled:      (Update License Status)  
    Suspended or Unlicensed Members Cannot View Code.

  • The following step is to define installation process of the bitfield in your product.
    Create a new product and add the following codes as install and uninstall, respectively:


    Block Disabled:      (Update License Status)  
    Suspended or Unlicensed Members Cannot View Code.


    Block Disabled:      (Update License Status)  
    Suspended or Unlicensed Members Cannot View Code.

  • The following step is to have the new options fetched together with foruminfo.
    Create a plugin @ fetch_foruminfo with the following code:


    Block Disabled:      (Update License Status)  
    Suspended or Unlicensed Members Cannot View Code.

  • The following step is to add new options to AdminCP User Manager.
    Create a plugin @ forumadmin_edit_form with the following code:


    Block Disabled:      (Update License Status)  
    Suspended or Unlicensed Members Cannot View Code.

  • The following step is to have the new options saved when the button is clicked.
    Create a plugin @ forumadmin_update_save with the following code:


    Block Disabled:      (Update License Status)  
    Suspended or Unlicensed Members Cannot View Code.

  • The following step is to have the new bitfield added to the vBulletin_Forum_Dm.
    Create a plugin @ forumdata_start with the following code:


    Block Disabled:      (Update License Status)  
    Suspended or Unlicensed Members Cannot View Code.


Once done, rebuild your btifields.
Now, you should be able to access the new options simply by using $foruminfo['mybitoptiontitle'].

>> EOD

Last edited by akanevsky; 22 Jun 2013 at 15:11..
Views: 6553
Reply With Quote
Comments
  #2  
Old 22 May 2006, 14:16
amykhar's Avatar
amykhar amykhar is offline
 
Join Date: Oct 2001
Real name: Amy
Thanks for taking the time to write this up
__________________
amykhar.com
----------------------------------------
I do not respond to PM requests for coding assistance.
Reply With Quote
  #3  
Old 22 May 2006, 18:46
Logikos Logikos is offline
 
Join Date: Jan 2003
Thanks alot Anthony!

/me bookmarks!
__________________
Full Time PHP Developer
Please feel free to contact me if you have any paid work to be done.
Reply With Quote
  #4  
Old 22 May 2006, 21:24
ronoxQ's Avatar
ronoxQ ronoxQ is offline
 
Join Date: Aug 2005
What do you mean by Multiple Options?
Reply With Quote
  #5  
Old 22 May 2006, 21:31
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Real name: Anton Kanevsky
Originally Posted by ronoxQ
What do you mean by Multiple Options?
I mean "two or more options held in a single database field".
__________________
I can no longer support any of my hacks. Please do not contact me for that. Feel free to create and post new versions of my hacks, as long as you give me credit for the original work.
Reply With Quote
  #6  
Old 22 May 2006, 23:47
ronoxQ's Avatar
ronoxQ ronoxQ is offline
 
Join Date: Aug 2005
Originally Posted by Psionic Vision
I mean "two or more options held in a single database field".
Hmm... I'm still a tad confused. What options do forums have?
Reply With Quote
  #7  
Old 23 May 2006, 00:09
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Real name: Anton Kanevsky
This tutorial is about creating new options, therefore forums WILL have whatever options you add using this tutorial, given you do it correctly
__________________
I can no longer support any of my hacks. Please do not contact me for that. Feel free to create and post new versions of my hacks, as long as you give me credit for the original work.
Reply With Quote
  #8  
Old 25 Jun 2006, 19:22
rogersnm's Avatar
rogersnm rogersnm is offline
 
Join Date: Apr 2006
Location: Cyberspace, UK
Real name: Nick Rogers
it's just giving me sql errors is this for 3.5.x or 3.0.x

Last edited by rogersnm; 25 Jun 2006 at 19:45. Reason: Automerged Doublepost
Reply With Quote
  #9  
Old 25 Jun 2006, 19:47
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Real name: Anton Kanevsky
This is for 3.5.x.
__________________
I can no longer support any of my hacks. Please do not contact me for that. Feel free to create and post new versions of my hacks, as long as you give me credit for the original work.
Reply With Quote
  #10  
Old 25 Jun 2006, 19:48
rogersnm's Avatar
rogersnm rogersnm is offline
 
Join Date: Apr 2006
Location: Cyberspace, UK
Real name: Nick Rogers
i wonder why it doesn't work then.
Reply With Quote
  #11  
Old 25 Jun 2006, 19:52
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Real name: Anton Kanevsky
I don't know, it works for me. I used the steps described above to implement such thing in about 4 of my hacks by now...
__________________
I can no longer support any of my hacks. Please do not contact me for that. Feel free to create and post new versions of my hacks, as long as you give me credit for the original work.
Reply With Quote
  #12  
Old 22 Aug 2006, 18:58
harmor19 harmor19 is offline
 
Join Date: Apr 2005
Real name: Andrew Harmor
I am trying to make a link in the thread tools.
What hooks would I use instead of "forumadmin_edit_form" and "forumadmin_update_save"?
Reply With Quote
  #13  
Old 03 Dec 2006, 02:32
jerudc jerudc is offline
 
Join Date: Mar 2005
I have a question about the bitfield_myproductid.xml file.

When you release a product, can you include this information in the product.xml file? That is, can you put a new child

<bitfields ...></bitfields>
inside the <product ...></product> element of your installer? or must you have the user place the bitfields xml file in the mysite/includes/xml folder as part of product setup?
Reply With Quote
  #14  
Old 03 Dec 2006, 02:39
akanevsky akanevsky is offline
 
Join Date: Apr 2005
Real name: Anton Kanevsky
The XML must be in /includes/xml.
__________________
I can no longer support any of my hacks. Please do not contact me for that. Feel free to create and post new versions of my hacks, as long as you give me credit for the original work.
Reply With Quote
  #15  
Old 18 Mar 2007, 11:07
diades diades is offline
 
Join Date: Jul 2002
Hi Psionic

Thanks for taking the time do publish this, very useful.
__________________
Later
Keith

Community for Webmasters & Developers
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

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


New To Site? Need Help?

All times are GMT. The time now is 07:06.

Layout Options | Width: Wide Color: