vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin Tips & Tricks (https://vborg.vbsupport.ru/forumdisplay.php?f=239)
-   -   phpcode Preview in Plugin Manager (https://vborg.vbsupport.ru/showthread.php?t=194036)

Lynne 10-18-2008 10:00 PM

phpcode Preview in Plugin Manager
 
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:
PHP Code:

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


Right under it add:
PHP Code:

$preview strip_quotes($plugin['phpcode']);
$preview htmlspecialchars_uni(fetch_trimmed_title($preview,200)); 


Now find this line (a couple lines below the above lines):
PHP Code:

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


And change it to:
PHP Code:

"<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 10-21-2008 11:24 AM

Usefull as always, Lynne. Thank you.

ringleader 11-17-2008 01:32 PM

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 05-03-2009 03:34 PM

thanks

dandanch 08-30-2009 04:40 AM

thanks works great


All times are GMT. The time now is 02:55 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.04121 seconds
  • Memory Usage 1,724KB
  • 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
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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