16 03 2010

This is a guide to save you from banging your head against a wall, in case you ever want to get PHP talk with Ingres on a CentOS machine.

After hours of searching around and not finding not one damn proper guide, I decided to just write one down (after much trial and error).

What we wanna do is basically query an Ingres database through a CentOS based LAMP server (which runs WHM/CPanel too). So we need to install (unfortunately) the Ingres Community Database (as the PECL Ingres package seems to require it to be installed) and of course we need to install PHP's package for Ingres (PECL Ingres) so we can query an Ingres database from PHP. Still with me?

Let's get started...

1. Install Ingres and PHP/Ingres support on CentOS:

Install Ingres DB Community Edition first as it's obviously required by PECL's Ingres package. Here we install the related RPM for a 32-bit CentOS machine. The process is the same for 64-bit, the file is just different. Sign up on for a free account and go to to download the right release. is passing the download link from some script, so if you wanna pinpoint the URL and not download the file to your PC, then upload onto your server, you can simply right-click on the download manager in Firefox and copy the "link location". This will give you the URL where the actual file of the Ingres db relies on the site, so you can use "wget". In this case, the path I got was something like "". Don't try this link in particular as it may not work when you read this...

You obviously need root access to the server:

# cd /usr/src
# wget
# tar -zxvf ingres-10.0.0-119-NPTL-gpl-pc-linux-i386.tgz
# cd ingres-10.0.0-119-NPTL-gpl-pc-linux-i386
# sh

This process will install Ingres in /opt/Ingres/IngresII/

2. Install the PECL Ingres package for PHP.

Using "pecl install ingres" will simply NOT work. So we do it the old-fashioned way. Grab the latest package here: and then do the following:

# cd /usr/src
# wget
# tar -zxvf ingres-2.2.2.tgz
# cd ingres-2.2.2
# phpize
# ./configure --with-ingres=/opt/Ingres/IngresII
# make
# make install

This process will install the PECL Ingres package for PHP.

We need a couple more things, before we get started.

We need to declare some system variables in Apache. If you use WHM/CPanel, go to Main >> Service Configuration >> Apache Configuration >> Include Editor and choose to edit the "Pre Main Include" file. Add the following 2 lines:

SetEnv II_SYSTEM /opt/Ingres/IngresII
SetEnv LD_LIBRARY_PATH /opt/Ingres/IngresII/ingres/lib

If you don't use Cpanel, just paste these lines into your httpd.conf file.

Now locate the WHM/CPanel php.ini file at /usr/local/lib/php.ini (if you don't use WHM/Cpanel it's probably located in /usr/lib/php.ini). Find the line "; Directory in which the loadable extensions (modules) reside." and right after that add:

extension = ""

This will make sure the related PHP extension for Ingres support is loaded by PHP.

That's it.

Go to your "public_html" folder (or any other folder) and test if you got Ingres support for PHP installed properly. We'll use a dummy connection file, so get the code below:

$link = ingres_connect("database", "user", "password")  or die("Could not connect: " . ingres_error($link));
echo "Connected successfully";

…and save this as "ingres.php". Now visit this file from your browser and if you get a "Warning: ingres_connect()..." then it means Ingress support for PHP is installed properly!


01 03 2010

Google AJAX Libraries API

Here's an easy trick to replace the built-in Mootools library that comes in Joomla 1.5 with a compressed copy from Google AJAX Libraries API:

<!-- The following code goes into your template's index.php <head> tags, right before the <jdoc:include type="head" /> code block --><?php// Replace Mootools in Joomla with a compressed copy from Google AJAX Libraries API$document =&JFactory::getDocument();unset($document->_scripts[$this->baseurl . '/media/system/js/mootools.js']);?><script type="text/javascript" src=""></script><script type="text/javascript">google.load("mootools", "1.1.2");</script>

There are 2 speed benefits by following this approach:

  1. We load a compressed copy of Mootools, so from around 73kb it drops to 18kb!
  2. We load Mootools from Google, thus our browser can simultaneously (in parallel) download Mootools along with the rest of our site's content.

It's a simple & easy trick we use on all our web projects, big or small. ;)

