Drupal 7: Add a custom link in admin menu
Here is some code to be used in a custom module in Drupal 7 in order to create a custom link in the admin menu.
<?php function MYMODULE_send_file($fid) {
$file = db_fetch_object(db_query("SELECT * FROM {files} WHERE fid = %d", $fid));
if ($file) {
$my_path = $_SERVER['DOCUMENT_ROOT'] .'/'.$file->filepath;
header("Pragma: public");
header("Expires: 0");
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: pre-check=0, post-check=0, max-age=0', false);
header('Last-Modified: '.gmdate('D, d M Y H:i:s') .?>
In case the following error comes up:
Error: 1248 - SQLSTATE: 42000 ER_DERIVED_MUST_HAVE_ALIAS
_views_pre_render(&$view)
{
$used_nids = array();
foreach ($view->result as $row)
{
if (!in_array($row->nid, $used_nids))
{
$new_view_result[] = $row;
$used_nids[] = $row->nid;
}
?>
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
crontab -e
t('Date From'),
'#type' => 'date_popup',
'#date_format' => $format,
'#description' => t('Please select a date'),
);
?>