musicmaestro Posted December 16, 2007 Posted December 16, 2007 Hi This has probably already been discussed before but in any case, if it helps anyone, then so be it. I have seen many questions asked in this fourm (including my own) in the past on how to find wording in php files so it can be changed. There are so many files, and as a beginner sometime ago, I struggled. Some examples have been "How do I change the text in the footer" or "How can I change the wording from 'Contact us' to 'Use our contact form'" An easy way is to download Crimson Editor 3.70 Release (Freeware, no spyware or malware) and simply use the "find in files" function on the Search drop down menu. It then searches for your keywords that are contained in the appropriate files. If found, you double click on the found file and it takes you straight to the line where the wording is. I have found this very efficient and saved me endless hours trying to find the correct file. If this helps anyone, great, if not, ignore it! Good luck. Steve
germ Posted December 17, 2007 Posted December 17, 2007 Another useful tool is called "Agent Ransack". It's a free search utility. Just Google it. Download all your files to your PC and use it to search for words and/or phrases. If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
sdrio Posted December 17, 2007 Posted December 17, 2007 Good tip. It's actually worth playing around with this - I use Dreamweaver which has the same capability, and Occasionally when I'm not concentrating I search the entire site for a string, rather than the current doc, but it's actually quite educational! I have learned quite a bit about how OSCommerce in particular is bolted together by looking carefully at where a string originates, and how it is 'passed down' through files to appear on a page.
Guest Posted December 17, 2007 Posted December 17, 2007 Windows can do this by right clicking on the directory on your PC and select search. Just tell it to search in files called *.php.
musicmaestro Posted December 17, 2007 Author Posted December 17, 2007 Windows can do this by right clicking on the directory on your PC and select search. Just tell it to search in files called *.php. Windows can search, but with the editor I mentioned, when the string is found in the php file, you double click on it and you can edit it straight away on the exact line. Windows cant do that! Thanks for your post though.
germ Posted December 17, 2007 Posted December 17, 2007 Windows "Search" function was always failing to find things I knew were there. That's why I sought something else. And I've never looked back... If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
sdrio Posted December 17, 2007 Posted December 17, 2007 Windows "Search" function was always failing to find things I knew were there. That's why I sought something else. And I've never looked back... OSX's search is the most retarded piece of software I have ever seen. It's absolutely infuriating. It doesn't say which directory the results are in, unless you actually click on each result. So if you search for *.php, you'll get 25 index.php's, and unless you click on each one individually, you don't know which one is the one you're looking for. It will also reliably search the whole computer when you want to search one directory, but when you want to search the whole cimputer, it'll search the current (or any other it feels like) directory. I reckon <sarcasm> the Windows developers patented all the useful ideas before Apple developed spotlight, so they were left with all the crap ones. </sarcasm>
peteschulte Posted December 18, 2007 Posted December 18, 2007 OSX's search is the most retarded piece of software I have ever seen. It's absolutely infuriating. It doesn't say which directory the results are in, unless you actually click on each result. So if you search for *.php, you'll get 25 index.php's, and unless you click on each one individually, you don't know which one is the one you're looking for. It will also reliably search the whole computer when you want to search one directory, but when you want to search the whole cimputer, it'll search the current (or any other it feels like) directory. I reckon <sarcasm> the Windows developers patented all the useful ideas before Apple developed spotlight, so they were left with all the crap ones. </sarcasm> <appreciated> That's a cool tag there, sdrio </appreciated> Pete Schulte
Guest Posted December 18, 2007 Posted December 18, 2007 Windows can search, but with the editor I mentioned, when the string is found in the php file, you double click on it and you can edit it straight away on the exact line. Windows cant do that! Thanks for your post though. Sometimes I just want to find where the info is, not to edit it.
Guest Posted December 18, 2007 Posted December 18, 2007 Windows "Search" function was always failing to find things I knew were there. That's why I sought something else. And I've never looked back... Never failed me.
musicmaestro Posted December 18, 2007 Author Posted December 18, 2007 Sometimes I just want to find where the info is, not to edit it. But is it not quicker and more efficient to search for a string in a folder where php files are, then once you have found it, either edit it or as you say just find it? I wouldn't have all day to search the whole of my ard drive just looking for a file. By the way this is not an arguement, just a good old fashioned discussion for others views and thoughts. Steve PS: "Alone we can do so little, together we can do so much"
germ Posted December 18, 2007 Posted December 18, 2007 My Wife tells me it's not a Windows problem. It's a mechanical malfunction - The loose nut behind the keyboard. ;) If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there >
Guest Posted January 6, 2008 Posted January 6, 2008 My Wife tells me it's not a Windows problem. It's a mechanical malfunction - The loose nut behind the keyboard. ;) Does she mean the loose nut in front of the keyboard LOL
railroadguy Posted January 6, 2008 Posted January 6, 2008 Hi This has probably already been discussed before but in any case, if it helps anyone, then so be it. An easy way is to download Crimson Editor 3.70 Release (Freeware, no spyware or malware) and simply use the "find in files" function on the Search drop down menu. Steve I normally use UltraEdit for working with php files as well as perl. I have suggested Crimson to clients because it's free and will not muck up the code. One thing I did not see, if I write a perl script and save as .cgi does it automatically save in UNIX format? I see the Tools > Preferences > File but it's a pain to do quick conversions. With UltraEdit I can convert back and forth if need be. It also have a limited but more then enough Compare feature built in. I normally use Super Text Search in conjunction with UltraEdit but do see your point of having Crimson jumping right to the line of code. These tools are a must for working with the cart. Once you see where pieces of code are coming from you get a feel for the directory structure and what they contain. Dan
musicmaestro Posted January 6, 2008 Author Posted January 6, 2008 I normally use UltraEdit for working with php files as well as perl. I have suggested Crimson to clients because it's free and will not muck up the code. One thing I did not see, if I write a perl script and save as .cgi does it automatically save in UNIX format? I see the Tools > Preferences > File but it's a pain to do quick conversions. With UltraEdit I can convert back and forth if need be. It also have a limited but more then enough Compare feature built in. I normally use Super Text Search in conjunction with UltraEdit but do see your point of having Crimson jumping right to the line of code. These tools are a must for working with the cart. Once you see where pieces of code are coming from you get a feel for the directory structure and what they contain. Dan Good post and comments Dan. Yes, it is much easier when you can navigate your way around some of this code. It certainly made me feel more confident about editing my own script. Steve
MrPhil Posted January 21, 2010 Posted January 21, 2010 For my money (it's free), nothing can beat grep. A native Unix/Linux tool, there are ports for Windows (DOS command window). You can search a whole directory tree at once, and it uses regular expressions rather than fixed strings. You can pipe the output into another grep to narrow down the search, or use the -v flag in invert it and exclude anything containing a given pattern. The only down side is that it produces only a list of files (and, by default) the found line, so it's not good on binary files and it can't go directly into an editor (the output needs manual cleanup).
Recommended Posts
Archived
This topic is now archived and is closed to further replies.