cvs diff -u -p -r1.13.2.3 download_count.module Index: download_count.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/download_count/download_count.module,v retrieving revision 1.13.2.3 diff -u -p -r1.13.2.3 download_count.module --- download_count.module 4 May 2008 16:58:44 -0000 1.13.2.3 +++ download_count.module 11 May 2008 09:05:22 -0000 @@ -46,12 +46,11 @@ function download_count_menu() { return $items; } - function download_count_admin_settings() { switch (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC)) { case FILE_DOWNLOADS_PUBLIC: - $output = '

' . t('You are using public download. Set your download method to private on the ') . l('admin/settings/file-system', 'admin/settings/file-system') . t(' page, if you wish for Drupal to keep a record of downloaded files.') . '

'; + $output = '

' . t('You are using public download. Set your download method to private on the file system configuration page, if you wish for Drupal to keep a record of downloaded files.', array('@admin-file-system' => url('admin/settings/file-system'))) . '

'; break; case FILE_DOWNLOADS_PRIVATE: $output = '

' . t('You are using the private download method, hence you have the correct setting to allow this module to keep a record of downloaded files.') . '

'; @@ -102,7 +101,7 @@ function download_count_admin_settings() '#type' => 'textfield', '#title' => t('Title'), '#default_value' => variable_get('download_counter_view_page_title', t('Download counter')), - '#description' => t('Title of this ') . l('page', 'download_counter') . '.', + '#description' => t('Title of this page.', array('@page' => url('download_counter'))), ); $form['download counter page']['download_counter_view_page_header'] = array( @@ -126,7 +125,7 @@ function download_count_admin_settings() ); $form['info_on_access control'] = array( - '#value' => '

' . t('Visit the ') . l('permissions page', 'admin/user/permissions') . ' to allow roles to view download count in nodes and on the download counter page.

', + '#value' => '

' . t('Visit the permissions page to allow roles to view download count in nodes and on the download counter page.', array('@page' => url('admin/user/permissions'))) . '

' ); return system_settings_form($form); @@ -147,18 +146,18 @@ function download_count_view_page() { $rows = array(); if(user_access('view all downloads count')) { - $result = db_query("SELECT fd.filename, fd.count, fd.timestamp, f.nid, n.type FROM {file_downloads} fd JOIN {upload} f ON f.description = fd.filename JOIN {node} n ON n.nid = f.nid" . tablesort_sql($header), $fileDirectoryPath); + $result = db_query("SELECT fd.filename, fd.count, fd.timestamp, f.nid, n.type, nt.name FROM {file_downloads} fd JOIN {upload} f ON f.description = fd.filename JOIN {node} n ON n.nid = f.nid JOIN {node_type} nt ON nt.type = n.type" . tablesort_sql($header), $fileDirectoryPath); } else { - $result = db_query("SELECT fd.filename, fd.count, fd.timestamp, f.nid, n.type FROM {file_downloads} fd JOIN {upload} f ON f.description = fd.filename JOIN {node} n ON n.nid = f.nid WHERE n.uid = %d" . tablesort_sql($header), $fileDirectoryPath, $user->uid); + $result = db_query("SELECT fd.filename, fd.count, fd.timestamp, f.nid, n.type, nt.name FROM {file_downloads} fd JOIN {upload} f ON f.description = fd.filename JOIN {node} n ON n.nid = f.nid JOIN {node_type} nt ON nt.type = n.type WHERE n.uid = %d" . tablesort_sql($header), $fileDirectoryPath, $user->uid); } while ($file = db_fetch_object($result)) { $row = array(); $row[] = $file->filename; $row[] = $file->count; - $row[] = format_interval(time() - $file->timestamp) . ' ago'; - $row[] = l(t('view ' . $file->type), 'node/' . $file->nid); + $row[] = t('@time ago', array('@time' => format_interval(time() - $file->timestamp))); + $row[] = l(t('view @type', array('@type' => $file->name)), 'node/' . $file->nid); $rows[] = $row; } @@ -255,7 +254,7 @@ function theme_download_count_body($node $pick = db_query("SELECT filename, count, timestamp FROM {file_downloads} WHERE CONCAT('%s', filename) = '%s'", $fileDirectoryPath, $file->filepath); if ($attach = db_fetch_object($pick)){ $count = $attach->count; - $last = format_interval(time() - $attach->timestamp) . ' ago'; + $last = t('@time ago', array('@time' => format_interval(time() - $attach->timestamp))); } else { $count = 0;