Tel: 91-98574-11333 | Mail: inderweb.com@gmail.com


March 2010

Custom sort By ON Fields Mysql

We can use field_functions from mysql for custom sort or Can use CASE, IF,ELSE functionalities in mysql.
i.e:
ORDER BY CASE
WHEN `col` = 'item' THEN 1
WHEN `col` = 'thing' THEN 2
WHEN `col` = 'stuff' THEN 3
WHEN `col` = 'boom' THEN 4
ELSE 5
END

Example:-
1)
SELECT link_path,mlid FROM `rts1_menu_links` order by CASE WHEN link_path="photos/upload" THEN 1 ELSE 5 END,link_path DESC
2)select id from products where id in (4,5,6,7,8,9) order by field(id,4,7,6,5,9,8)

SELECT id, start_date FROM iddt WHERE id IN
('109k7','s3x6','sxmns','wt57')

Drupal theme module customizations links and tutorials guide

We have a very wide community of Drupal6 users,contributors and still growing.Here are few quick drupal links for intermidiate,begineeres,and also for advanced drupal coders.

http://drupal.org/getting-started

Template Variables with preprocessor functions and customizations

In Drupal 6 the variable creation logic lives in the /includes/theme.inc file.
The functions of note, located at the bottom of the file, are:

* template_preprocess
* template_preprocess_page
* template_preprocess_node
* template_preprocess_block

These preprocessor functions can be used for altering variables in their areas.
By browsing the function definitions you'll see how the variables are created.

Common method of adding and extracting modules and themes to your drupal installation

Place your custom or downloaded theme folders at:-

sites/{sitename}/themes/{themename} folder
e.g download acquia_marina theme from http://drupal.org/project/acquia_marina and place it at:-
/sites/all/themes/acquia_marina
configure it from
After placing module folder in your modules directory you can see and configure it from
http://localhost/admin/build/themes
you can check new module and enable it from this above admin link.

More Info:-
http://drupal.org/node/120641

Downloading and extracting themes using shell or putty in linux

You can directly download themes from your ssh or putty.

1) Go to themes directory of your drupal installation. E.g:-
cd sites/all/themes

2). Download archive using wget command:
wget http://ftp.drupal.org/files/projects/acquia_marina-6.x-2.0.tar.gz

3). Uncompress archive:
tar zxvf acquia_marina-6.x-2.0.tar.gz

4). Delete/Remove archive:
rm -rf acquia_marina-6.x-2.0.tar.gz
5)Confirm your theme is there:-
ls -a
Also check and enable it from:- admin/build/themes

Enabling / downloading modules and themes using shell or putty in linux

You can directly download module or theme from your ssh or putty.

1) Go to modules directory of your drupal installation. E.g:-
cd sites/all/modules

2). Download archive using wget command:
wget http://ftp.drupal.org/files/projects/image-6.x-1.0-beta5.tar.gz

3). Uncompress archive:
tar zxvf image-6.x-1.0-beta5.tar.gz

4). Delete/Remove archive:
rm -rf image-6.x-1.0-beta5.tar.gz
5)Confirm your module is there:-
ls -a

Note: the module image-6.x-1.0-beta5.tar.gz is taken here as example please check the current

How to Add Modules To Drupal installations

Adding Modules To Drupal installations:-
Extract the code to to your
/sites/{sitename}/modules/{modulename}
or at your localhost at:
/sites/all/modules/{modulename}

e.g download Image module from http://drupal.org/project/image and place it in modules folder
/sites/all/modules/image

After placing module folder in your modules directory you can see and configure it from
http://localhost/admin/build/modules

you can check new module and enable it from this above admin link.
More Info:-
http://drupal.org/node/120641

Module List for Drupal 6:-

very good module.

20th elkwood