vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Solved. Please delete. (https://vborg.vbsupport.ru/showthread.php?t=262578)

Artistichaven 04-24-2011 08:05 PM

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!

kh99 04-24-2011 08:31 PM

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?)

Artistichaven 04-24-2011 08:37 PM

Quote:

Originally Posted by kh99 (Post 2188246)
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?

kh99 04-24-2011 08:41 PM

Quote:

Originally Posted by Artistichaven (Post 2188247)
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.

Artistichaven 04-24-2011 08:48 PM

Quote:

Originally Posted by kh99 (Post 2188250)
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!

kh99 04-24-2011 08:58 PM

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.


All times are GMT. The time now is 03:26 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.01031 seconds
  • Memory Usage 1,726KB
  • 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
  • (1)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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