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
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’])) [...]
Upload multiple files using HTML 5 and PHP
Posted by khumlo Freddie in HTML, PHP on 28. Sep, 2011 | 0 Comments
This application of uploading multiple files will work only on new versions of Firefox, Safari and Chrome. IE stills continues to be developer’s nightmare in this powerful feature too. Until the arrival of HTML 5, we had to upload only one file at a time but now we can upload multiple files at one go. [...]
Start wampserver whenever system starts
Posted by khumlo Freddie in apache, OS on 27. Sep, 2011 | 0 Comments
Every time I turn on my system and logged into it, I had to follow the tradition of finding my wampmanager.exe file and run it so that I can fire http://localhost on internet browsers. But now I am following new norm, thanks to scheduler. However, how to start wampserver each time while booting the computer [...]
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 prevent directory listing using .htaccess
Posted by khumlo Freddie in apache on 26. Aug, 2011 | 0 Comments
Most cases you find websites with images folder somewhere at the root folder. So, when a user type www.example.com/images they end up with the lists of images under your images folder. Similarly, your server scripts are also exposed easily to everyone. It’s not cool to show off because malicious users can easily harm your application [...]
How to allow your website to be set as homepage
Posted by khumlo Freddie in browser, HTML on 22. Aug, 2011 | 0 Comments
You may have come across websites which when you opened it, asked you whether you want that page or website to be set as a default homepage for your current browser such that whenever you reopen the same browser, a new tab will be initialized and your website will be called. To set your website [...]




