How to determine if the user is viewing the Joomla front page or not?


If you are using Joomla older version like 1.0 then you’ll only need to verify the current component with the following command:


if ($option == 'com_frontpage' || $option == '') {
echo 'This is the front page';
}

Bellow porsion for Joomla! 1.5 could be easily confirmed by the following command:


if ( JRequest::getVar('view') === 'frontpage' ) {
echo 'This is the front page';
}

Just in case the above command doesn’t work then the issue could be a little more complicated and need to check if the current active menu item is the default one. I saw this issue in some 1.5 early versions.


$menu =& JSite::getMenu();
if ($menu->getActive() == $menu->getDefault()) {
echo 'This is the front page';
}

Adding custom columns/fields to Joomla article


Today we will learn how to add more columns/fields to Joomla *_content table. At first we should have to add a column in *_content table.
Run in for instance phpMyAdmin.
ALTER TABLE `jos_content` ADD `test` VARCHAR( 255 ) NOT NULL

Edit administrator/components/com_content/models/article.xml add:

In the first params section for instance below the access entry. Add var $test = null; to libraries/joomla/database/table/content.php
Now add $form->set('test', $row->test); to editContent() in administrator/components/com_content/controller.php
The result is that you now have a new field called test that can be used in various ways to display a separate text that is not a part of the article.

Ubuntu Linux Start / Restart / Stop Apache Web Server & MySQL Server


How do I start, restart or stop Apache 2 web server & MySQL server under Ubuntu Linux operating systems?

/etc/init.d/apache2 is service script used to start / stop / restart the Apache2 service under Debian or Ubuntu Linux. You need to login as root or use sudo command restart Apache.
sudo -i
Enter your root password
Task: Start Apache 2 Server
# /etc/init.d/apache2 start
or
$ sudo /etc/init.d/apache2 start

Task: Restart Apache 2 Server
# /etc/init.d/apache2 restart
or
$ sudo /etc/init.d/apache2 restart

Task: Stop Apache 2 Server
# /etc/init.d/apache2 stop
or
$ sudo /etc/init.d/apache2 stop

Task: Start MySQL Server
# /etc/init.d/mysql start
or
$ sudo /etc/init.d/mysql start

Task: Restart MySQL Server
# /etc/init.d/mysql restart
or
$ sudo /etc/init.d/mysql restart

Task: Stop MySQL Server
# /etc/init.d/mysql stop
or
$ sudo /etc/init.d/mysql stop