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'),
);
?>
t('Date From'),
'#type' => 'date_popup',
'#date_format' => $format,
'#description' => t('Please select a date'),
);
?>
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.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.
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'; ?>
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.)
Lately I was assigned with the task to display all terms assigned to a node, grouped by their parent. To better explain this, let's say for example that we have the Vocabulary 1 assigned to Content Type A, with the following terms:
Parent 1
-- term 1
-- term 2
-- term 3
Parent 2
-- term 4
-- term 5
Parent 3
-- term 6
-- term 7
etc.
If we need to display a block in user pages, and not in /user/login or /user/register etc pages, we need to field in some custom php code under the Page specific visibility settings, we select the radio "Show if the following PHP code returns TRUE (PHP-mode, experts only)" and we fill in the following code: