Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-04-2006, 04:52 PM
dn lodge dn lodge is offline
 
Join Date: Oct 2005
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How can i change BitField Values

I am creating a Custom Product for vBulletin (my first time) and i am picking up the format etc. from this site slowly.
Now, i am stuck on Bitfield xml file.

i have created a bitfield_product.xml file. vBulletin is picking up this file and showing the options, and its working nicely. Following is my BitField file
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>

<bitfields product="_vbhostreview">
	<bitfielddefs>
		<group name="ugp">
			<group name="vbhr_permission">
				<bitfield name="vbhr_canapprovehost" group="vbhr_permission" phrase="vbhr_canapprovehost" install="5,6">1</bitfield>
				<bitfield name="vbhr_candeletehost" group="vbhr_permission" phrase="vbhr_candeletehost"  install="5,6">1</bitfield>
			</group>
		</group>
	</bitfielddefs>
</bitfields>
Install/Uninstall Code in product file
Code:
<installcode>
$db->query("
		ALTER TABLE " . TABLE_PREFIX ."usergroup ADD vbhr_permission INT( 10 ) UNSIGNED DEFAULT '0' NOT NULL "
	);
		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();
		}
]]></installcode>
	<uninstallcode><![CDATA[
	$db->query("
		ALTER TABLE " . TABLE_PREFIX ."usergroup drop column vbhr_permission"
	);
	
		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();
		}
]]></uninstallcode>
I have 2 questions:
1) How do i make the default value to Yes (right now its making it No)
2) I see there are some HELP files with other settings (? beside each setting). How can i provide help for my custom permissions??

Thanks in advance.

I changed one line, not sure if its correct way to do it, buts it seems to be working

i changed
$db->query("ALTER TABLE " . TABLE_PREFIX ."usergroup ADD vbhr_permission INT( 10 ) UNSIGNED DEFAULT '0' NOT NULL ");

TO
$db->query("ALTER TABLE " . TABLE_PREFIX ."usergroup ADD vbhr_permission INT( 10 ) UNSIGNED DEFAULT '3' NOT NULL ");

Having default value of 3, it turns Both options on.

But, then if i change some options later on, it doesn't seem to work?

ANyone Please??
or give me a link to some tutorial
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 06:27 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.03372 seconds
  • Memory Usage 2,162KB
  • Queries Executed 13 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)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_postinfo_query
  • fetch_postinfo
  • 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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete