PDA

View Full Version : Group Plugins by Product in the ACP Plugin Manager


Paul M
05 Nov 2005, 04:57
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 ;


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'], 0, 4, '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'], false, 4);

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 ;


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'], 0, 4, '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'], false, 4);

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
05 Nov 2005, 05:36
Very nice, will install a bit later. :)

TTG
05 Nov 2005, 05:37
Doesn't this do the same :-

Advanced Plugin Manager (http://www.vbulletin.org/forum/showthread.php?t=95738)

Andreas
05 Nov 2005, 06:01
60 Plugins? o.O
I got 297 ... and counting.

pipin
05 Nov 2005, 12:02
great i love it.

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
05 Nov 2005, 14:07
Doesn't this do the same :-Same problem, different solution. The choice is yours.

Snake
05 Nov 2005, 16:48
/me installs

Christine
05 Nov 2005, 18:50
Nice one, Paul.

Thanks!!

Cap'n Steve
06 Nov 2005, 04:23
This really should be an option in the admincp. Hopefully it'll be in 3.5.2.

Paul M
06 Nov 2005, 04:55
* Aftermath installsAftermath forgets to click install ;)

Moparx
06 Nov 2005, 06:03
sweet. i also was getting annoyed with how it was displayed
/me clicks install

Rhoads
06 Nov 2005, 11:31
Very Nice,
Click Install ;)

Paul M
11 Nov 2005, 04:45
60 Plugins? o.O
I got 297 ... and counting.That's just greedy ...

trackpads
11 Nov 2005, 12:47
This is an excellent idea! Thanks Paul!!

Moncal
15 Nov 2005, 12:30
Great idea. I'll install this as soon as I upgrade to 3.5.1. Thanks.

bashy
25 Feb 2006, 14:23
Estimated 500+ plugins Only got about a 20/th of the way up the page and gave up
got to 200 pmsl....if anyone wants to count them for me as i cant find anywahere to
list the totals lol let me know lol ;)

Anyway...brilliant idea and i clicked install!!

havefun
30 May 2006, 14:13
very nice, thx! :)

Paul M
31 May 2006, 17:02
Just reading the new features in the vB 3.6.0 beta thread at vb.com - grouping plugins by product has been included as part of standard vbulletin, so this hack will become redundant in 3.6. :)

Parker Clack
02 Jun 2006, 12:22
Still nice to have with 3.5.4