PDA

View Full Version : phpcode Preview in Plugin Manager


Lynne
19 Oct 2008, 19:23
Ever been searching for a plugin and wish you didn't have to open each one to edit to find the one you want? All you need is to see the first couple lines in order to see if it's the one you want, so why not have a preview like you can with threads?

Open up admincp/plugin.php and find this code:
$title = ($plugin['active'] AND $product['active']) ? $title : "<strike>$title</strike>";



Right under it add:
$preview = strip_quotes($plugin['phpcode']);
$preview = htmlspecialchars_uni(fetch_trimmed_title($preview,200));



Now find this line (a couple lines below the above lines):
"<a href=\"plugin.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&amp;pluginid=$plugin[pluginid]\">$title</a>",



And change it to:
"<a href=\"plugin.php?" . $vbulletin->session->vars['sessionurl'] . "do=edit&amp;pluginid=$plugin[pluginid]\" title=\"$preview\">$title</a>",



Save the file and upload it. Now when you hover your mouse over the plugin link in the Plugin Manager, you should see the first 200 characters of the phpcode. (If you want more or less than 200 characters, then change that number in the second $preview statement above.)

I've tested this on both my 3.6.8 board and my 3.7.3 board and it worked fine.

Nоrman
21 Oct 2008, 13:24
Usefull as always, Lynne. Thank you.

ringleader
17 Nov 2008, 15:32
Oh excellent.
I wasn't even looking for this, but it will be so handy :D
I never remember which plugins have which code.

Mutt
03 May 2009, 17:34
thanks

dandanch
30 Aug 2009, 06:40
thanks works great