View Single Post
  #3  
Old 03-02-2012, 04:52 AM
Ombra Ombra is offline
 
Join Date: Nov 2007
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
I don't think you wnt to edit any of the xml files, I believe they just assign names to specific bits. If you're talking about the default settings when you create a new usergroup, I think they're in admincp/usergroup.php around line 125
I did edit the xml file "bitfield_vbulletin.xml" to change the default moderator permissions. I added or removed "default="1"" and this worked. I didn't touch the numbers though. I also edited the code you quoted in usergroup.php and that worked for the usergroup defaults. Thanks.

Now I'm trying to track down the avatar gallery defaults. My forum uses the galleries extensively and now that it's several years old we have many "retired" galleries where we change all the "can use" usergroup permissions to "no". This allows members to keep the avatar but the galleries no longer appear on the list. Problem is, since these permissions default to yes, any new usergroup causes us to have to go through all the permissions again to change them to "no". I want all galleries to default to "no" so I just have to switch the registered usergroup to "yes" when I create the gallery.

The page with these permissions is images.php in the admincp directory. I found "$canuse" in the code, but it isn't clear to me where the default setting is specified.

Is this the right section of code to specify the default permission?

PHP Code:
// ###################### Start Edit Permissions #######################
if ($_REQUEST['do'] == 'editpermissions')
{
    
$vbulletin->input->clean_array_gpc('r', array(
        
'imagecategoryid'    => TYPE_INT
    
));

    
$categoryinfo verify_id('imagecategory'$vbulletin->GPC['imagecategoryid'], 01);
    if (
$categoryinfo['imagetype'] == 3)
    {
        
print_stop_message('smilie_categories_dont_support_permissions');
    }

    
$usergroups $db->query_read("
        SELECT usergroup.*, imagecategoryid AS nopermission FROM " 
TABLE_PREFIX "usergroup AS usergroup
        LEFT JOIN " 
TABLE_PREFIX "imagecategorypermission AS imgperm ON
        (imgperm.usergroupid = usergroup.usergroupid AND imgperm.imagecategoryid = " 
$vbulletin->GPC['imagecategoryid'] . ")
        ORDER BY title
    "
);

    
print_form_header('image''updatepermissions');
    
construct_hidden_code('table'$vbulletin->GPC['table']);
    
construct_hidden_code('imagecategoryid'$vbulletin->GPC['imagecategoryid']);
    
print_table_header(construct_phrase($vbphrase["permissions_for_{$itemtype}_category_x"], $categoryinfo['title']));
    
print_label_row('<span class="smallfont"><b>' $vbphrase['usergroup'] . '</b></span>''<span class="smallfont"><b>' $vbphrase["can_use_this_{$itemtype}_category"] . '</b></span>');
    while (
$usergroup $db->fetch_array($usergroups))
    {
        
$usergroupid $usergroup['usergroupid'];
        
$canuse iif($usergroup['nopermission'], 01);
        
print_yes_no_row($usergroup['title'], "iperm[$usergroupid]"$canuse);
    }
    
print_submit_row($vbphrase['save']);


--------------- Added [DATE]1330669158[/DATE] at [TIME]1330669158[/TIME] ---------------

After some trial and error I found that editing the line "$categoryinfo = verify_id('imagecategory', $vbulletin->GPC['imagecategoryid'], 0, 1);" and swapping the places of "0, 1" changes the defaults to no. However, after testing it doesn't work properly. The defaults appear to be "no" but the galleries are still listed and I occasionally get the "smilie categories don't support permissions" error. I seem to be in the right general area, but there is more to it. Any help would be greatly appreciated.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01269 seconds
  • Memory Usage 1,805KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)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 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete