vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Group Plugins by Product in the ACP Plugin Manager (https://vborg.vbsupport.ru/showthread.php?t=100132)

Paul M 11-04-2005 10:00 PM

Group Plugins by Product in the ACP Plugin Manager
 
This modification is no longer available or supported.

Having upgraded to vb 3.5.1 and now having over 60 plugins across 15 products I finally got fed up of the current way they are displayed so I simply switched the Products/Hooks around in the display to group plugins [for a product] together. Much easier to see what's related this way.

Simply find this section of code in the admincp/plugin.php file ;

PHP Code:

if ($_REQUEST['do'] == 'modify')
{
    
$products fetch_product_list(true);

    
print_form_header('plugin''updateactive');
    
print_table_header($vbphrase['plugin_system'], 4);
    
print_cells_row(array($vbphrase['title'], $vbphrase['product'], $vbphrase['active'], $vbphrase['controls']), 1);

    
$plugins $db->query_read("SELECT * FROM " TABLE_PREFIX "plugin ORDER BY hookname, title");
    
$prevhook '';
    while (
$plugin $db->fetch_array($plugins))
    {
        if (
$plugin['hookname'] != $prevhook)
        {
            
$prevhook $plugin['hookname'];
            
print_description_row("$vbphrase[hook_location] : " $plugin['hookname'], 04'tfoot');
        }

        
$product $products[($plugin['product'] ? $plugin['product'] : 'vbulletin')];
        if (!
$product)
        {
            
$product = array('title' => "<em>$plugin[product]</em>"'active' => 1);
        }
        if (!
$product['active'])
        {
            
$product['title'] = "<strike>$product[title]</strike>";
        }

        
$title htmlspecialchars_uni($plugin['title']);
        
$title = ($plugin['active'] AND $product['active']) ? $title "<strike>$title</strike>";

        
print_cells_row(array(
            
"<a href=\"plugin.php?" $vbulletin->session->vars['sessionurl'] . "do=edit&amp;pluginid=$plugin[pluginid]\">$title</a>",
            
$product['title'],
            
"<input type=\"checkbox\" name=\"active[$plugin[pluginid]]\" value=\"1\"" . ($plugin['active'] ? ' checked="checked"' '') . " />",
            
construct_link_code($vbphrase['edit'], "plugin.php?" $vbulletin->session->vars['sessionurl'] . "do=edit&amp;pluginid=$plugin[pluginid]") .
            
construct_link_code($vbphrase['delete'], "plugin.php?" $vbulletin->session->vars['sessionurl'] . "do=delete&amp;pluginid=$plugin[pluginid]")
        ));
    }

    
print_submit_row($vbphrase['save_active_status'], false4);

    echo 
'<p align="center">' construct_link_code($vbphrase['add_new_plugin'], "plugin.php?" $vbulletin->session->vars['sessionurl'] . "do=add") . '</p>';


and replace it with this ;

PHP Code:

if ($_REQUEST['do'] == 'modify')
{
    
$products fetch_product_list(true);

    
print_form_header('plugin''updateactive');
    
print_table_header($vbphrase['plugin_system'], 4);
    
print_cells_row(array($vbphrase['title'], $vbphrase['hook_location'], $vbphrase['active'], $vbphrase['controls']), 1);

    
$plugins $db->query_read("SELECT * FROM " TABLE_PREFIX "plugin ORDER BY product, hookname, title");
    
$prevhook '';
    while (
$plugin $db->fetch_array($plugins))
    {
        
$product $products[($plugin['product'] ? $plugin['product'] : 'vbulletin')];
        if (
$plugin['product'] != $prevhook)
        {
            
$prevhook $plugin['product'];
            
print_description_row("(" $plugin['product'] . ") : " $product['title'], 04'tfoot');
        }
        if (!
$product)
        {
            
$product = array('title' => "<em>$plugin[product]</em>"'active' => 1);
        }
        if (!
$product['active'])
        {
            
$product['title'] = "<strike>$product[title]</strike>";
        }

        
$title htmlspecialchars_uni($plugin['title']);
        
$title = ($plugin['active'] AND $product['active']) ? $title "<strike>$title</strike>";

        
print_cells_row(array(
            
"<a href=\"plugin.php?" $vbulletin->session->vars['sessionurl'] . "do=edit&amp;pluginid=$plugin[pluginid]\">$title</a>",
            
$plugin['hookname'],
            
"<input type=\"checkbox\" name=\"active[$plugin[pluginid]]\" value=\"1\"" . ($plugin['active'] ? ' checked="checked"' '') . " />",
            
construct_link_code($vbphrase['edit'], "plugin.php?" $vbulletin->session->vars['sessionurl'] . "do=edit&amp;pluginid=$plugin[pluginid]") .
            
construct_link_code($vbphrase['delete'], "plugin.php?" $vbulletin->session->vars['sessionurl'] . "do=delete&amp;pluginid=$plugin[pluginid]")
        ));
    }

    
print_submit_row($vbphrase['save_active_status'], false4);

    echo 
'<p align="center">' construct_link_code($vbphrase['add_new_plugin'], "plugin.php?" $vbulletin->session->vars['sessionurl'] . "do=add") . '</p>';


That's it, job done. :)




History:

v1.01 : First Release.

Daniel 11-05-2005 03:36 AM

Very nice, will install a bit later. :)

TTG 11-05-2005 03:37 AM

Doesn't this do the same :-

Advanced Plugin Manager

Andreas 11-05-2005 04:01 AM

60 Plugins? o.O
I got 297 ... and counting.

pipin 11-05-2005 10:02 AM

great i love it.

Quote:

Originally Posted by Andreas
60 Plugins? o.O
I got 297 ... and counting.

hehe, so it should be in your interest to promote it to the standard. :cool:

Paul M 11-05-2005 12:07 PM

Quote:

Originally Posted by TTG
Doesn't this do the same :-

Same problem, different solution. The choice is yours.

Snake 11-05-2005 02:48 PM

/me installs

Christine 11-05-2005 04:50 PM

Nice one, Paul.

Thanks!!

Cap'n Steve 11-06-2005 02:23 AM

This really should be an option in the admincp. Hopefully it'll be in 3.5.2.

Paul M 11-06-2005 02:55 AM

Quote:

Originally Posted by Aftermath
[high]* Aftermath installs[/high]

Aftermath forgets to click install ;)


All times are GMT. The time now is 02:25 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.01337 seconds
  • Memory Usage 1,799KB
  • 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
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete