DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • February 24, 2018, 09:52:45 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Poll
Question: What do you think of this module?
Excellent - 5 (100%)
Good - 0 (0%)
Average - 0 (0%)
Bad - 0 (0%)
Poor - 0 (0%)
Total Voters: 5

Pages: [1]   Go Down
  Print  
Author Topic: Code String Search v0.0.6  (Read 6726 times)
0 Members and 1 Guest are viewing this topic.
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1743


View Profile
« on: April 15, 2009, 01:16:08 PM »

Code String Search v0.0.6

This is based on Lonny Luberts 'code search' script that comes with the PQ LotGD Utils module.

Instead of using the source code viewer that comes with LotGD*, I've coded one in. It displays line numbers and alternating background row colours. The line that contains a matched code string is a different colour to make it stand out**. The code string itself will again have a different background colour to make it stand out on the line where possible.

The code is syntax highlighted using the built in PHP colours, though you can change these in the settings. Option to view source code in mono is also available.

* The long list of file names forcing you to scroll down the page everytime to get to the source code was annoying.
** Having to then search for the code string with the browser's find function was also annoying.

Updates:
21/04/09 - v0.0.2
+ Took into account that not all modules are just 1 file. Search files in sub-folders as well.
+ Search all modules or only the active ones.
+ A nice table to display them all in.
21/05/09 - v0.0.3
+ Option to search files for a second string, but only if a match to first string was found. Will help narrow down files.
05/06/09 - v0.0.4
+ Fixed a couple of problems pointed out by kaizerDRAGON. Smiley
13/09/2012 - v0.0.5
+ Added core file support so these can be searched as well.
29/08/2013 - v0.0.6
+ Added setting to ignore certain folders from being searched. Suggestion from Eclypse ~ Xpert on DP.net
+ Added some stats.
Please post questions, bugs, feedback. Smiley

Zip file attached.
« Last Edit: August 29, 2013, 03:14:52 PM by Afkamm » Logged

Check My Modules for the latest versions.
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1743


View Profile
« Reply #1 on: September 13, 2012, 10:29:19 AM »

Updated to version 0.0.5. Core files can now also be searched. Smiley
Logged

Check My Modules for the latest versions.
Maverick
Captain of the Guard
***
Offline Offline

Posts: 122


View Profile
« Reply #2 on: August 27, 2013, 10:53:00 AM »

A suggestion:

Being able to exclude certain folders from being searched.
Some (like myself) have a main and test server on the same ftp. So when using this module, the two conflict with eachother while searching and you either get 1, or both, main and test server file results. Makes it harder to track specific things down.

Not only that, but I've been getting PHP Memory Errors because the module is searching 2 LoGD's.
Logged
MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1743


View Profile
« Reply #3 on: August 27, 2013, 05:04:45 PM »

Yeah I've added a setting to enter folder names to exclude from having their contents read. Yet to test it. Next couple of days. Smiley
Logged

Check My Modules for the latest versions.
Maverick
Captain of the Guard
***
Offline Offline

Posts: 122


View Profile
« Reply #4 on: August 27, 2013, 05:13:02 PM »

Yeah I've added a setting to enter folder names to exclude from having their contents read. Yet to test it. Next couple of days. Smiley

Great! Thanks!
Logged
Aeolus
Mod God
*****
Offline Offline

Posts: 1825


You're welcome.


View Profile WWW
« Reply #5 on: August 28, 2013, 07:48:28 PM »

Some (like myself) have a main and test server on the same ftp.

<off topic>

Nothing is on an FTP. Wink FTP: File Transfer Protocol. Your server, perhaps.. Pet peeve.

</off topic>
« Last Edit: August 28, 2013, 07:50:44 PM by The Doctor » Logged

MarcTheSlayer
Mod God
*****
Offline Offline

Posts: 1743


View Profile
« Reply #6 on: August 29, 2013, 03:16:47 PM »

Ok next version is up, give it a whirl.

In settings you can now enter folder names and these folders and their contents will be ignored. :-)
Logged

Check My Modules for the latest versions.
Aeolus
Mod God
*****
Offline Offline

Posts: 1825


You're welcome.


View Profile WWW
« Reply #7 on: January 12, 2018, 08:48:23 PM »

When you have more than one file with the same filename, but in different locations, only the last one detected will be listed and the rest will be overridden. The following fix removes array_merge, and manually adds the files with new keys (appending incrementing numbers) if the filename already exists.

Find:
Code:
$files = array_merge($files, codestring_search_listdir($filepath));

Replace with:
Code:
$newfiles = codestring_search_listdir($filepath);
foreach ($newfiles as $pagename => $pagearray) {
if ($files[$pagename])  {
$i = 2;
while ($files[$pagename.$i]) $i++;
$pagename .= $i;
}
$files[$pagename] = $pagearray;
}
« Last Edit: January 12, 2018, 09:03:04 PM by Aeolus » Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Version 1.1.2 is the current supported version and is available for download.

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
20 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search