17 12 2009
  1. Establish naming conventions. Do not assume you'll always be the one coding for a particular site. Never use generic names for classes, IDs and form names in your code like “comment” or “article”. Someone else may do so too, so you can kiss your app’s functionality bye-bye!
  2. Avoid inline CSS like the plague.
  3. Try to squeeze as much CSS code as possible into one file. Less CSS files means faster loading of your site's design on the browser.
  4. Avoid placing UI images inside your HTML code. UI images belong to given UI templates (home, category lists, product catalog, article etc.) and therefore are loaded on every page request. Placing such images as "background images" in your CSS file allows the browser to cache them the first time it renders them, which means your site will load faster on subsequent requests for your visitors.
  5. Avoid inline JavaScript. Use CSS IDs or classes to attache JavaScript behaviour where necessary.
  6. Try to squeeze as much JavaScript code as possible into one file
  7. Don’t execute JavaScript code when not needed! E.g. if you apply behaviour to a certain block of code and this block of code does not exist on all your pages, make sure you check if this block of code exists by using a simple check for the block's container ID or class. You can do that pretty easily with jQuery or Mootools these days.
  8. Avoid inline CSS inside your JavaScript code. Stick to classes and IDs. Don’t inject too much HTML markup if possible. Try to alter the behaviour of your app by adding/removing CSS classes/IDs. Avoid hardcoded language strings inside JS code if you plan to make your site multilingual in the near future.
  9. If you code on PHP, check out the Tidy library. Enable it when you can as it will easily point out (and fix) bad markup in your HTML.
  10. For God’s sake use an open source CMS, don’t re-invent the wheel, make it possible to contribute back. Joomla, Drupal, Wordpress are enterprise class CMSs to get started with and some of the most popular websites in the world are powered by these open source CMSs.
09 12 2009

I was recently looking for a clean solution to prevent the display of module positions on - the 2nd most high traffic Joomla website, after

The first thing that came to mind was the htaccess trick I had spotted on the Joomla forums here:

Thing is, this rule does not work if you have SEF on and you’re in some inside page.

So I just wrote a simple solution which is PHP based and you can include right at the top of your Joomla template for ease of maintenance (template designers can use this too as an XML option ;) )…

Make sure the following code goes at the very top of your template's index.php file, but within <?php and ?> tags:

// Properly prevent ?tp=1 module position exposure on Joomla sites using PHP only$currentURL = explode('?',substr(JURI::base(),0,-1).$_SERVER['REQUEST_URI']);if($_GET['tp']) header('Location: '.$currentURL[0]);

Check it out here

UPDATE: There seems to be a Joomla API solution for that. Thanks to Cory Webb for letting me know. Both solution follow...

05 10 2012
You should carefully read the following License & Terms of Service.

GNU/GPL License

The software distributed by JoomlaWorks Ltd. (the "products") consists of components, modules and plugins for the Joomla application framework (also identified as "Joomla extensions" as a whole).

The products are free software; you can redistribute a product and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. All existing copyrights must be prominently visible on all modified versions of this software.

The products are distributed in the hope that they will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Please read the complete GNU General Public License for more details.

Proprietary License (For Products Available Under Subscription)

The templates (also referred to as themes, layouts or skins across all JoomlaWorks sites) included in all products available under a subscription are distributed under a proprietary license and are not covered by the GNU/GPL license. You are authorized to make any necessary modification(s) to the products' templates to fit your purposes. You may not however redistribute or release any modifications as GPL or otherwise. You must also not change or remove the copyright information in the HTML, CSS and JavaScript files. Please contact us if you have any requirements that are not covered by these terms.

Terms of Service (For Products Available Under Subscription)

