Joomla 1.5 center banner modules

June 8th, 2009

A common problem with Joomla 1.5 is centering banners placed in the left or on the right side.
We create a new banner from COMPONENTS -> BANNER , the banner is displayed but never centered.
The solution to this problem is editing the file modules/mod_banners/tmpl/default.php : we need to tell Joomla to center each element.

You must edit this portion of the file

foreach($list as $item) :
?><div class=”banneritem<?php echo $params->get( ‘moduleclass_sfx’ ) ?>”><?php
echo modBannersHelper::renderBanner($params, $item);
?><div class=”clr”></div>
</div>
<?php endforeach; ?>

and we must add the <center> … </center> directive, thus having:

foreach($list as $item) :
?><center><div class=”banneritem<?php echo $params->get( ‘moduleclass_sfx’ ) ?>”><?php
echo modBannersHelper::renderBanner($params, $item);
?><div class=”clr”></div>
</div></center>
<?php endforeach; ?>

Save the file and exit, it should work fine ;)

Joomla 1.5 - 500 Internal Server Error

April 28th, 2009

After installing Joomla on a Godaddy shared server (Deluxe plan which allow unlimited websites), I renamed htaccess.txt into .htaccess to allow url rewriting.

Home page is fine, but the first article created and linked to the main menu returned this error
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, support@supportwebsite.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

The solution to the INTERNAL SERVER ERROR problem is uncommenting the following line in .htaccess (or in htaccess.txt if you didn’t already rename it).

# RewriteBase /

You must remove the # , thus having in your .htaccess

RewriteBase /

Reload the page and everything should be fine !

Upgrading Joomla 1.5 for multiple websites

April 14th, 2009

Upgrading joomla to the latest version is very easy

  1. Download the patch to the current stable version (joomla download page)
  2. Unpack the patch
  3. Upload the patch to your server overwriting old files

Few days ago Joomla has been updated to version 1.5.10 because of some security vulnerabilities.

Upgrading to Joomla 1.5.10 from Joomla 1.5.9 is straightforward, the required patch is 1.5.9 to 1.5.10 Upgrade Package

Upgrading Joomla 1.5 for multiple websites

My problem was upgrading 20 joomla installations automatically, not manually.

Each website has the Joomla SEO Patch, which has to be upgraded too, after the Joomla core upgrade.

I created a bash script to do everything automatically.

I use this directory structure for my websites: every domain is linked to a directory of my dedicated server, located in /var/www/websites

So I have

/var/www/websites/site1.com

/var/www/websites/site2.com

/var/www/websites/site20.com

I downloaded the 1.5.9 to 1.5.10 Upgrade Package to /root directory, I unpacked it using the command unzip Joomla_1.5.9_to_1.5.10-Stable-Patch_Package.zip in the directory /root/PATCH-1.5.9–1.5.10

I also downloaded the Joomla 1.5.10 SEO PATCH and unpacked it into the directory /root/PATCH-SEO

The script for a Joomla automatic upgrade is the following

cd /var/www/websites

for F in `ls -1`; do chattr +i $F/robots.txt; chattr +i $F/.htaccess; done

