Posts Tagged ‘drupal’

How to disable comments in Drupal

Very often Drupal (especially outdated versions) has problems with Spam bots which flood its comment modules.

The first thing to do in this case is to disable the comments modules until you clean all the Spam posts.

This can be done in two ways:

If you have admin access to Drupal log in and go to  Administer – Content – Content Types. Then edit the content type of your choice and make sure comments are set to off by default.

Alternatively the above can be done directly by executing the following query in your database:

UPDATE system SET status = ’0′ WHERE filename =  ‘modules/comment/comment.module’;

When you decide to re-enable the module simply issue the reverse query:

UPDATE system SET status = ’1′ WHERE filename =  ‘modules/comment/comment.module’;

A good choice for fighting spam bots is using a captcha module in combination with Akismet. This way you ensure that even if a bot passes your captcha module, Akismet will check the post against a huge spam database. Only after that the post will appear.


How to display FeedBurner feeds on your website?

FeedBurner provides you with a lot of useful statistics about the usage of your feeds.

Using FeedBurner is simple and free. In order to use FeedBurner, you should go to the official website and register for the FeedBurner service.

Follow the detailed instructions to set up your FeedBurner account.

All you have to do then is set your application to display the links to your feeds through the FeedBurner server. Your feeds’ URLs should look like:

http://feeds2.feedburner.com/something

There are FeedBurner extensions available for the most popular CMS applications:

  • If you want to set up WordPress to display its feeds with FeedBurner, you can use the FeedBurner FeedSmith plugin or a similar extension.
  • If your website is created with Joomla, you can choose one of the many available modules and components that allow you to use FeedBurner. For more information and download links, check the official Joomla extensions directory.
  • In case you use Drupal, you can use the FeedBurner module to display your feeds with FeedBurner.

How to enable RSS in Drupal?

  • Step 1. Log in as administrator and go to Administer > Site Building > Modules.
  • Step 2. Check the Enabled box for the Aggregator module and click Save Configuration.
  • Step 3. Go to Administer > Content management > Feed aggregator.
  • Step 4. Click Add feed and type the feed’s title and URL.
  • Step 5. Click Save to publish your new RSS feed.
  • Step 6. Run the Drupal cron in order to update your feed.

How to enable caching in Drupal?

In order to enable caching in Drupal, log in as administrator and go to Site Configuration > Performance.

Under Caching mode: select Normal (recommended for production sites, no side effects).

Under Block cache: select Enabled (recommended).

Click Save configuration to save the changes.

How can I see the exact version of my Drupal?

The version of your Drupal can be seen from the Drupal admin area > Administer > Reports > Status report.

The version of your Drupal can also be seen in the CHANGELOG.txt file located in your Drupal folder.

How to optimize my Drupal database?

There are two easy ways to optimize the tables in your Drupal database.

The easiest way is to install the DB Maintenance module.

After the module is installed and activated, you can access it from your Drupal admin area >  Administer > Site configuration > DB maintenance. Select the tables which you wish to optimize and click Optimize now.

The other, slightly more complicated way, is to create a php script with the sql query. The code you should include in the php file should be similar to this:

<?php
$db = mysql_connect(‘localhost’,’user‘,’password‘);
if(!$db) echo “cannot connect to the database”;
mysql_select_db(‘user_drpl1‘);
$result=mysql_query(‘OPTIMIZE TABLE accesslog,cache,comments,node,users,watchdog;’);
echo mysql_error();
?>

Change userpassword and user_drpl1 to reflect your Drupal MySQL username, password and database.

This will optimize the tables accesslog, cache, comments, node, users and watchdog. Feel free to add or remove tables from the query.

Once you have inserted the code, save the file. For the purposes of this example, we’ll assume that the file is called optimize.php. Once the file is saved in your Drupal folder, you can execute it directly from a browser:

http://www.yourdomain.com/drupal/optimize.php

If you get a blank page without any errors, this means that the tables have been successfully optimized :)

How to configure Drupal to use the server URL instead of my domain name?

If you cannot log into your Drupal application using your server domain, you should change the following line in the sites/default/settings.php file:

$cookie_domain = ‘yourdomain.com’;

to

$cookie_domain = $_SERVER['HTTP_HOST'];

This way Drupal will send the proper cookie information, matching the domain name you have used to access it.

How to enable the Drupal clean/SEF URLs?

How to reset my Drupal admin password?

To change the administrative password for your current Drupal installation you should:

1. Go to your  phpMyAdmin;
2. Select the database which Drupal use from the drop-down menu on the left.
4. Click on the SQL tab.
5. In the text field on the page type the following text:

update users set pass=md5(‘NEWPASS‘) where uid = 1;

where “NEWPASS” is your new administrative password. Then click on the GO button and if no errors present, the Drupal password should have been changed.

What is Drupal?

Drupal is a free software package that allows an individual or a community of users to easily publish, manage and organize a wide variety of content on a website. Tens of thousands of people and organizations are using Drupal to power scores of different web sites.