Tuesday, June 29, 2010

JoomfIsh and the Mambot that was

Joomf!sh (www.joomfish.net) was inspired by a school of piranhas. That said, it’s a great tool for a multi-lingual website if you want to maintain control over your translations. Simply put, it’s an extension of Joomla which allows you create a website with more than one language version.

Some background

I was working on a booking system with tourist packages for the Soccer World Cup 2010 event. The packages were mainly targeted at Brazillians and, had to be detailed on the website in both Portuguese and English. There are a number of tools for multi-lingual websites that do translations for you automatically. I've found that these tools are horrible DIRECT translators and if your target market shows off degrees of Language studies, then you might need to re-think the usage thereof. By some Googling luck, I found Joomf!sh.

Please go through the documentation or videos for installation steps and tips to get the JoomFish going; It took me about 3 hours (should take you much less having read this blog post); Mine is not to guide you through installation steps.

There’s a secret Brazillian Piranha-God ritual prayer that one can sing when being attacked by Piranhas and the school will leave you unharmed. Like a parrot, that’s not applicable in the world of zeros and ones! The following are some lessons learnt that might save you your manhood:


The documentation states that JoomFish 1.7 requires Joomla 1.0.7 or above and write access to the following directories:

  • Mambots/system
  • Mambots/search
  • Modules/
  • Components
  • Administrator/components
  • Includes/js/ThemesOffice

This means that if you’re installing Joomfish on a remote server you’d have to change the respective folder permissions. If you’re using Joomla version 1.5 you’ll notice that this mambots folder does not exist! After some more Googling I found that, since version 1.5 the "mambots" folder was renamed to plugins. In the time of finding this solution a gastrotrich had lived a good part of its life!


After installation I noticed that the default flag for the Brazillian Portugues language pack was wrong (it displayed the Spanish flag). Mierda! If you go to the Joomf!sh “Language Manager” there is a text-field for specifying which image to use. I tried specifying the file location in this text-field and it didn't work. After much fiddling around I changed the “Short Code” text field to 'br' and got the right flag. To get the Short Code for your chosen country, you’ll have to look through the Joomf!sh flag images folder. Sterkte!


A case of re-occurrence of events whose lessons were mildly taken; What makes it more of an itchy ball is that I also blogged about it a while back. This could be SA Domain specific, but remember that the folder where temporary data is stored should be /var/www/tmp/ in your config file.

Great men leave you hanging...

Uploading local Joomla site to sadomain

***This post was cracked at some point and I haven't had time to recover the images - 01-02-2012
This post is based on an article I got from Joomla Documentation. I modified the content where I felt applicable to SA Domain. Please excuse the style of writing… this is meant to be a technical post and will remain as close to what my lab notes currently look like.

When you are first trying out Joomla!, it is often recommended that you install it on your local system (e.g., "localhost"), for example with XAMPP, and get your site running locally. In this case, you may do enough work on your local Joomla! site that you want to copy this site to your remote host. Fortunately, this is easy to do.

This article assumes that you have installed Joomla! 1.5 on your local computer, you have created a website, and you now wish to copy this website to your remote host (SA Domain in this case).
Here are the steps:
1 Create a place on your remote host to install Joomla!. This will already be created for you by the Techies at SA Domain after first payment.
2 Copy files and Directories of your local Joomla Directory to remote host.
4 Configuration Site. Edit configuration.php

Create a place on your remote host to install Joomla!.

If this is a new site, it will just be your home directory. If you have an existing site, for example www.domain.com, that you wish to keep while you work with Joomla!, you may be able to create a subdomain , for example www.domain.com/subdirectory to hold your Joomla! site.

Copy files and Directories of your local Joomla Directory to remote host.

You have 2 methods, Upload all files by FTP or Upload only a file compresed by Ftp. I didn’t use the compressed method because it requires command line access of the source and destination systems. Then you can create a compressed archive file containing all the files on the source system and transfer that single file to the destination system where it can be decompressed.

Upload all Files by FTP

Normally, the easiest way to copy these files is using an FTP client program, like Filezilla.

Select all files from directory localhost, with XAMPP the directory will be xampp/www/directory (C:\xampp\htdocs\joomla15), and upload to remote host root directory.

Copy the contents of your local MySQL database to the host MySQL database.

In Joomla!, all of the contents of the site (articles, menus, users, and so on) are stored in the MySql database. You need to copy this information to the host database. This is done by creating an export file on your local system and then importing this file into your host MySQL database, as follows:
  • Open phpMyAdmin on your local system by navigating to its URL with your browser. On your local system, this URL will normally be "//localhost/phpmyadmin". Note: If you have a password on your database, you will be prompted for it.
  • The phpMyAdmin screen will display as shown below. Select the Export link.
  • Select the database you want to export in the upper right-hand list. In the example below, the database "joomla15" is selected. Keep all of the default options, including "SQL" as the export type.
  • Check the "Save as file" box at the bottom of the screen, and enter the name of the export file, as shown below:
  • Press the "Go" button in the lower right corner. An Open / Save / Cancel dialog will display. Press Save and select a folder to save the file in. The export will complete and the file will be saved in the chosen location.
  • Open up the phpMyAdmin on the host server.
  • Select the Import tab
  • Click the Browse button under "File to import", then select the database file from your computer.
  • Click “Go” to import the database
