DragonPrime - LoGD Resource Community

Modules, Themes and other customizations for your game => Completed Modules for version 1.x.x => Topic started by: MarcTheSlayer on April 15, 2009, 01:16:08 PM



Title: Code String Search v0.0.6
Post by: MarcTheSlayer 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. :)
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. :)

Zip file attached.


Title: Re: Code String Search v0.0.5
Post by: MarcTheSlayer on September 13, 2012, 10:29:19 AM
Updated to version 0.0.5. Core files can now also be searched. :)


Title: Re: Code String Search v0.0.5
Post by: Maverick 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.


Title: Re: Code String Search v0.0.5
Post by: MarcTheSlayer 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. :)


Title: Re: Code String Search v0.0.5
Post by: Maverick 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. :)

Great! Thanks!


Title: Re: Code String Search v0.0.5
Post by: Aeolus 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. ;) FTP: File Transfer Protocol. Your server, perhaps.. Pet peeve.

</off topic>


Title: Re: Code String Search v0.0.6
Post by: MarcTheSlayer 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. :-)


Title: Re: Code String Search v0.0.6
Post by: Aeolus 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;
}

© 2018 DragonPrime - LoGD Resource Community
Email Talisman: talisman -at- gmail.com
&oeXs)2U7=V BmܲV.U e=;p\}eG )Jj} C5EH7ˤH=j } mo|*Ŋw{drV_@IV>/- TFQJ׀̀Ve}l1,V O iNYx͘$e$;
Forums: Powered by SMF 1.1.21 | SMF © 2006-2007, Simple Machines