How to find something (a word pattern) in the source code

Note: Regardless of what you want to find and change in OSSN: you need a text editor which is capable of UTF-8 encoding. Never use a wordprocessor like MSWord or LibreOffice Writer!

Case A: Searching on your local PC
Notepad++ and Sublime Text are known to do a good job, and both editors already offer a way to search in multiple subdirectories.

Having Notepad++ installed, all you have to do is:

  • unpack your OSSN installation zip file locally
  • open a file of your choice like "ChangeLog.txt" in the ossn directory with Notepad++
  • click "Search" in the main menu of the editor
  • choose "Find in Files"
  • enter your search string in the "Find what" field of the popped up window
  • specify the starting point next to "Directory" (that's your unpacked archive directory "ossn")
  • click "Find All"

The editor's window will split horizontally, and all search results (file names and line numbers inluded) are listed at the bottom half. You can even click on any of those search results and the file appears in the upper part of the split screen. So make your changes, save the file and you're done.

Another, but much clumsier approach could be to make use of your operating system's search tools, like findstr on Windows:

  • open a cmd shell window
  • cd to the top of your unpacked archive (ossn) and enter
  • findstr /s /n /c:"YOUR_SEARCH_STRING" *

Again, every occurrence of YOURSEARCHSTRING will be listed with file name and line number.
See the main page for findstr at https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/findstr.mspx?mfr=true

Case B: Searching on your server
In case you're running Ossn on a machine with shell access you may use the grep command. So,

  • disable Ossn cache from your admin backend
  • cd to the top of your Ossn installation
  • and run grep -Rn "YOUR_SEARCH_STRING" .

which will do a recursive search through the complete Ossn tree.

Now that you know HOW to search for a word pattern in the source, the next question is: WHAT you are searching for?
In case of small cosmetic changes an always helpful starting point is the development console of your browser. Simply right-click the element of interest - a word, an input field, an image - and choose 'inspect element'. The browser will open up a new sub-window below the current page you're looking at, and the accompanying html code will be highlighted. So, if you want to know the filename of the Ossn logo image for example, you will get a screen like that:
http://z-mans.net/ossn-reports/how-to/1137/development-console.jpg

and you'll find that the name of the image is in fact 'logo.png'. And that the logo is located in the theme's subdirectory goblue/images.

Finally: Before applying a change whatever way...
Make sure Ossn cache is disabled on your admin backed
Make a backup of the to be changed file, first