Some things to watch out for that bit me:
The SQL file that you exported from localhost may contain the following SQL query:
USE `joomla15`;
You need to delete or comment this statement out. As a client you’re not given the privilege to create databases. In most cases you’ll find that the database has been created for you and you just need to create the tables.
In my previous projects I never had this issue and I wish I could explain why it happened this time. I suspect it’s some configuration setting I changed when playing around with JoomFish. I’m not an SQL guru and my memory has had better days before my encounter with alcohol.
At this point you have installed the database. If you don’t want to do fancy/geeky stuff then you may skip the remainder of this section and move to the next step (Editing the config file).
If you want , to create database copy, you can use also MYSQL command line method. Usually you run mysqldump to create a database copy:
$ mysqldump -u user -p db-name > db-name.out
Copy db-name.out file using sftp/ssh to remote MySQL server:
$ scp db-name.out user@remote.box.com:/backup
Restore database at remote server (login over ssh):
$ mysql -u user -p db-name <>

Editing the config file (configuration.php)

Manually edit "configuration.php" to tell Joomla! about your site. The file "configuration.php" contains settings specific to your system. This file was created for you when you installed Joomla! on your localhost. The settings in the configuration.php file that you typically need to change are shown below. This example is from a Windows XP localhost system.
var $log_path = 'C:\\xampp\\htdocs\\joomla15\\logs';
var $tmp_path = 'C:\\xampp\\htdocs\\joomla15\\tmp';
var $live_site = '';
var $host = 'localhost';
var $user = 'root';
var $db = 'your_local_db_name';
var $password = 'your_local_db_password';
Now, at your remote host system, the settings in the configuration.php file that you typically need to change are shown below
var $log_path = '/var/www/vhost/domain.com/home/html/logs';
var $tmp_path = '/var/www/vhost/domain.com/home/html/tmp';
var $live_site = '';
var $host = 'name your remote host';
var $user = 'your_user_db_name';
var $db = 'your_db_name';
var $password = 'your_db_password';
The following is an example of an sadomain one:
class JConfig {
/* Site Settings */
var $offline = '0';
var $offline_message = 'This site is down for maintenance.
Please check back again soon.';

var $sitename = 'My Site Name';
var $editor = 'tinymce';
var $list_limit = '20';
var $legacy = '0';
/* Debug Settings */
var $debug = '0';
var $debug_lang = '0';
/* Database Settings */
var $dbtype = 'mysql';
var $host = 'domainname.co.za';
var $user = 'username';
var $password = 'passwordSentBySADomain';
var $db = 'domainname';
var $dbprefix = 'jos_';
/* Server Settings */
var $live_site = '';
var $secret = 'UtAcJKMVqYJgv51A';
var $gzip = '0';
var $error_reporting = '-1';
var $helpurl = 'http://help.joomla.org';
var $xmlrpc_server = '0';
var $ftp_host = '';
var $ftp_port = '21';
var $ftp_user = '';
var $ftp_pass = '';
var $ftp_root = '';
var $ftp_enable = '0';
var $force_ssl = '0';
/* Locale Settings */
var $offset = '0';
var $offset_user = '0';
/* Mail Settings */
var $mailer = 'mail';
var $mailfrom = 'peter.peele@gmail.com';
var $fromname = 'Site Name';
var $sendmail = '/usr/sbin/sendmail';
var $smtpauth = '0';
var $smtpuser = '';
var $smtppass = '';
var $smtphost = 'localhost';
/* Cache Settings */
var $caching = '0';
var $cachetime = '15';
var $cache_handler = 'file';
/* Meta Settings */
var $MetaDesc = 'Joomla! - the dynamic portal engine and content management system';
var $MetaKeys = 'joomla, Joomla';
var $MetaTitle = '1';
var $MetaAuthor = '1';
/* SEO Settings */
var $sef = '0';
var $sef_rewrite = '0';
var $sef_suffix = '0';
/* Feed Settings */
var $feed_limit = 10;
var $log_path = '/logs';
var $tmp_path = '/tmp';
/* Session Setting */
var $lifetime = '15';
var $session_handler = 'database';
Note that if you had uploaded files directory joomla for a subdirectory, remember that you are working on subdirectory, and the settings that you need, will be,
var $log_path = '/var/www/vhost/domain.com/subdirectory/html/logs';
var $tmp_path = '/var/www/vhost/domain.com/subdirectory/html/tmp';
var $live_site = '';
var $host = 'name your remote host';
var $user = 'your_user_db_name';
var $db = 'your_db_name';
var $password = 'your_db_password';
Congratulations! At this point, your Joomla! website on your host should be operational with the exact same information as your localhost site. If you installed it on a subdirectory, navigate to that subdirectory to see or administer the site.
http://www.domain.com/subdirectory ( for navigate ) http://www.domain.com/subdirectory/administrator ( login to the joomla admin area with your user and password that your had at your localhost instaled)
and if you installed it on root directory to see the site
http://www.domain.com/ ( for site navigation) http://www.domain.com/administrator ( for logging into admin )