for D in `ls -1`; do cp -r /root/PATCH-1.5.9–1.5.10/* $D ; done

for D in `ls -1`; do cp -r /root/PATCH-SEO/* $D ; done

The first line changes your CWD (current working directory)

The second makes your robots.txt and .htacces immutable, thus avoiding overwriting.

The third line patches Joomla

The last line applies the Joomla Seo Patch

Have fun

BE CAREFUL, those commands worked for my dedicated server, your configuration and/or installation paths and versions will probably be different!!!

MCrypt - phpmyadmin: cannot load mcrypt extension

January 11th, 2009

Using phpmyadmin frontend to manage your database is straightforward. Just put in the address bar of your browser your server ip address followed by /phpMyAdmin (for example: http://192.168.1.1/phpMyAdmin .

Using it on my Godaddy Virtual Dedicated Server (VDS) showed a little warning: “cannot load mcrypt extension”

What is mcrypt?
Mcrypt is an encryption library which supports various algorithms like DES, TripleDES, Blowfish, TWOFISH, 3-WAY, SAFER-SK64, SAFER-SK128, TEA, RC2 and GOST in CBC, OFB, CFB and ECB cipher modes.

How to install mcrypt under Fedora Core 7 ?
Very easy, simply write these commands as root:

yum install libmcrypt
yum install php-mcrypt*
yum install php-mhash*
service httpd restart

Reload your phpMyAdmin page, and the warning won’t show again.

Godaddy Virtual Dedicated Server

January 9th, 2009

Like me, hundred of persons were wasting their money with 10 or 20 different shared hosting accounts at godaddy.
Once one figures out how much a VPS - Virtual Private Server (or VDS - Virtual Dedicated Server) costs, the following question arise: why am I paying $100 per month for 20 different shared hosting accounts when I can purchase a Virtual Dedicated Server for a cheap price?!?

The decision involves an analysis of dedicated server pros and cons.

VDS pro:
- unlimited website hosting (just realize how to use Apache Virtual Hosts - VHosts)
- very large bandwidth
- very large disk space
- ssh, ftp, mysql, phpmyadmin, … access
- unlimited root access
- no bad neighbours (spam, casino online or porn sites)

VDS cons:
- you must achieve security yourself
- you are responsible about all aspects of your server

I decided to switch from shared hosting to VDS and I am very happy with it!

If you need help in choosing your godaddy package or simply need additional informations, leave a comment!

Joomla: “Error loading Modules”

December 15th, 2008

I’ve been playing with the generic and useless message generated by Joomla 1.5.8 : “Error loading Modules
This problem appeared while using Jumi, a Joomla plugin enabling custom scripts and file inclusion into articles, to include a php script which performs several sql queries.
I used Joomla + Jumi for a long time, without any problem. Now that I’ve moved from a Godaddy Shared Hosting to a Godaddy Virtual Dedicated Server, this problem has appeared.
What the hell was causing that weird message? And why no modules were showing in my page?
After wasting lot of time googling, I realized something with the MySql connection wasn’t fine.
I tried modifying all settings in my.cnf with no luck, I rewrote the script, I reinstalled Jumi… Nothing!
Before giving up, I looked into the php.net manuals.
HEY, FOUND THE PROBLEM!
Mysql has a “weird” behaviour: if you open 100 connections to 100 different databases in the same server, MySql uses the same connection id for each connection!
So if you do
$db1 = mysql_connect($host, $user, $pass);
$db2 = mysql_connect($host, $user, $pass);
mysql_select_db(’db1′, $db1);
mysql_select_db(’db2′, $db2);
you get a race condition: only db2 is selected.
That’s why my modules didn’t show !

What to do?
My workaround to fix the “multiple connections problem” with MySql is the following:
$host1 = “localhost”;
$host2 = “127.0.0.1″;
$host3 = “127.0.0.1:3306″;
$host4 = “localhost:3306″;
$db1 = mysql_connect($host1, $user, $pass);
$db2 = mysql_connect($host2, $user, $pass);
$db3 = mysql_connect($host3, $user, $pass);
$db4 = mysql_connect($host4, $user, $pass);

Hope it helps!
Any comment is welcome!

Dofollow Blogs List - Directory

November 14th, 2008

As most of you already know, Google uses a complex algorithm to decide which website will appear first for a given search.
In this algorithm one of the variables is the Page Rank, a number in the range 0-10 whose value is determined by the number and the quality of incoming links.
For years building backlinks to increase Page Rank was easy: it was enough to leave comments on blogs to get an easy one-way link to your website.
Now the default behaviour for blogs like Wordpress is to append an attribute which will tell Google not to follow those links: the REL=”NOFOLLOW” attribute.
Luckily there are lot of blogs out of here which let you leave comments without the NOFOLLOW attribute: those are called DOFOLLOW BLOGS. Building backlinks for free is still possible.

DOFOLLOW BLOGS LIST - List of blogs allowing you to insert a link to your website without using REL=”NOFOLLOW”.
I have created an empty directory: DOFOLLOW BLOGS LIST : add your blog if it uses the DOFOLLOW plugin! I will check each submission manually!

Blogging for fun? Or Blogging for profit?

November 8th, 2008

I see hundred of persons enjoying blogging.

Yes, blogging is really funny.
The real problem is that blogging has become a real job for most people. A JOB WITHOUT INCOME.
They spend hours every day to write “interesting” posts. No one care about what they write, they simply HAVE TO write something each day, or they won’t be considered real bloggers.
Don’t expect me to post every day.
I am starting this blog for fun, trying to post something interesting and original.
If this blog will become popular, and thus will generate income, I’ll post every day..
This is only an introduction, not interesting post.
In next post I am discussing about the new big deal in the blogs world..

NEXT: rel=”nofollow” NO-FOLLOW — DO-FOLLOW - SPAM - PAGE RANK: what to do? Who cares?