Monday, 22 July 2013

Joomla + GROUP_CONCAT (ORDER BY, SEPARATOR)

To fetch the Joomla Categories in sorted order, GROUP_CONCAT and order by with seperator.

/* Fetching all the Childs skills into a list. */
$this->_db->setQuery($this->_db->getQuery(true)
 ->from('#__categories')
 ->select('GROUP_CONCAT(title ORDER BY lft ASC SEPARATOR ", ") as skills')
 ->where('parent_id="'.(int)$parent_id.'" AND published="1"')
 ->order('lft ASC'));
$child = $this->_db->loadObject();

Tuesday, 16 July 2013

Reminiscence always leftovers

Why someone can do such a silly mistake 
by making away with oneself...

Why the other side of the surrounding couldn't be seen, 
though family and friend always there for good and either. 

Difficulties ever opted to be allotted for dissolution 
and none would be misfortunates. 

Certainly, it can't be unfasten, 
nevertheless reminiscence always leftovers. 

Alas! overwhelming compassion to those ones... :-(

~ in memory of someone

Wednesday, 12 June 2013

Joomla Extension installation problem : "JFolder::create: Could not create directory"

If you are facing the problem to install any extensions under joomla (on live or local) with the following errors;
JFolder::create: Could not create directory
Warning: Failed to move file!

Then there would be following issues;

1. The PHP temporary directory is not set
( The PHP temporary directory is the directory that PHP uses to store an uploaded file before Joomla can access this file. )
Solution:
To resolve it
  • Go to your main Joomla directory and look for a folder called /tmp/ and if there isn't one, create it.
  • Check for its File Permission which should be 0755. If not set the folder permission to 0755. This is because the /tmp/ folder must be readable and writable. (To 
PS: To change the permission, go to Hosting Cpanel > File Manager > Select the directory (do right click it and Change Permissions ). For Window Hosting Panel, it can be slightly different, check for for that.

2. The /tmp/ folder path on the Global Configuration must be set correctly.
Solution:
  • In your Joomla Administrator area, go to Site > Global Configuration > Server.
  • Check to see that the Path to Temp Folder is the path to the one you found our created in the last step. This should be the server path not the URL (http://yoursite.com etc)
If you've transferred your site between servers this will definitely need to be checked. You can also change this by changing the configuration.php file. There is a complete tutorial on all the sections of the configuration.php file here.

Thursday, 6 June 2013

To Install GIT on CentOS 5.2 server using WHM CPanel


It may be slightly different to install GIT on CentOS 5.2 server using WHM CPanel. However, I found below steps working for me to install it.

First, make sure you are logged in as ROOT via SSH using PUTTY application.
Then, do the following;
$ su // (login as root)
$ yum update

// To install yum fastest mirror plugin (yum-plugin-fastestmirror) you can use this command:-

$ yum install yum-fastestmirror

// OR

$ yum install yum-plugin-fastestmirror

Once the installation completed, check the plugins status by editing the file /etc/yum.conf and add the following line to the file:
$ plugins=1
// Install the dependencies

yum install gettext-devel expat-devel curl-devel zlib-devel openssl-devel

// Get the git source code ( http://distfiles.macports.org/git-core/ )
wget http://distfiles.macports.org/git-core/git-1.8.2.tar.gz


// untar/uncompress the git source code
tar xvfz git-1.6.1.tar.gz

// Install the files
cd git-1.6.1.tar.gz

make prefix=/usr/local all

make prefix=/usr/local install

Thursday, 23 May 2013

How to Disable/Turn off magic quotes gpc for Joomla 3.0

In Joomla 3.0, if the magic quotes is ON on server, then it will add the slashes when we have quotation marks (double/single) or adding any images, and it will cause the content to display on the proper format.

To turn off/disable magic quotes gpc for Joomla 3, please follow the below steps.

For most Share Hosting Servers running a CGI-Webinterface 
1. Create a php.ini file and add following code:
# To turn off/disable magic quotes gpc for Joomla
magic_quotes_gpc = Off
extension=pdo.so
extension=pdo_mysql.so

2. Put it in your Joomla 3 root. Then change the htaccess.txt in your Joomla 3 root to .htaccess. Add the following lines to the .htaccess file (at the top) :
# To turn off/disable magic quotes gpc for Joomla

  suPHP_ConfigPath /home/username/public_html/yourJoomlaFolder
  
    order allow,deny
    deny from all
  

Change "username" and "yourJoomlaFolder" to your respective folders.
The "/home/myusername/public_html/yourJ3folder" can be found via the Global Configuration:

OR, if you have Joomla running under /public_html folder, then just add "/home/myusername/public_html" and it will work. .htaccess for some hosts.

 For some hosts, add "php_flag magic_quotes_gpc off" to the .htaccess file.

source: http://docs.joomla.org/How_to_turn_off_magic_quotes_gpc_for_Joomla_3

Friday, 19 April 2013

Add POP-UP feature for Image and Video in Joomla 2.5/3.0

To add or enable the Pop UP feature in Joomla 2.5 or 3.0 for Images and Videos; Please follow the following steps;
  1. Login into Joomla/Administrator
  2. Go to Template Manager
  3. Click on Templates
  4. Click on [Template Name] Details and Files link of your template in the Templates List.
  5. Click on the Edit main page template link of the Template Master Files.
  6. And, add the below code on the top of the file and Save it.
defined ( '_JEXEC' ) or die ( 'Restricted access' ); 
// Add the below code underneath the above line.
JHtml::_('behavior.modal');
Once you have done with above steps, to use of POP-UP function; Just add the class="model" in the anchor tag
Link

And, To add the Pop-UP for Videos, please download the Rokbox joomla plugin and install it. And, to use it, please follow the below example.

 
Click to Play Video

Monday, 15 April 2013

Customize the Page Title in your Component Joomla 2.5/3.0

To customize the any Page Title, please follow the below instructions.

// Create the document object.
$docHTML = JFactory::getDocument();

// Fetch the Default Page title.
$defaultPageTitle = $docHTML->getTitle();

// Change the New page title as per your needs.
$newPageTitle = $pageTitle . ' - '. $docHTML->getTitle()

// Set the New Page Title.
$docHTML->setTitle(  $newPageTitle );

// To display the above set new page title.
Please, Open the Index.php file from the selected templates folder e.g. root/templates/yourSelectedTemplate/index.php. Then, add the below code on the top.
//And the below codes just underneath the 
defined ( '_JEXEC' ) or die ( 'Restricted access' ); 

// Display the Page Title.
$app = JFactory::getApplication(); 
$this->setTitle( $this->getTitle()  . ' - ' . $app->getCfg( 'sitename' ) );