Disable Drupal module from database

Posted by khumlo Freddie in Drupal on 29. Nov, 2011 | 0 Comments

To disable Drupal 6 module from database, open PHPMyAdmin or mysql console and select your database, then run the query written below. UPDATE system SET STATUS = 0 WHERE name = ‘module_name’ LIMIT 1; Note: Under module_name, enter name of the module of which you want to disable. Bookmark on Delicious Digg this post Recommend [...]

Disallow anonymous users to run cron

Posted by khumlo Freddie in Drupal, PHP on 28. Nov, 2011 | 1 Comment

For one reason or the other, sometimes we may require to limit drupal’s cron access only to authenticated users or admin user. Let me present two ways of doing it. Choice is yours depending upon your requirement. First, hacking of cron.php file. Second, using .htaccess and allow only administrator to run cron using “run cron” [...]

How to set global variable in Drupal module

Posted by khumlo Freddie in Drupal, PHP on 11. Nov, 2011 | 0 Comments

To create a global variable which will be available throughout the module, you need to declare a global variable outside a function as usual but with one exception that you also need to have to assign a value to it. So, there is a slight change in implementing global variable in simple PHP application and [...]

Reset Drupal’s theme through using MySQL / Database

Reset Drupal’s theme through using MySQL / Database

Posted by khumlo Freddie in Drupal on 10. Nov, 2011 | 0 Comments

Ever fall into a situation where you have modified or switch a theme or mistakenly deleted(before disabling) the current theme only to find out that the theme display goes kaput or nothing is shown on the page. These will leave you with no UI to work on. Well at this point of time you may [...]

How to create seperate template tpl file for each drupal content type

Posted by khumlo Freddie in Drupal on 09. Nov, 2011 | 0 Comments

There is a generic template page called page.tpl.php but what if we want to create unique template for each content type? Add the below code into the template.php file inside your theme folder. /** * Override or insert PHPTemplate variables into the templates. */ function phptemplate_preprocess_page(&$vars) { // Add per content type pages if (isset($vars[’node’])) [...]

How to display blocks only for a specific content type

Posted by khumlo Freddie in Drupal on 08. Sep, 2011 | 0 Comments

To create a block which will only be displayed in case when user visits a specific content type, I am using an example of displaying a block throughout all blogs. You have one simple option to add blog/* at the listed pages but what if user access a blog content type through using node/1234, it [...]

How to create multi-site using Drupal

Posted by khumlo Freddie in Drupal on 04. Aug, 2011 | 0 Comments

In this post, I am going to write of how to run several multiple Drupal sites using a single codebase. Sometimes you may want to host multiple sites with almost same code and for each addition of site or domain name, you only need to create new database where user table is shared throughout. If [...]

Upgrade Drupal from previous versions

Posted by khumlo Freddie in Drupal on 18. Jul, 2011 | 0 Comments

Upgrading Drupal core from previous versions whether minor or major should be handled with utmost care. Upgrading Drupal within a major section such as using Drupal 6.1 and upgrading it to Drupal 6.3 and upgrading between major versions such as from Drupal 6.x to Drupal 7.x , the steps are almost the same with slight [...]

Upgrading contributed Drupal modules

Posted by khumlo Freddie in Drupal on 17. Jul, 2011 | 0 Comments

While upgrading Drupal between major versions, say from Drupal 6.x to Drupal 7.x, all contributed modules will not worked and it needs to be upgraded too. You can upgrade multiple modules at the same time but personally I will recommend one at a time to reduce any chance of errors and the ability to isolate [...]

How to enable or disable Drupal modules from database

Posted by khumlo Freddie in Drupal on 15. Jul, 2011 | 1 Comment

I know this title may surprise you and asked me “why the need?” as Drupal has already provided a good GUI where users can easily enable or disable module(s). But at worst case scenario, situations like this may arrived where you have enabled a module and it has somehow disturbed your whole website and making [...]