My requirement was to detect the mobile devices from the drupal backend and redirect the user to the assigned URL. For this we needed to identify whether the user was accessing the site from a mobile device. For this we had to check the user agent string and compare that with the most common mobile devices. Then depending upon the condition we redirect the user to the corresponding URL.
I had a requirement where I had to execute shell command from PHP. The requirement was that I had to find details of a domain using commands like whois and then store this information into files in a folder. The only input parameter for the process was the name of the domain which was passed on from the Drupal site. The PHP function (shell_exec) was designed to do things like this.
One of our Drupal clients who had been using the Drupal Ubercart module had requested us to change the status of the order after a user completes the Ubercart checkout completion process. If you are facing the same situation with Ubercart in your Drupal site and would like to know how to change the order status programmatically then read on to find out the solution.
In one of my recent Drupal projects I needed to add some extra classes to the body tag. Usually classes are added to the body tag in one of our template file namely html.tpl.php. The classes can be added via an implementation of hook_preprocess_html. Now let's see how it can be done.
One of the errors we come across in a Drupal 6 installation is "htmlspecialchars() expects parameter 1 to be string, array given in /includes/bootstrap.inc on line 860". This is an issue with the Internationalization and Taxonomy translation modules. This issue can be fixed by adding a line in the bootstrap.inc file. If you want to know how to solve the warning, continue reading.
As a Drupal developer you might have come across a Drupal multisite installation in which the different sites were connected through symlinks. As a developer you often need to create a local installation of a live Drupal project to make the required changes before pushing it to the live version of a site. If you are facing the same situation in your Drupal site and would like to know how to create a local installation of a Drupal multisite project connected through symlinks then continue reading to know more.
Drupal provides a number of contributed modules to filter the text in comments. One of the most notable examples of such a module is Mollom which can be used to filter out spam comments from genuine ones in a Drupal site. However if we need an extra level of control over the filtering options, we need to write a custom module. Read on to know how to filter the text n the comments in a Drupal website
Have you ever encountered a situation where you have to find a specific pattern in a string and had to replace it with a new pattern in PHP. You will often encounter such situations during web development or any type of programming. Read on to know how to find a specific pattern in a string and replace it with a new pattern using PHP.
APC or Alternative PHP Cache (APC) is a free and open opcode cache for PHP. APC allows for caching of opcode generated during PHP script parsing and execution by the Zend engine. If you are using APC 3.1.9 and you are using the default configuration you might run into the error where most PHP requests will return a warning message "PHP Warning: Unknown: Unable to allocate memory for pool. in Unknown on line 0"