-
OpenCart: display stock levels in storefront, as numbers or colour icons
As I mentioned here, a military, police and adventure gear store has hired me to set up their online presence and an e-commerce platform for them (not 100% ready yet, but soon!). I had a tough time finding the adequate solution for their needs, because even though OsCommerce is the typical script used by similar stores in the country, I agree with critics regarding its security issues, complex code architecture and too long delays when releasing updates. So I tested other scripts (Zen Cart, Magento, Prestashop, etc.) but definetly, the one which gave me the best overall impression is OpenCart: fast, simple yet powerful and highly customizable, and above all, very well rated by its reviewers. So that was my choice for the project.Two weeks ago, I had no idea OpenCart existed; but today I am pleased to post my first humble contribution as new OpenCart’er: a tutorial on how to customise storefront appearance!
-
Hide modules from registered users in Joomla 1.5
While Joomla 1.5 allows hiding modules from guests (and just show them to registered users), it lacks the ability to do the opposite, namely hiding modules from registered users. Of course such thing can be very useful when there are modules inviting users to register (how pointless to show them to already registered users!), or modules showing advertisements to guests.As said, the backend does not allow you to set a module to show to guests only, but this can be very easily done in a couple of minutes and minimal effort with a simple hack to the template code. NO need to install plugins or add-ons! It is a simple yet very useful trick.
-
Requiring JavaScript to be enabled
There are many JavaScript scripts in this blog, and those related with AJAX also involve the use of this language. So I thought that it would be useful to know, when implementing such scripts in a site, how to deal with users who do not have JavaScript enabled in their browsers (or rather requiring them to enable it). -
AJAX add content to favourites script
It has been a while since I last wrote a post but, as I said, I’d be back again! Not that I have much free time, but I’ll keep posting stuff whenever I’m inspired and have the time to do so
Today’s post is a response to deepali’s comment here. There are lots of ways to achieve the result, and this is just my approach to the issue. The following script allows users to favourite/unfavourite posts, pictures, etc. with AJAX, PHP and MySQL, without reloading the whole page. A clear example of that is Youtube.com, where users can add videos to their favourites with just one mouse click and without reloading the whole content of the page.
-
Two methods for generating random strings and passwords
Many websites and boards, upon registration, send the new users an e-mail with their user name and a random password. This is just one of the many purposes for which generating a random string or password is useful.Ever wondered how this is done? Actually, with PHP, it’s very easy. I will explain you two ways of doing so, and provide the necessary code for you to have the script up and running immediately; you may use the one which suits your needs most. Of course, those are not the only ways to achieve the same goal, but are very effective and in the same time, easy to understand. Note that in this post, the random string will be used as password.
-
Performing MySQL queries with the help of AJAX
Back to AJAX! This tutorial is a reply to a question posted in Experts Exchange, and therefore it has a very specific scope. However, taking into consideration it may prove to be useful to many, I decide to share it with you all.What this tutorial explains is how to perform asynchronously MySQL actions with AJAX, using GET variables and an external PHP page. It may sound super-complex, but it is not. As usual, I provide the full code of the script and a working demo which you can see here.
-
Getting syntax highlighting plugins to work correctly with certain WordPress themes
Happy April 1st! Note however that this is serious content; in my country we celebrate fools day the 28th December instead


If you’re running a WordPress blog, some themes – including the one used in this blog, which is Gear theme – might give you headaches when using syntax highlighting plugins (namely, plugins for showing source code in a well-organized and nicely formatted way). The problem? The code displayed is completely messed up. As far as I know, this happens with different plugins, and all of them are based on Alex Gorbatchev’s syntax highlighter. Read the rest of this entry »
-
Saving multiple selections from drop down list to database
This post will teach you how to process and store multiple selections from a form element into a MySQL database, using PHP. In order to understand how it works, you will need basic knowledge of PHP arrays, because they’re necessary for achieving the results.If you still don’t know what arrays are and how do they work, read Tizag’s array tutorial first.
-
Custom data in EventList frontend event submission form
This is (a quickly written and) the last planned post of the EventList 1.0RC Component for Joomla 1.5 customization series, and in response to Junkah’s request. It explains how to add custom fields in the event submission form; the example below is a text field where the number of available places can be specified. The example only covers the process of saving the submitted number in the database, so that it can be kept for future reference. If you wish to prevent further registration of guests once the number has been reached, then you will have to write some extra code for that purpose, but as I said this is beyond the scope of this post.My apologies for not having all the free time I’d like to, for adding new contents more often and for writing with more details. Back to university, it’s all about priorities. It will be like this for some months, but I will do my best to keep up the knowledge sharing!
-
Checking availability of user name with AJAX

Lately I’ve been writing quite much about AJAX, but it is so useful that I’m sure it is of everyone’s interest!
In this post I will show you – as the post title says – an example script of AJAXed registration form, without recurring to AJAX frameworks (there are already many tutorials about this topic in relation with them). The example omits the synchronous part of the registration and focuses on the user name, which we want to asynchronously check. It doesn’t sound so weird if I say it in other words: check on the fly if the user name the person is typing already exists in the database or not, and take actions depending on whether it does or not (for instance, only allow form submission if name is available).
This is the basis for other types of effects like for instance searching contents and dynamically returning result suggestions, or checking if a specific word exists in the database, etc. but as I mentioned, here the intention is to use it on a registration form.


