Fourms Products

Go Back   KXDesign > Programming Discussion > Tutorials > [vBulletin|PHP]vBulletin options and conditionals

Notices

Tutorials Post all tutorials regarding programming,design or vBulletin here!

Reply
 
Bookmarks Thread Tools
Old 15-08-2008   #1 (permalink)
KXDesign Admin
 
Komplex's Avatar
 
A Little About Komplex
  • Join Date: Jul 2008
  • Location: Slovakia
  • Posts: 162
  • Rep Power: 5 Komplex is infamous around these parts
  • Send a message via MSN to Komplex
    Lightbulb [vBulletin|PHP]vBulletin options and conditionals

    Want to bring your new product onto a new level and use vBulletin options as well?Here we go

    To create a simple on/off option just enter the vBulletin option admincp.Now insert the values for your desired option,when you get to the type sellect boolean.I won't describe the other types here.Boolean returns values true/1 if the condition was correct and false/0 if it wasn't.

    So the variable for a vb option is $vbulletin->options['OPTIONNAME'] in plugins and php code and for templates use $vboptions[OPTIONNAME] (notice,no apostrophes in templates).So to make a simple condition:

    PHP Code:
    Unregistered users can not view codes.Please register.
    If specifies the condition inside the brackets.If you use just the variable without the comparism sign (==) then it will think that you are checking if it is 1.

    Oh I forgot,Yes = 1 and No = 0

    Did you notice the else?That is executed if the condition is anything else than what we are checking with.But you can extend your code with another elseif

    PHP Code:
    Unregistered users can not view codes.Please register.

    This was a very basic introduction into using PHP conditionals with vBulletin boolean (Yes/No) options .
    __________________
    .::{KXDesign Owner}::.
    Komplex is offline   Reply With Quote
    Old 14-09-2008   #2 (permalink)
    New Member
     
    A Little About gkaradagan
    • Join Date: Sep 2008
    • Posts: 1
    • Rep Power: 0 gkaradagan is an unknown quantity at this point
    Default Re: [vBulletin|PHP]vBulletin options and conditionals

    Unregistered users can not view codes.Please register. :S
    gkaradagan is offline   Reply With Quote
    Old 15-09-2008   #3 (permalink)
    KXDesign Admin
     
    Komplex's Avatar
     
    A Little About Komplex
    • Join Date: Jul 2008
    • Location: Slovakia
  • Posts: 162
  • Rep Power: 5 Komplex is infamous around these parts
  • Send a message via MSN to Komplex
    Default Re: [vBulletin|PHP]vBulletin options and conditionals

    Minor error,sorry for that
    __________________
    .::{KXDesign Owner}::.
    Komplex is offline   Reply With Quote
    Reply


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

    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
    Trackbacks are Off
    Pingbacks are Off
    Refbacks are Off



    All times are GMT +1. The time now is 00:52.


    Content Copyrighted To KXDesign© 2008-2009
    Powered by vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
    SEO by vBSEO 3.2.0