Archive for August, 2008

Reduce number of files in Gallery

Posted by Ivan Guan under Webmaster

Gallery is a fantastic program to organise your photos. However, it generates a large number of files. This application alone is using 16,102 inodes in my server. As most server limits the number of inodes to be 50,000. Some of the tips to reduce the number of files would be handy.

Be sure to back up first.

  1. Removing the modules/*/locale/* and themes/*/locale/*/ folders is fine. you’ll still see g2’s American English default output.
  2. You can delete the g2data/cache (or just the g2data/cache/derivative) directory periodically (yours may be under a different path) at the expense of performance, as each page visit will have to rebuild those cached files from the original.
  3. Delete any modules in ./gallery2/modules that you don’t use, make sure they are deactivated / uninstalled first. You can also ”delete” from site admin, plugins
  4. Delete any themes you don’t use in ./gallery2/themes, of course making sure they aren’t activated (uninstall them!). Might be able to delete from the same place as above
  5. In each module, there are lots of .po and .mo files in each module/po directory (ie: ./gallery2/modules/uploadapplet/po). You should be safe to delete any languages you *don’t* use, but you can see this could quickly be time consuming. If you have shell access, you could do something like `find . -name ‘es.*’` to see all the “es” language files (is that spanish?). You could expand the find request until you are happy with the results (say, using regex) then add a “-delete” or “-exec rm ‘{}’ ‘;’” (depending on which it supports) to nuke all those language files. You might have to repeat it a few times with different file names specified so you can get them all w/o removing the languages you want to keep. This should save a lot of files too.
  6. You might consider de-activating all your modules, downloading the latest “minimal” release and blowing away your ./gallery2/ dir (after making a backup of course), copying the “config.php” from your backup and then making sure everything is going. Now, using the downloadable plugins, you can get modules with *only* the languages you want.

Improve Joomla’s search result

Posted by Ivan Guan under Joomla

Currently if you search a Joomla site using default search module and component, “Food Hamburgers” will return all pages with either “Food” or “Hamburgers”.

search-all-words.png

This isn’t particularly useful because people would prefer to see pages with both. Zorro, a regular and wise commenter on this blog has come up with a neat little hack available here at www.nitsche.org. Download it, save it as mod_search.php, backup your existing mod_search.php and upload this instead. Now, when people search your site, Joomla will use the “all words” search by default.