Sunday, June 29, 2008

Enabling book menu

You can provide your users a menu that helps them find their way around inside your books. You do this by enabling the book navigation block on the blocks page (administer >> blocks). (Users will see the menu only when viewing the book.).

Refer to Book: structured document publishing.

Thursday, June 26, 2008

Chinese in the subject of E-mail == Cannot sent

Some system has problem if with E-mail subject is in Chinese. For example, I installed Drupal in a hosting server in the USA. When I put Chinese in the subject in the email, the system cannot send the email.

I got the message as following:

Drupal have following warrning:

warning: mail() [function.mail]: Bad parameters to mail() function, mail not sent. in /home/content/h/o/s/hosais/html/includes/mail.inc on line 197.

Solution (Using UTF-8, base64)

I solved the problem by changing the /includes/mail.inc by adding the following code. The idea is change the subject as

$subject = “=?UTF-8?B?” . base64_encode($subject) . “?=”;

Source code

mail.inc, Line 186:

return mail(
      $message['to'],
      //mime_header_encode($message['subject']),   <== marked this
      //“=?UTF-8?B?” . base64_encode($subject) . “?=”;
      mime_header_encode("=?UTF-8?B?".base64_encode($message['subject'])."?="),      //<== added this line
      // Note: e-mail uses CRLF for line-endings, but PHP's API requires LF.
      // They will appear correctly in the actual e-mail that is sent.
      str_replace("\r", '', $message['body']),
      // For headers, PHP's API suggests that we use CRLF normally,
      // but some MTAs incorrecly replace LF with CRLF. See #234403.
      join("\n", $mimeheaders)

...

Settings of the system message for user registration

The system message, registration notice email, for example, can be set at Administrator->User management->User settings.

Sunday, June 15, 2008

Add footer at Site Information

You could add a footer at Site Information.

Saturday, June 14, 2008

Reason why .htaccess should be avoided

1) performance: web server has to read every time user requests and every .htaccess files in different directories.

2) security: the configuration is based on the .htaccess files and it may not be controlled. Basically, when you enable .thaccess, you are giving the user (the owner of the directory) this privilege to the configurations.

Refer to Apache's Web site.

Friday, June 13, 2008

Wildcard domain

Check the concept for the wildcard domain.

Wildcard domain is needed for the domain access fuctionality in Durpal.

 

Wildcard domain on godaddy:

You can create as many A records that you wish but you will only be able to create 1 wildcard.
To Add an A record for your domain:
1. Select Manage Domains from the My Products menu.
2. Click on the domain for which you wish to change.
3. Click Total DNS Control and MX Records.
4. Under the A (Host) section, click the add new a record button.
5. Enter the new IP address into the Points To Ip Address: field and the new A record in the Host field.
6. Click OK.

Monday, June 09, 2008

Initial php at godaddy

 

You may need to install the php.ini at godaddy.