Our website provides a download service for the products in accordance with the licenses listed above and the following Terms Of Service issued by our company, JoomlaWorks Ltd.:

  1. Unlimited product usage granted: Your membership grants you the rights to download the products as often as desired within your subscription period and use in as many domains and/or websites as you wish. For example, a 12 month membership entitles you to download the products an unlimited number of times within 12 months. If you renew your subscription, you are entitled to download the products to the extent of your subscription period. Even after your membership expires, you may continue to use the products. Thus, the products are not time-limited.
  2. Product modifications: You are authorized to make any necessary modification(s) to the products to fit your purposes. Redistribution of the product or any modified version must always be done in accordance with the GNU/GPL license. In this case, you must also not change or remove the copyright information in the header of the XML descriptor file or in PHP files.
  3. Template modifications: You are authorized to make any necessary modification(s) to the templates included in our products available under subscription to fit your purposes. It is strictly prohibited however to redistribute or release any modifications that apply to HTML, CSS or JavaScript files as GPL or otherwise, for the sake of porting/forking these templates to any platforms and/or content management systems. You must also not change or remove the copyright information in the HTML, CSS and JavaScript files.
  4. Unauthorized Use: Although the number of downloads are not limited, subscriptions can not be shared (see below, 'Assignability'). Sharing or other methods which allow for multiple, simultaneous downloads (and thereby affect the performance of this web site) are strictly forbidden and may result in termination of your subscription.
  5. Updates: All of the products are designed for the latest stable (LTS/Long Term Support) version of Joomla unless stated otherwise, but we can give no guarantee, that the products will run with future versions of Joomla. Subscribers may use our Ticket Support System to address any issues related to software versions.
  6. Delivery: All subscriptions will be immediately activated after we have succesfully received your payment. Once a purchase is complete, the activation email will be sent to the email address specified during checkout. 
  7. Assignability: You may not sub-license, assign, or transfer your subscription to anyone else without prior written consent from JoomlaWorks Ltd.
  8. Ownership: You may not claim intellectual or exclusive ownership to any of the products, modified or unmodified. All products are property of JoomlaWorks Ltd. The products are provided “as is” without warranty of any kind, either expressed or implied. In no event shall our juridical person be liable for any damages including, but not limited to, direct, indirect, special, incidental or consequential damages or other losses arising out of the use of or inability to use the products.
  9. Return/Refund Policy: Since our company is offering non-tangible irrevocable goods we do not issue refunds after a subscription is purchased, which you are responsible for understanding upon purchasing. Please make sure that you have carefully read all relevant documentation and tried out the demos.
  10. Warranty: JoomlaWorks does not warranty or guarantee these products in any manner. We cannot guarantee they will function with all 3rd party extensions or templates as there is currently no certification process for such extensions or templates. All JoomlaWorks products are tested to work on all major browsers like Mozilla Firefox, Microsoft Internet Explorer (version 7 and newer), Google Chrome, Opera, Apple Safari (version 3 and newer).
  11. Support: JoomlaWorks offers commercial extensions "as is", with no implied meaning that they will function exactly as you wish or with all 3rd party extensions. Further, we offer no technical support via email or otherwise for installation, customization, administration of Joomla. All support questions should be directed to our Ticket Support System which can be used by all active subscribers. There is also the official customer-to-customer Community Support Forum, available to everyone seeking for help past our working hours. JoomlaWorks may monitor the forum, providing additional assistance and guidance.

Copyrighted Material

All of the content on this web site is protected from re-use and publication by our existing copyrights. Violating these rights by reproducing the copy in print or online is a violation of these terms and will result in account suspension.
26 07 2012

Disqus Comments (for Joomla) integrates the Disqus comments system & service into any Joomla based website. Disqus (pronounced 'discuss') is a service and tool for web comments and discussions - currently the most popular comments-as-a-service provider worldwide. It makes commenting easier and more interactive, while connecting websites and commenters across a thriving discussion community.

12 07 2012

simpleimagegallerypro_300x88_24.pngNEW VERSION 3.8 released in June 2020!

Adding image galleries inside your Joomla articles has never been easier!

Using the "Simple Image Gallery PRO" extension from JoomlaWorks you can quickly display a folder of images on your server as a stylish image gallery within any Joomla article, K2 item, Virtuemart or HikaShop product and any other Joomla extension that loads the Joomla WYSIWYG editor (TinyMCE, JCE, JCK Editor etc.).

The process is dead simple. You just click the "Simple Image Gallery PRO" editor plugin button located under any WYSIWYG editor box, anywhere in Joomla and you can easily select an image folder to present as an image gallery on your site. Don't have images uploaded yet? You can just drag and drop images in the extension's built-in uploader and batch upload images, one by one, without overloading your server or requiring high memory limits from PHP. Then add captions using the intuitive interface, save and simply select to add inside your Joomla content.

The "Simple Image Gallery PRO" editor plugin will insert a Joomla plugin snippet for every image gallery (something like { gallery}mygallery:200:140:0:2{/gallery} inside the editor content) and then this snippet will "automagically" present as an image gallery, in a stylish thumbnail grid (or slideshow) with "lightbox" popups to showcase the original images, when users click on the thumbnails!

"Simple Image Gallery PRO" is the best Joomla gallery system because a) it's easy to use & manage, b) it allows you to embed image galleries right where your content is (and not redirect your visitors to some other "gallery" section!), c) it offers multiple layouts/templates to present your image gallery and d) it supports the best popup (lightbox/modal) engines to display the original images.

Check out the demo we prepared, showcasing multiple galleries with different layouts on the same page.

Now fully responsive & Joomla 1.5 - 3.x compatible!

Frontpage SlideShow
is the easiest & most eye-catching way to display your featured articles or products in your Joomla website.

12 07 2012

Adding RSS/Atom syndicated content inside your Joomla website is now super-easy and simple with the 'Simple RSS Feed Reader' module from JoomlaWorks. All you have to do is add a few feeds to the module parameters, publish the module in some position and that's it!

12 07 2012

Adding image galleries inside your Joomla articles is now super-easy and simple, using the magical "Simple Image Gallery" plugin for Joomla.

The plugin can turn any folder of images located inside your Joomla website into a grid-style image gallery with cool lightbox previews. And all that using a simple plugin tag like {gallery}myphotos{/gallery}.