View Full Version : Administrative and Maintenance Tools - Search for and Find Functions and Hooks in Admin CP (vB3, vB4)
nerbert
09-30-2012, 10:00 PM
Notice:
If you uploaded the original version of this product you will have to replace function_finder.php. The version you have is a very old one from when I was developing this. Lots of styling and phrase problems and it won't find all the functions. Upload the new version and click the link at the bottom of the File Finder page to rebuild the function list.
Sorry for the mistake!
General:
Before I began making modifications for vBulletin I read through all the files and memorized all the functions and hooks, their names and locations. It was a rather tedious evening but well worth it in the long run. I know most of you aren't as organized and dedicated as I am, so I built you a product for locating functions and hooks, I hope you appreciate it; it took me over an hour to build!
How it works:
The first time you open either the Function Finder or the Hook Finder in the Plugin & Products group the product reads through all the files using regular expressions to locate functions and hooks, When one is found it records the file and line number along with the name and concatenates it into a string which is stored in filelist.php or hooklist.php, which it creates in the includes folder. When you type in a function name, partial or complete, it uses regular expressions to locate the function (or hook) in the created files. You can search functions by function name or file name or both. Wildcard searches can also be done. Similarly you can search for hooks by file name or use the select menu (just like in the New Plugin page) to locate them. Once you click on the link of matches the entire file is displayed in a new window with the appropriate lines marked and the file scrolled into position. If you've changed any of the files, added files or upgraded you can rebuild filelist.php and hooklist.php with the links at the bottom of the pages. The pictures tell it all.
Installation:
I didn't zip the files so all you have to do is upload them directly to the appropriate folders. function_finder.php goes in forum/admincp and cpnav_function_finder.xml goes in forum/includes/xml. Then upload the product file in Products.
Let me know if you have any problems.
nerbert
10-01-2012, 03:59 AM
Oops, I forgot to upload the product file. Now it's there. (It's been a long day!)
I know most of you aren't as organized and dedicated as I am, so I built you a product for locating functions and hooks, I hope you appreciate it; it took me over an hour to build!
The mod is a nice addition but your ego and arrogant attitude leave much to be desired.
nerbert
10-01-2012, 10:36 PM
Oh c'mon, where's your sense of humor?
Snowhog
10-01-2012, 11:28 PM
He's Bart S. Did you expect anything less? :)
qpurser
10-02-2012, 05:42 AM
Thank you.
Don't let stupid comments discourage from writing helpful mods to make our life easier.
And YES I am one of those who is not as organized as he should be.
I will test it on my test server and give feedback.
Thanks
Michael
qpurser
10-02-2012, 06:30 AM
ok. Just installed it.
Uploaded the 2 files in the appropriate folders.
Imported the product.
Both links show up in my adminCP but there is something wrong I guess.
No matter if I click on "Hook Finder" or "Function Finder" both go the same page "Search for functions". The "Search for Hooks" doesn't show up.
I noticed when I hover over the options in the adminCP each show something different.
Links are showing like: "function_finder.php?do=functions" and "function_finder.php?do=hooks"
but as mentioned they both go to the "search function" page
nerbert
10-02-2012, 09:33 AM
I just uploaded an improved version of function_finder.php. I tidied up some styling problems and worked out some compatibility problems with IE. The scrolling to position in the file display should work better now.
ok. Just installed it.
Uploaded the 2 files in the appropriate folders.
Imported the product.
Both links show up in my adminCP but there is something wrong I guess.
No matter if I click on "Hook Finder" or "Function Finder" both go the same page "Search for functions". The "Search for Hooks" doesn't show up.
I noticed when I hover over the options in the adminCP each show something different.
Links are showing like: "function_finder.php?do=functions" and "function_finder.php?do=hooks"
but as mentioned they both go to the "search function" page
That's strange. Maybe it will work with the new file. Everything's working for me and I uploaded the files straight off the server.
qpurser
10-02-2012, 09:43 AM
I just uploaded an improved version of function_finder.php. I tidied up some styling problems and worked out some compatibility problems with IE. The scrolling to position in the file display should work better now.
That's strange. Maybe it will work with the new file. Everything's working for me and I uploaded the files straight off the server.
I replaced the function_finder.php with the new one and now it works perfect.
Also I noticed the improvement with the styling
Thanks
nerbert
10-02-2012, 10:17 AM
I replaced the function_finder.php with the new one and now it works perfect.
Also I noticed the improvement with the styling
Thanks
This is a real mystery why the old file didn't work. My theory is that what I had uploaded was a very early version of the file from way back. I don't know how many times I've accidentally downloaded files when I click on a file link in cPanel. Would you test something for me? Try searching for "print_cp_footer" and see if you have any matches. If it's the old junker file it won't find it because a regular expression was not quite right. If you don't find it you will have to rebuild filelist.php with the link at the bottom of the page.
qpurser
10-02-2012, 10:38 AM
Would you test something for me? Try searching for "print_cp_footer" and see if you have any matches. If it's the old junker file it won't find it because a regular expression was not quite right. If you don't find it you will have to rebuild filelist.php with the link at the bottom of the page.
First it didn't find the function but after rebuilding the file list.php I got the following result:
Line 418 includes/adminfunctions.php
nerbert
10-02-2012, 11:33 AM
First it didn't find the function but after rebuilding the file list.php I got the following result:
Line 418 includes/adminfunctions.php
That means it was the old junker. That thing had a lot of problems from when I was developing it. I hope all the people who uploaded it check back and get the new file. I'm glad you pointed that out.
Leica.Robbiani
10-02-2012, 03:51 PM
Hi there,
seems to work a little bit better than it should. Searching for a function shows the result twice.
Best regards
L.R.
nerbert
10-02-2012, 04:59 PM
Wow, two for the price of one and the first one was free! Can't go wrong with that.
What you're seeing are different methods in different classes but sharing the same name. Try "print_editor_form" for example. There are multiple results but in various classes. If you don't understand object oriented programming, welcome aboard -- I barely understand it myself.
Scanu
10-02-2012, 05:09 PM
This is so useful when developing a mod, thanks for this! I'll install it ASAP in my test board, tagged!
Leica.Robbiani
10-02-2012, 05:39 PM
Hi there,
What you're seeing are different methods in different classes but sharing the same name. Try "print_editor_form" for example. There are multiple results but in various classes.
Ok, I tried "print_editor_form". Below "Function Name (click to view)" I see:
"No Matches Found"
When I try "track_blog_visit" I get (see screenshot):
141544
Best regards
L.R.
nerbert
10-02-2012, 05:56 PM
That's strange. What version of vBulletin are you using? Maybe "print_editor_form" is in vB4 and you're using vB3?
Does it do that with every thing you try?
Leica.Robbiani
10-02-2012, 06:12 PM
Hi there,
I'm using vB 4.2.0.
The thing in the screenshot I see everytime a function is found.
Best regards
L.R.
nerbert
10-02-2012, 06:17 PM
I had that happen in an earlier version of function finder and then after changing some things the problem went away and I thought it was fixed. Can you rebuild functionlist.php and before you try anything, record and post the data at the top of the frame? I don't need the path value. I had about 5800 functions as best I can recall.
Leica.Robbiani
10-02-2012, 09:06 PM
Hi there,
yeah, well. I'v read your instructions how to rebuild the file functionlist.php, if you mean with filelist.php the same file. Then there is another problem. I don't have any link to rebuild the file.
I know most of you aren't as organized and dedicated as I am
Nothing against you, I know you do your best, but please check this out.
Best regards
L.R.
nerbert
10-02-2012, 09:20 PM
The link is in the text below the box. It looks like this:
[Rebuild Function List] (See either of the first two images I posted)
The data I want would look something like this:
path: /home/********/public_html/forum/
files found = (136, 490, 451, 335, 218, 11, 258, 0, 0)
functions found = 8539
search time = 13.8961129189
nerbert
10-02-2012, 11:57 PM
If anyone else is having trouble with matches being listed twice let me know. I would like to get this fixed.
Leica.Robbiani
10-03-2012, 08:34 PM
Hi there,
The link is in the text below the box. It looks like this:
Thank you, now I found it and the mod seems working now.
Best regards
L.R.
nerbert
10-03-2012, 09:23 PM
I see, that only happens when it creates functionlist.php for the first time. I'll try to fix that . Thanks for the feedback.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.