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 04-24-2011, 08:05 PM
Artistichaven Artistichaven is offline
 
Join Date: Feb 2011
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Solved. Please delete.

First off. I am trying to add a custom option into the ModCP. I am able to get the category, but not the option. This is what I have.

if (can_moderate)
{
construct_nav_group($vbphrase['servercontrol']);
construct_nav_spacer();
}
$canrestart = false;
if (can_moderate)
{
$canrestart = true;
construct_nav_option($vbphrase['server_restart'], 'restart.php');
}

Two. I removed all pruning from my forum, but I cannot figure out how to remove the prune button from the ACP. Any ideas? Thank you!
Reply With Quote
  #2  
Old 04-24-2011, 08:31 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It looks like construct_nav_group() creates a group out of the options that have been added up to that point, so I think you want to move that to after the other construct calls.

There doesn't seem to be a simple way to remove the "Prune" option from a plugin. You could edit modcp/index.php and take out the code that adds it. Also, since the controls are kept in $_NAV before being printed out by print_nav_panel(), you might be able to do it from a plugin at hook mod_index_navigation by doing a str replace on $_NAV.

ETA: ..oh, it looks like you could also remove the "canmassprune" permission. (I'm assuming you meant the modcp even though you said ACP, but maybe you did mean ACP?)
Reply With Quote
  #3  
Old 04-24-2011, 08:37 PM
Artistichaven Artistichaven is offline
 
Join Date: Feb 2011
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
It looks like construct_nav_group() creates a group out of the options that have been added up to that point, so I think you want to move that to after the other construct calls.

There doesn't seem to be a simple way to remove the "Prune" option from a plugin. You could edit modcp/index.php and take out the code that adds it. Also, since the controls are kept in $_NAV before being printed out by print_nav_panel(), you might be able to do it from a plugin at hook mod_index_navigation by doing a str replace on $_NAV.

ETA: ..oh, it looks like you could also remove the "canmassprune" permission. (I'm assuming you meant the modcp even though you said ACP, but maybe you did mean ACP?)
No, I meant ACP. I want there to be no pruning ever.

Umm. I moved the construct_nav_group() and it did not help. Any other ideas?
Reply With Quote
  #4  
Old 04-24-2011, 08:41 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Artistichaven View Post
Umm. I moved the construct_nav_group() and it did not help. Any other ideas?
Hmm...I tried it and it seems to work. I did notice that you have "if (canmoderate)" which I wasn't sure was a typo or not (I think it should be if ($canmoderate)).

I actually moved the first "if" block last, so I'm not sure where the construct_nav_space() goes.
Reply With Quote
  #5  
Old 04-24-2011, 08:48 PM
Artistichaven Artistichaven is offline
 
Join Date: Feb 2011
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
Hmm...I tried it and it seems to work. I did notice that you have "if (canmoderate)" which I wasn't sure was a typo or not (I think it should be if ($canmoderate)).

I actually moved the first "if" block last, so I'm not sure where the construct_nav_space() goes.
IDK what was wrong. I reloaded to a fresh template and just edited the prune/move options to fit. Alright, thank you!
Reply With Quote
  #6  
Old 04-24-2011, 08:58 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, to remove the prune button you could edit the file includes/xml/cpnav_vbulletin.xml and take out the part for that button, or you could make a plugin at hook admin_index_navigation with code:

Code:
unset($navigation[80]['Threads & Posts']['options'][10]);

That obviously depends on exactly the way the xml file is, so it would probably be better (if you go the plugin route) to search all the items looking for the prune button.
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 09:09 AM.


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.04356 seconds
  • Memory Usage 2,209KB
  • 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
  • (1)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)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