How to test cron in Centos
Test if cron is running
Type the following command:ps ax | grep cron
Make sure that cron shows up. Expected output should be something like
[konordo@konordoserv]# ps ax | grep cron
1185 pts/1 S+ 0:00 grep cron
1771 ? Ss 0:00 crond
Test if cron is working
Add the following entry to your crontab. To do so, enter the commandcrontab -e
How to use datepicker pop up in a form field in a custom module?
t('Date From'),
'#type' => 'date_popup',
'#date_format' => $format,
'#description' => t('Please select a date'),
);
?>
Drupal: How to add another recipient in personal user contact form
Reset drupal statistics - The Read counter
UPDATE `node_counter` set `totalcount` = 0;
And the day counters with:
UPDATE `node_counter` set `daycount` = 0;
Important: You should keep a backup of the database before performing any actions.
Another suggestion is to use the Statistics Advanced Settings module that comes with this setting.Drupal: Accordions in custom module - How to
Translate <Any> in Views Exposed Filter
While trying to translate the <Any> string in Views, locale returned the error "unsupported HTML".
A quick workaround is to switch from <Any> to -Any-; There is an option available under the Views Tools tab just for that.
The string "-Any-" is translatable, so from this point on it is easy to search for the string "-Any-" in locale search. If it is not found, you would probably need to check that you typed Any in the search form (case sensitive!).
Once found, it is easy to enter the required translation.
Custom submitted by in tpl files
Here is a line of code to override Drupal's submitted by elements in node.tpl.php file.
created, 'custom', "F d, Y"); print ' | ' . theme('username', $node); print ' | ' . $node->comment_count . ' Comments'; ?>
Draw circle overlay in all points in gmap from Radius in a CCK field | Dynamic gmap Macro in Views
preg_match date time validation
While developing a custom module, I needed to validate the following date time format:
1987-11-22T23:52:12
The following code was used to create a pattern for the preg_match and to test the results. (Can be used as is.)