vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How do I make something in vBulletin Options? (https://vborg.vbsupport.ru/showthread.php?t=137040)

toonysnn 01-20-2007 03:37 PM

How do I make something in vBulletin Options?
 
Can someone help me here please? I am trying to make a vBulletin option where I can easily turn on/off a mod to my board like hide/show it then have a box below it for the phrase like $vbphrase[member_of_the_month]
Any help is appriciated. :)

Attilitus 01-20-2007 06:25 PM

First you must turn on vBulletin's Debug Mode.

You can do this by adding the following line to your config.php file:

Code:

$config['Misc']['debug'] = true;
Now go into your admincp and go into vBulletin Options. To the left of the selection menu there will be the text "add new option group" and "add new options"

Select add new option group, name it whatever you want, and then add a new option to that group.

After you have your option group created, create a new option. For example name the option "customhackon" To have this option simply turn your custom hack on/off leave all fields blank, and select "yes/no" for the "type" of setting.

Now select either yes or no and click save.

You now have a custom option setup and now all that is left to do is to ensure that your hack "obeys" the option.

If you want to do this from within the PHP file of your custom hack then add the following code to the top of the file:

Code:

if(vbulletin->options["customhackon"]==1){
run hack code here
}
else{
code you want to run if hack is not active
}

Or you can do this through templates also. Simply add the following code to your template file where the hack displays.

Code:

<if condition=="vbulletin->options["customhackon"]==1">
your hack code here.
<else />
what you want to display if the hack is not active
</if>

That ought to work... I am just typing it up off the top of my head, however, so there might be a typo somewhere in that... regardless you get the idea.

For vbulletin phrases, you need not be in debug mode. Simply go to Language and Phrases, and add another phrase under the GLOBAL category.


All times are GMT. The time now is 10:54 PM.

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.01027 seconds
  • Memory Usage 1,710KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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