Monday, June 20, 2011

Install privatemsg for social network

  1. theme for received message (locao.css), copy background image
  2. Import Translation
  3. Translate notification mail by translation interface
  4. Setting access control

Replace core filter to htmlpurifier


  1. Install library from htmlpurifier.org
  2. Allowing Youtube and external resources
  3. Setting embeded media (x and y pixels of vedio)

Tuesday, June 14, 2011

Reference a CCK field from a different content type



Ref: http://drupal.org/node/290443 (mainly Drupal 5.x)
       http://drupal.org/node/298951 for drupal 6.x (with computed field)

Monday, June 13, 2011

Tunnng the performance of drupal

1)http://pressflow.org/


David Strauss on on 2009-12-14
Pressflow is a 100% api-compliant replacement for your standard Drupal Core. There are no database schema changes. So long as you are running a normal Drupal core and meet the other system requirements (PHP5.x, MySQL 5.x), Pressflow is a "drop in" replacement.


2) http://2bits.com/

2bits.com, Inc. is a privately owned Canada federal corporation based in Waterloo, Ontario, Canada.

Sunday, June 12, 2011

Create content continue to have the type after delete the type

Ref: http://drupal.org/node/718348

Just go to menu to delete disable the link (for example Story, after delete Story type)
Create content continue to have the type after delete the type

Ref: http://drupal.org/node/718348

Just go to menu to delete disable the link (for example Story, after delete Story type)
facebook registration disable


Remove the facebook part in the registering part by disable facebook contribute module fb.registeration.
Field Datetime Time zone setting
Ref: http://drupal.org/node/767182

  1. Site's time zone - When entering data into the field, the data entered is assumed to be in the site's time zone. When the data is saved to the database, it is converted to UTC. When retrieved from the database, the data is converted to the Site's time zone for annonymous users or the User's time zone for logged in users when User-configurable time zones is enabled.
  2. Date's time zone - With this option enabled, the date field adds a select box to explicitly specify the time zone for the date entered. When the date is saved to the database, it is not converted & the time zone information is saved with the date. When retrieved from the database, no conversion is performed and the date is displayed exactly as entered.
  3. User's time zone - When entering data into the field, the data entered is assumed to be in the user's time zone. When the data is saved to the database, it is converted to UTC. When retrieved from the database, the data is converted to the Site's time zone for annonymous users or the User's time zone for logged in users when User-configurable time zones is enabled.
  4. UTC - When entering data into the field, the data entered is assumed to be in UTC time zone. When the data is saved to the database, it is converted to UTC (e.g. no conversion necessary). When retrieved from the database, the data is converted to the Site's time zone for annonymous users or the User's time zone for logged in users when User-configurable time zones is enabled.
  5. No time zone conversion - The date entered is not converted when saved to the database. When retrieved from the database, the data is NOT converted and is displayed exactly as entered.

Saturday, June 11, 2011

Access control of Views

It is possible that view will show the data that is not allowed to see by setting of permission.

Using PHP validation to the argument is very normal.

The php is look like the following:


global $user;
return arg(1) == $user->uid || user_access('access user profiles');

?>

Note:
users/2/edit
arg() is system-level item (not just views), and with the following values
arg(0) = 'users'
arg(1) = '2'
arg(2) = 'edit'





global  $user;
return db_result(db_query("SELECT GROUP_CONCAT(CAST(an.nid AS CHAR) SEPARATOR ',') FROM {acl_user} au INNER JOIN {acl_node} an ON au.acl_id = an.acl_id WHERE an.grant_view = 1 AND au.uid = %d", $user->uid));


?>


** Also refer to Views to display nodes based on ACL permission.
Create like button with Facebook for Drupal module

you need to enable fb.example module

Ref: http://drupal.org/node/977076