Index: forward.install =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/forward/forward.install,v retrieving revision 1.1.2.2 diff -u -F^f -r1.1.2.2 forward.install --- forward.install 11 Jul 2006 19:33:44 -0000 1.1.2.2 +++ forward.install 6 Oct 2006 15:47:22 -0000 @@ -22,7 +22,7 @@ function forward_install() { break; default: break; - } // End case + } if ($query) { drupal_set_message(t('Forward module installed tables successfully.')); @@ -31,3 +31,14 @@ function forward_install() { drupal_set_message(t('Table installation for the Forward module was unsuccessful. The tables may need to be installed by hand. See forward.install file for a list of the installation queries.'), 'error'); } } + +function forward_update_1() { + return _system_update_utf8(array('forward_log')); +} + +function forward_update_2() { + if ($show_on_main = variable_get('forward_show_on_main', FALSE)) { + variable_set('forward_show_on_teasers', $show_on_main); + variable_del('forward_show_on_main'); + } +} \ No newline at end of file Index: forward.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/forward/forward.module,v retrieving revision 1.11.2.22 diff -u -F^f -r1.11.2.22 forward.module --- forward.module 17 Sep 2006 19:47:47 -0000 1.11.2.22 +++ forward.module 6 Oct 2006 15:47:23 -0000 @@ -96,23 +96,23 @@ function forward_settings() { ); $form['forward_options']['forward_link_type'] = array( '#type' => 'checkbox', - '#title' => t('Use Node Type in Link'), + '#title' => t('Use node type in link'), '#return_value' => 1, '#default_value' => variable_get('forward_link_type', FALSE), - '#description' => t('If checked, the link will read "email this nodetype"; if not, it will just read "email this page"'), + '#description' => t('If checked, the link will read "e-mail this node type"; if not, it will just read "e-mail this page"'), ); - $form['forward_options']['forward_show_on_main'] = array( + $form['forward_options']['forward_show_on_teasers'] = array( '#type' => 'checkbox', - '#title' => t('Show link on main page'), + '#title' => t('Show link on teasers'), '#return_value' => 1, - '#default_value' => variable_get('forward_show_on_main', FALSE), - '#description' => t('If checked, the link will appear on your home page'), + '#default_value' => variable_get('forward_show_on_teasers', FALSE), + '#description' => t('If checked, the link will appear on teasers and full texts, otherwise it will appear only on full texts.'), ); $form['forward_options']['forward_form_type'] = array( '#type' => 'select', '#title' => t('Form Type'), - '#default_value' => variable_get('forward_form_type', "link"), - '#options' => array("link" => "link", "form" => "form"), + '#default_value' => variable_get('forward_form_type', 'link'), + '#options' => array('link' => t('Link'), 'form' => t('Form')), '#description' => t('Select link for a forward this page link or form to use a collapsible forwarding form.'), ); $form['forward_options']['forward_flood_control'] = array( @@ -125,7 +125,7 @@ function forward_settings() { $form['forward_options']['forward_flood_error'] = array( '#type' => 'textarea', '#title' => t('Flood Control Error'), - '#default_value' => variable_get('forward_flood_error', t('You can\'t send more than %number messages per hour. Please try again later.')), + '#default_value' => variable_get('forward_flood_error', t("You can't send more than %number messages per hour. Please try again later.")), '#cols' => 40, '#rows' => 10, '#description' => t('This text appears if a user exceeds the flood control limit. The value of the flood control limit setting will appear in place of %number in the message presented to users'), @@ -141,7 +141,7 @@ function forward_settings() { $form['forward_text_values']['forward_instructions'] = array( '#type' => 'textarea', '#title' => t('Forward Instructions'), - '#default_value' => variable_get('forward_instructions', '

'.t('Thank you for your interest in spreading the word on').' '.variable_get('site_name', 'drupal').'.

'.t('NOTE: We only request your email address so that the person you are recommending the page to knows that you wanted them to see it, and that it is not junk mail. We do not capture any email address.').'

'), + '#default_value' => variable_get('forward_instructions', '

'. t('Thank you for your interest in spreading the word on %site_name.', array('%site_name' => variable_get('site_name', 'drupal'))) .'

'. t('NOTE: We only request your e-mail address so that the person you are recommending the page to knows that you wanted them to see it, and that it is not junk mail. We do not capture any e-mail address.').'

'), '#cols' => 40, '#rows' => 10, '#description' => t('This message will be displayed above the form.'), @@ -149,7 +149,7 @@ function forward_settings() { $form['forward_text_values']['forward_thankyou'] = array( '#type' => 'textarea', '#title' => t('Thank You Message'), - '#default_value' => variable_get('forward_thankyou', t('Thank you for your help in spreading the word about').' '.variable_get('site_name', 'drupal').'. '.t('We appreciate your help.')), + '#default_value' => variable_get('forward_thankyou', t('Thank you for your help in spreading the word about %site_name. We appreciate your help.', array('%site_name' => variable_get('site_name', 'drupal')))), '#cols' => 40, '#rows' => 10, '#description' => t('This message will be displayed after the user successfully submits the form.'), @@ -168,11 +168,11 @@ function forward_settings() { '#default_value' => variable_get('forward_sender_addy', "NoReply@".$host['host']), '#size' => 40, '#maxlength' => 40, - '#description' => t('The address to send from. Should be a functioning email address.'), + '#description' => t('The address to send from. Should be a functioning e-mail address.'), ); $form['forward_default_values']['forward_header_image'] = array( '#type' => 'textfield', - '#title' => t('Header Image for Email'), + '#title' => t('Header Image for e-mail'), '#default_value' => variable_get('forward_header_image',''), '#size' => 40, '#maxlength' => 256, @@ -181,51 +181,51 @@ function forward_settings() { ); $form['forward_default_values']['forward_emailsubject'] = array( '#type' => 'textfield', - '#title' => t('Forward Message Subject'), + '#title' => t('Forward Message subject'), '#default_value' => variable_get('forward_emailsubject', t('%name has forwarded a page to you from %site')), '#size' => 40, '#maxlength' => 256, - '#description' => t('Email subject line. The sender\'s name will appear in place of %name in the subject. The web site name will be inserted in place of %site'), + '#description' => t("E-mail subject line. The sender's name will appear in place of %name in the subject. The web site name will be inserted in place of %site"), ); $form['forward_default_values']['forward_emailmessage'] = array( '#type' => 'textarea', - '#title' => t('Forward Message Body'), + '#title' => t('Forward Message body'), '#default_value' => variable_get('forward_emailmessage', t('%name thought you would like to see this page from the %site web site.')), '#cols' => 40, '#rows' => 10, - '#description' => t('Email message body. The sender\'s name will appear in place of %name in the message body. The web site name will be inserted in place of %site The sender will be able to add their own message after this.'), + '#description' => t("E-mail message body. The sender's name will appear in place of %name in the message body. The web site name will be inserted in place of %site the sender will be able to add their own message after this."), ); $form['forward_default_values']['forward_postcardsubject'] = array( '#type' => 'textfield', - '#title' => t('e-Postcard Message Subject'), + '#title' => t('e-Postcard Message subject'), '#default_value' => variable_get('forward_postcardsubject', t('%name has sent you an e-postcard from %site')), '#size' => 40, '#maxlength' => 256, - '#description' => t('Postcard subject line. The sender\'s name will appear in place of %name in the subject. The web site name will be inserted in place of %site'), + '#description' => t("Postcard subject line. The sender's name will appear in place of %name in the subject. The web site name will be inserted in place of %site."), ); $form['forward_default_values']['forward_postcardmessage'] = array( '#type' => 'textarea', - '#title' => t('e-Postcard Message Body'), + '#title' => t('e-Postcard Message body'), '#default_value' => variable_get('forward_postcardmessage', t('%name has sent you an e-postcard from the %site web site. Please take a moment to visit our web site.')), '#cols' => 40, '#rows' => 10, - '#description' => t('Postcard message body. The sender\'s name will appear in place of %name in the message body. The web site name will be inserted in place of %site The sender will be able to add their own message after this.'), + '#description' => t("Postcard message body. The sender's name will appear in place of %name in the message body. The web site name will be inserted in place of %site the sender will be able to add their own message after this."), ); $form['forward_default_values']['forward_ad_footer'] = array( '#type' => 'textarea', - '#title' => t('Oranization Ad'), - '#default_value' => variable_get('forward_ad_footer', " "), + '#title' => t('Organization Ad'), + '#default_value' => variable_get('forward_ad_footer', ''), '#cols' => 40, '#rows' => 10, - '#description' => t('This message will be just above the footer message in the email.'), + '#description' => t('This message will be just above the footer message in the e-mail.'), ); $form['forward_default_values']['forward_footer'] = array( '#type' => 'textarea', '#title' => t('Footer Message'), - '#default_value' => variable_get('forward_footer', " "), + '#default_value' => variable_get('forward_footer', ''), '#cols' => 40, '#rows' => 4, - '#description' => t('This message will be postpended as a footer message to the email.'), + '#description' => t('This message will be postpended as a footer message to the e-mail.'), ); $dyn_options = array( 'node' => t('Latest Blog Articles'), @@ -239,7 +239,7 @@ function forward_settings() { '#title' => t('Dynamic Block'), '#default_value' => variable_get('forward_dynamic_block', 'none'), '#options' => $dyn_options, - '#description' => t('Choose the dynamic block to send with these emails'), + '#description' => t('Choose the dynamic block to send with these e-mails.'), '#required' => TRUE, '#attributes' => NULL, ); @@ -265,25 +265,25 @@ function forward_form() { } global $base_url, $user; - $host=parse_url($base_url); + $host = parse_url($base_url); if (arg(2) == 'email_ref'){ db_query("INSERT INTO {forward_log} (nid, type, timestamp) VALUES ('%d', '%s', %d)", $nid, "REF", time()); if (arg(1) == 'postcard'){ - drupal_goto(drupal_get_path_alias('')); + drupal_goto(); } else { - drupal_goto(drupal_get_path_alias('node/'.$nid)); + drupal_goto('node/'. $nid); } } if (!flood_is_allowed('forward', variable_get('forward_flood_control', 10))) { - $output = t(variable_get('forward_flood_error', 'You can\'t send more than %number messages per hour. Please try again later.'), array('%number' => variable_get('forward_flood_control', 10))); + $output = strtr(variable_get('forward_flood_error', t("You can't send more than %number messages per hour. Please try again later.")), array('%number' => variable_get('forward_flood_control', 10))); } else { - $form = array(); + $form = array(); $url = $base_url.'/node/'.$nid; - $output = variable_get('forward_instructions', '

'.t('Thank you for your interest in spreading the word on').' '.variable_get('site_name', 'drupal').'.

'.t('NOTE: We only request your email address so that the person you are recommending the page to knows that you wanted them to see it, and that it is not junk mail. We do not capture any email address.').'

'); + $output = variable_get('forward_instructions', '

'. t('Thank you for your interest in spreading the word on %site_name.', array('%site_name' => variable_get('site_name', 'drupal'))) .'

'. t('NOTE: We only request your e-mail address so that the person you are recommending the page to knows that you wanted them to see it, and that it is not junk mail. We do not capture any e-mail address.').'

'); if ($nid != '') { @@ -295,12 +295,12 @@ function forward_form() { $form['message'] = array( '#type' => 'fieldset', - '#title' => t('Message to Send'), + '#title' => t('Message to send'), '#description' => '', ); $form['message']['yemail'] = array( '#type' => 'textfield', - '#title' => t('Your Email'), + '#title' => t('Your e-mail address'), '#default_value' => $user->mail, '#size' => 50, '#maxlength' => 256, @@ -310,7 +310,7 @@ function forward_form() { ); $form['message']['yname'] = array( '#type' => 'textfield', - '#title' => t('Your Name'), + '#title' => t('Your name'), '#default_value' => $user->name, '#size' => 50, '#maxlength' => 256, @@ -320,7 +320,7 @@ function forward_form() { ); $form['message']['recipients'] = array( '#type' => 'textarea', - '#title' => t('Send To'), + '#title' => t('Send to'), '#default_value' => str_replace(', ', '\n', $recipients), '#cols' => 50, '#rows' => 5, @@ -331,25 +331,25 @@ function forward_form() { if ($emailtype == 'email') { $form['message'][] = array( '#type' => 'item', - '#title' => t('Page Being Sent'), - '#value' => $base_url.'/'.drupal_get_path_alias('node/'.$nid.''), + '#title' => t('Page being sent'), + '#value' => url('node/'. $nid, NULL, NULL, TRUE), ); } $form['message']['subject'] = array( '#type' => 'item', - '#title' => t('Message Subject'), - '#value' => t(variable_get('forward_'.$emailtype.'subject', '%name has sent you a message from %site'), array('%name' => t('(Your Name)'), '%site' => variable_get('site_name', 'drupal'))), + '#title' => t('Message subject'), + '#value' => strtr(variable_get('forward_'.$emailtype.'subject', t('%name has sent you a message from %site')), array('%name' => '('. t('Your name') .')', '%site' => variable_get('site_name', 'drupal'))), '#description' => '', ); $form['message']['body'] = array( '#type' => 'item', - '#title' => t('Message Body'), - '#value' => t(variable_get('forward_'.$emailtype.'message', '%name thought you would like to see the %site web site.'), array('%name' => t('(Your Name)'), '%site' => variable_get('site_name', 'drupal'))), + '#title' => t('Message body'), + '#value' => strtr(variable_get('forward_'.$emailtype.'message', t('%name thought you would like to see this page from the %site web site.')), array('%name' => '('. t('Your name') .')', '%site' => variable_get('site_name', 'drupal'))), '#description' => '', ); $form['message']['message'] = array( '#type' => 'textarea', - '#title' => t('Your Personal Message'), + '#title' => t('Your personal message'), '#default_value' => '', '#cols' => 50, '#rows' => 10, @@ -367,11 +367,11 @@ function forward_form() { ); $form['message'][] = array( '#type' => 'submit', - '#value' => t('Send Message'), + '#value' => t('Send e-mail'), ); $form['#method'] = 'post'; - $output = drupal_get_form('forward_form', $form); + $output .= drupal_get_form('forward_form', $form); } return $output; } @@ -393,7 +393,7 @@ function forward_nodeapi(&$node, $op, $a ); $form['message']['yemail'] = array( '#type' => 'textfield', - '#title' => t('Your Email'), + '#title' => t('Your e-mail address'), '#default_value' => $user->mail, '#size' => 45, '#maxlength' => 256, @@ -403,7 +403,7 @@ function forward_nodeapi(&$node, $op, $a ); $form['message']['yname'] = array( '#type' => 'textfield', - '#title' => t('Your Name'), + '#title' => t('Your name'), '#default_value' => $user->name, '#size' => 45, '#maxlength' => 256, @@ -413,7 +413,7 @@ function forward_nodeapi(&$node, $op, $a ); $form['message']['recipients'] = array( '#type' => 'textarea', - '#title' => t('Send To'), + '#title' => t('Send to'), '#default_value' => str_replace(', ', '\n', $recipients), '#cols' => 50, '#rows' => 5, @@ -423,19 +423,19 @@ function forward_nodeapi(&$node, $op, $a ); $form['message']['subject'] = array( '#type' => 'item', - '#title' => t('Message Subject'), - '#value' => t(variable_get('forward_'.$emailtype.'subject', '%name has sent you a message from %site'), array('%name' => t('(Your Name)'), '%site' => variable_get('site_name', 'drupal'))), + '#title' => t('Message subject'), + '#value' => strtr(variable_get('forward_'.$emailtype.'subject', t('%name has sent you a message from %site')), array('%name' => t('(Your name)'), '%site' => variable_get('site_name', 'drupal'))), '#description' => '', ); $form['message']['body'] = array( '#type' => 'item', - '#title' => t('Message Body'), - '#value' => t(variable_get('forward_'.$emailtype.'message', '%name thought you would like to see the %site web site.'), array('%name' => t('(Your Name)'), '%site' => variable_get('site_name', 'drupal'))), + '#title' => t('Message body'), + '#value' => strtr(variable_get('forward_'.$emailtype.'message', t('%name thought you would like to see this page from the %site web site.')), array('%name' => t('(Your name)'), '%site' => variable_get('site_name', 'drupal'))), '#description' => '', ); $form['message']['message'] = array( '#type' => 'textarea', - '#title' => t('Your Personal Message'), + '#title' => t('Your personal message'), '#default_value' => '', '#cols' => 50, '#rows' => 10, @@ -453,7 +453,7 @@ function forward_nodeapi(&$node, $op, $a ); $form['message'][] = array( '#type' => 'submit', - '#value' => t('Send Message'), + '#value' => t('Send e-mail'), ); $form['#method'] = 'post'; @@ -472,7 +472,7 @@ function forward_form_validate($form_id, ### To check values, simply access them w/ the same name with which they were declared if (!user_access('administer forward')) { if (!flood_is_allowed('forward', variable_get('forward_flood_control', 10))) { - form_set_error(NULL,variable_get('forward_flood_error', t('You can\'t send more than %number messages per hour. Please try again later.', array('%number' => variable_get('forward_flood_control', 10))))); + form_set_error(NULL,variable_get('forward_flood_error', t("You can't send more than %number messages per hour. Please try again later.", array('%number' => variable_get('forward_flood_control', 10))))); } } @@ -502,7 +502,7 @@ function forward_form_validate($form_id, form_set_error('yemail', t('Header injection attempt detected. Do not enter line feed characters into the from field!')); } if (user_validate_mail($form['yemail'])){ - form_set_error('yemail', t('Your Email address is invalid.')); + form_set_error('yemail', t('Your e-mail address is invalid.')); } if (!$form['yname']) { form_set_error('yname', t('You must enter your name.')); @@ -537,7 +537,7 @@ function forward_form_submit($form_id, $ $dynamic_content .= forward_top5_list($query, $base_url,'blog'); break; case 'user': - $dynamic_content = '

'.t('Who\'s new').'

'; + $dynamic_content = '

'.t("Who's new").'

'; $query = 'SELECT u.uid, u.name FROM {users} u WHERE status != 0 ORDER BY uid DESC'; $dynamic_content .= forward_top5_list($query, $base_url,'user'); break; @@ -547,7 +547,7 @@ function forward_form_submit($form_id, $ $dynamic_content .= forward_top5_list($query, $base_url, 'comment'); break; case 'popular': - $dynamic_content = '

'.t('Most Popular Content').'

'; + $dynamic_content = '

'.t('Most popular content').'

'; $query = "SELECT n.nid, n.title FROM {node_counter} s INNER JOIN {node} n ON s.nid = n.nid WHERE s.timestamp <> '0' AND n.status = 1 ORDER BY s.timestamp DESC"; $dynamic_content .= forward_top5_list($query, $base_url,'blog'); break; @@ -559,7 +559,7 @@ function forward_form_submit($form_id, $ $content_title = ''; $content_name = ''; $content_teaser = ''; - $returnurl = drupal_get_path_alias(''); + $returnurl = ''; } else { $nid = $edit['nid']; @@ -567,13 +567,13 @@ function forward_form_submit($form_id, $ //Get article information. $content = node_load($nid); $content->teaser = check_markup($content->teaser, $content->format, FALSE); - $returnurl = drupal_get_path_alias('node/'.$nid); + $returnurl = 'node/'. $nid; } $vars = array( 'forward_header_image' => variable_get('forward_header_image', ''), - 'site_name' => variable_get('site_name', 'Drupal'), + 'site_name' => variable_get('site_name', 'drupal'), 'yemail' => $edit['yemail'], - 'forward_message' => t(variable_get('forward_'.$emailtype.'message', '%name thought you would like to see the %site web site.'), array('%name' => l($edit['yname'], 'mailto:'.$edit['yemail'],NULL,NULL,NULL,TRUE), '%site' => variable_get('site_name', 'drupal'))), + 'forward_message' => strtr(variable_get('forward_'.$emailtype.'message', t('%name thought you would like to see this page from the %site web site.')), array('%name' => l($edit['yname'], 'mailto:'.$edit['yemail'],NULL,NULL,NULL,TRUE), '%site' => variable_get('site_name', 'drupal'))), 'message' => $edit['message'], 'base_url' => $base_url, 'content' => $content, @@ -583,7 +583,7 @@ function forward_form_submit($form_id, $ ); $body = theme('forward_'.$emailtype, $vars); - $subject = t(variable_get('forward_'.$emailtype.'subject', '%name has sent you a message from %site'), array('%name' => $edit['yname'], '%site' => variable_get('site_name', 'drupal'))); + $subject = strtr(variable_get('forward_'.$emailtype.'subject', t('%name has sent you a message from %site')), array('%name' => $edit['yname'], '%site' => variable_get('site_name', 'drupal'))); $headers = "From: ".$edit['yemail']."\n"; $headers .= "MIME-Version: 1.0\n"; @@ -594,7 +594,7 @@ function forward_form_submit($form_id, $ $recipients = str_replace(',', ', ', $recipients); $recipients = str_replace(', ', ', ', $recipients); - forward_mail($recipients,$subject,$body,$headers); + forward_mail($recipients, $subject, $body, $headers); // insert record into db to record nid, type and timestamp of send db_query("INSERT INTO {forward_log} (nid, type, timestamp) VALUES ('%d', '%s', %d)", $nid, "SENT", time()); variable_set('forward_total', variable_get('forward_total', 0) +1); @@ -602,7 +602,7 @@ function forward_form_submit($form_id, $ flood_register_event('forward'); - drupal_set_message(variable_get('forward_thankyou', t('Thank you for your help in spreading the word about').' '.variable_get('site_name', 'drupal').'. '.t('We appreciate your help.')), 'status'); + drupal_set_message(variable_get('forward_thankyou', t('Thank you for your help in spreading the word about %site_name. We appreciate your help.', array('%site_name' => variable_get('site_name', 'drupal')))), 'status'); drupal_goto($returnurl); } @@ -619,29 +619,33 @@ function forward_mail($mail, $subject, $ /** * Generate links for pages */ -function forward_link($type, $node=0, $main=0) { - if (user_access('access forward') && (variable_get('forward_form_type', 'link') == "link") && variable_get('forward_display_'. $node->type, '1')){ - $links=array(); - if (($type == 'system')) { - // URL, page title, func called for page content, arg, 1 = don't disp menu - menu('forward', t('email this page'), 'forward_page', 1, 1); - } +function forward_link($type, $node = NULL, $teaser = FALSE) { + if (user_access('access forward') && + ($teaser === FALSE || variable_get('forward_show_on_teasers', FALSE)) && + variable_get('forward_form_type', 'link') == 'link' && + variable_get('forward_display_'. $node->type, '1')) { + $links = array(); // This var is set in the settings section under the admin/modules/forward section // It shows 'email this $nodetype' or 'email this page' - $forward_link_type = variable_get('forward_link_type', 0); - if ($forward_link_type) { + $forward_link_type = variable_get('forward_link_type', FALSE); + if (variable_get('forward_show_on_teasers', FALSE)) { + $links[] = l(t("e-mail this page"), 'forward/', array('title' => t('Forward this page to a friend'), 'class' => 'forward-page')); + return $links; + } + elseif (!$forward_link_type) { + $links[] = l(t("e-mail this page"), "forward/$node->nid", array('title' => t('Forward this page to a friend'), 'class' => 'forward-page')); + return $links; + } + else { if ($type == 'comment') { - $forward_link_type = 'comment'; - $links[] = l(t("email this %type", array('%type' => $forward_link_type)), "forward/$node->nid&cid=$node->cid", array('title' => t('Forward this page to a friend'), 'class' => 'forward-page')); - return $links; + $forward_link_type = t('comment'); + $links[] = l(t("e-mail this %type", array('%type' => $forward_link_type)), "forward/$node->nid&cid=$node->cid", array('title' => t('Forward this page to a friend'), 'class' => 'forward-page')); + } + else { + $forward_link_type = $node->type; + $links[] = l(t("e-mail this %type", array('%type' => $forward_link_type)), "forward/$node->nid", array('title' => t('Forward this page to a friend'), 'class' => 'forward-page')); } - $forward_link_type = $node->type; - } - else $forward_link_type = 'page'; - - if (!$main || variable_get('forward_show_on_main', 0)) { - $links[] = l(t("email this %type", array('%type' => $forward_link_type)), "forward/$node->nid", array('title' => t('Forward this page to a friend'), 'class' => 'forward-page')); return $links; } } @@ -687,14 +691,14 @@ function forward_tracking() { $rows[] = array(array('data' => $pager, 'colspan' => '4')); } - $output = '

'.variable_get('forward_total', 0).' '.t('emails sent to').' '.variable_get('forward_recipients', 0).' '.t('recipients').'

'; + $output = '

'. t('%total e-mails sent to %recipients recipients.', array('%total' => variable_get('forward_total', 0), '%recipients' => variable_get('forward_recipients', 0))) .'

'; $output .= theme('table', $header, $rows); } else { - $output = '

'.t('No one has used Forward yet.').'

'; + $output = '

'.t('No one has used forward yet.').'

'; } - print theme("page", $output); - drupal_set_title(t('Forward Tracking')); + drupal_set_title(t('Forward tracking')); + return $output; } @@ -704,14 +708,14 @@ function forward_tracking() { function forward_block($op = 'list', $delta = 0, $edit = array()) { switch ($op) { case 'list': - $blocks[0]['info'] = t('Most Emailed'); + $blocks[0]['info'] = t('Most e-mailed'); return $blocks; case 'configure': $block_options = array ( - 'today' => t('Most Emailed Today'), - 'week' => t('Most Emailed This Week'), - 'allTime' => t('Most Emailed of All Time'), - 'recent' => t('Most Recently Emailed') + 'today' => t('Most e-mailed today'), + 'week' => t('Most e-mailed this week'), + 'allTime' => t('Most e-mailed of all time'), + 'recent' => t('Most recently e-mailed') ); $form['forward_block_type'] = array( '#type' => 'radios', @@ -733,23 +737,23 @@ function forward_block($op = 'list', $de case 'today': $pastday = time()-(24 * 60 * 60); $query='SELECT n.nid, n.title, count(*) FROM {forward_log} s LEFT JOIN {node} n ON s.nid = n.nid WHERE s.type="sent" AND timestamp > '.$pastday.' GROUP BY n.nid DESC'; - $block['subject'] = t("Today's Most Emailed"); + $block['subject'] = t("Today's most e-mailed"); $block['content'] = node_title_list(db_query_range($query, 0, 5)); break; case 'week': $pastweek = time()-(7 * 24 * 60 * 60); $query='SELECT n.nid, n.title, count(*) FROM {forward_log} s LEFT JOIN {node} n ON s.nid = n.nid WHERE s.type="sent" AND timestamp > '.$pastweek.' GROUP BY n.nid DESC'; - $block['subject'] = t("This Week's Most Emailed"); + $block['subject'] = t("This week's most e-mailed"); $block['content'] = node_title_list(db_query_range($query, 0, 5)); break; case 'allTime': $query='SELECT n.nid, n.title, count(*) FROM {forward_log} s LEFT JOIN {node} n ON s.nid = n.nid WHERE s.type="sent" GROUP BY n.nid DESC'; - $block['subject'] = t("Most Emailed"); + $block['subject'] = t('Most e-mailed'); $block['content'] = node_title_list(db_query_range($query, 0, 5)); break; case 'recent': $query="SELECT DISTINCT n.nid, n.title FROM {node} n LEFT JOIN {forward_log} s ON s.nid = n.nid WHERE s.timestamp <> '0' AND s.type='SENT' AND n.status = 1 ORDER BY s.timestamp DESC"; - $block['subject'] = t("Most Recently Emailed"); + $block['subject'] = t('Most recently e-mailed'); $block['content'] = node_title_list(db_query_range($query, 0, 5)); break; } @@ -763,12 +767,14 @@ function forward_top5_list($query, $base $items = '
    '; $result = db_query_range($query, 0, 5); while ($lineitem = db_fetch_array($result)) { - if ($type == 'user'){ - $items .= '
  1. '.l(next($lineitem),'/user/'.current($lineitem)).'
  2. '; - } elseif ($type == 'comment'){ - $items .= '
  3. '.l(next($lineitem),'/node/'.current($lineitem).'#comment-'.next($lineitem)).'
  4. '; - } else { - $items .= '
  5. '.l(next($lineitem),'/node/'.current($lineitem)).'
  6. '; + if ($type == 'user'){ + $items .= '
  7. '.l(next($lineitem),'/user/'.current($lineitem)).'
  8. '; + } + elseif ($type == 'comment'){ + $items .= '
  9. '.l(next($lineitem),'/node/'.current($lineitem).'#comment-'.next($lineitem)).'
  10. '; + } + else { + $items .= '
  11. '.l(next($lineitem),'/node/'.current($lineitem)).'
  12. '; } } return $items.'
'; @@ -776,4 +782,4 @@ function forward_top5_list($query, $base function _forward_column_width($column, $width = 35) { return (strlen($column) > $width ? substr($column, 0, $width) . '...' : $column); -} \ No newline at end of file +} Index: forward.theme =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/forward/forward.theme,v retrieving revision 1.2.2.6 diff -u -F^f -r1.2.2.6 forward.theme --- forward.theme 4 Jul 2006 20:21:21 -0000 1.2.2.6 +++ forward.theme 6 Oct 2006 15:47:23 -0000 @@ -113,5 +113,3 @@ function theme_forward_postcard($vars) { return $output; } - -?> \ No newline at end of file Index: po/forward.pot =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/forward/po/forward.pot,v retrieving revision 1.1.2.3 diff -u -F^f -r1.1.2.3 forward.pot --- po/forward.pot 3 Jun 2006 16:46:20 -0000 1.1.2.3 +++ po/forward.pot 6 Oct 2006 15:47:24 -0000 @@ -1,13 +1,13 @@ -# LANGUAGE translation of Drupal (forward.module) +# LANGUAGE translation of Drupal (forward.theme) # Copyright YEAR NAME -# Generated from file: forward.module,v 1.11.2.14 2006/05/31 21:41:06 seanr +# Generated from file: forward.theme,v 1.2.2.6 2006/07/04 20:21:21 seanr # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" -"POT-Creation-Date: 2006-06-01 09:40+0100\n" -"PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\n" +"POT-Creation-Date: 2006-07-26 14:28-0400\n" +"PO-Revision-Date: 2006-07-26 18:16-0400\n" "Last-Translator: NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" @@ -15,6 +15,33 @@ "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" +#: forward.theme:45;102 +msgid "Message from Sender" +msgstr "" + +#: forward.theme:50 +msgid "by %author" +msgstr "" + +#: forward.theme:54 +msgid "Click here to read more on our site" +msgstr "" + +#: forward.theme:105 +msgid "Click here to visit our site" +msgstr "" + +#: forward.install:28 +msgid "Forward module installed tables successfully." +msgstr "" + +#: forward.install:31 +msgid "" +"Table installation for the Forward module was unsuccessful. The tables may " +"need to be installed by hand. See forward.install file for a list of the " +"installation queries." +msgstr "" + #: forward.module:29 msgid "Enables users to forward pages to friends." msgstr "" @@ -36,27 +63,41 @@ msgstr "" #: forward.module:86 -msgid "Use Node Type in Link" +msgid "Use node type in link" msgstr "" #: forward.module:89 -msgid "If checked, the link will read "email this nodetype"; if not, it will just read "email this page"" +msgid "" +"If checked, the link will read "e-mail this node type"; " +"if not, it will just read "e-mail this page"" msgstr "" #: forward.module:93 -msgid "Show link on main page" +msgid "Show link on teasers" msgstr "" #: forward.module:96 -msgid "If checked, the link will appear on your home page" +msgid "" +"If checked, the link will appear on teasers and full texts, otherwise it " +"will appear only on full texts." msgstr "" #: forward.module:100 msgid "Form Type" msgstr "" +#: forward.module:102 +msgid "Link" +msgstr "" + +#: forward.module:102 +msgid "Form" +msgstr "" + #: forward.module:103 -msgid "Select link for a forward this page link or form to use a collapsible forwarding form." +msgid "" +"Select link for a forward this page link or form to use a collapsible " +"forwarding form." msgstr "" #: forward.module:107 @@ -64,19 +105,25 @@ msgstr "" #: forward.module:110 -msgid "How many times a user can use the form in a one hour period. This will help prevent the forward module from being used for spamming." +msgid "" +"How many times a user can use the form in a one hour period. This will help " +"prevent the forward module from being used for spamming." msgstr "" #: forward.module:114 msgid "Flood Control Error" msgstr "" -#: forward.module:115;453 -msgid "You can't send more than %number messages per hour. Please try again later." +#: forward.module:115;259;453 +msgid "" +"You can't send more than %number messages per hour. Please try again later." msgstr "" #: forward.module:118 -msgid "This text appears if a user exceeds the flood control limit. The value of the flood control limit setting will appear in place of %number in the message presented to users" +msgid "" +"This text appears if a user exceeds the flood control limit. The value of " +"the flood control limit setting will appear in place of %number in the " +"message presented to users" msgstr "" #: forward.module:124 @@ -88,11 +135,14 @@ msgstr "" #: forward.module:131;264 -msgid "Thank you for your interest in spreading the word on" +msgid "Thank you for your interest in spreading the word on %site_name." msgstr "" #: forward.module:131;264 -msgid "NOTE: We only request your email address so that the person you are recommending the page to knows that you wanted them to see it, and that it is not junk mail. We do not capture any email address." +msgid "" +"NOTE: We only request your e-mail address so that the person you are " +"recommending the page to knows that you wanted them to see it, and that it " +"is not junk mail. We do not capture any e-mail address." msgstr "" #: forward.module:134 @@ -104,15 +154,14 @@ msgstr "" #: forward.module:139;583 -msgid "Thank you for your help in spreading the word about" -msgstr "" - -#: forward.module:139;583 -msgid "We appreciate your help." +msgid "" +"Thank you for your help in spreading the word about %site_name. We " +"appreciate your help." msgstr "" #: forward.module:142 -msgid "This message will be displayed after the user successfully submits the form." +msgid "" +"This message will be displayed after the user successfully submits the form." msgstr "" #: forward.module:148 @@ -124,11 +173,11 @@ msgstr "" #: forward.module:158 -msgid "The address to send from. Should be a functioning email address." +msgid "The address to send from. Should be a functioning e-mail address." msgstr "" #: forward.module:162 -msgid "Header Image for Email" +msgid "Header Image for e-mail" msgstr "" #: forward.module:166 @@ -136,7 +185,7 @@ msgstr "" #: forward.module:171 -msgid "Forward Message Subject" +msgid "Forward Message subject" msgstr "" #: forward.module:172 @@ -144,23 +193,28 @@ msgstr "" #: forward.module:175 -msgid "Email subject line. The sender's name will appear in place of %name in the subject. The web site name will be inserted in place of %site" +msgid "" +"E-mail subject line. The sender's name will appear in place of %name in the " +"subject. The web site name will be inserted in place of %site" msgstr "" #: forward.module:179 -msgid "Forward Message Body" +msgid "Forward Message body" msgstr "" -#: forward.module:180 +#: forward.module:180;325;411;554 msgid "%name thought you would like to see this page from the %site web site." msgstr "" #: forward.module:183 -msgid "Email message body. The sender's name will appear in place of %name in the message body. The web site name will be inserted in place of %site The sender will be able to add their own message after this." +msgid "" +"E-mail message body. The sender's name will appear in place of %name in the " +"message body. The web site name will be inserted in place of %site the " +"sender will be able to add their own message after this." msgstr "" #: forward.module:187 -msgid "e-Postcard Message Subject" +msgid "e-Postcard Message subject" msgstr "" #: forward.module:188 @@ -168,27 +222,34 @@ msgstr "" #: forward.module:191 -msgid "Postcard subject line. The sender's name will appear in place of %name in the subject. The web site name will be inserted in place of %site" +msgid "" +"Postcard subject line. The sender's name will appear in place of %name in " +"the subject. The web site name will be inserted in place of %site." msgstr "" #: forward.module:195 -msgid "e-Postcard Message Body" +msgid "e-Postcard Message body" msgstr "" #: forward.module:196 -msgid "%name has sent you an e-postcard from the %site web site. Please take a moment to visit our web site." +msgid "" +"%name has sent you an e-postcard from the %site web site. Please take a " +"moment to visit our web site." msgstr "" #: forward.module:199 -msgid "Postcard message body. The sender's name will appear in place of %name in the message body. The web site name will be inserted in place of %site The sender will be able to add their own message after this." +msgid "" +"Postcard message body. The sender's name will appear in place of %name in " +"the message body. The web site name will be inserted in place of %site the " +"sender will be able to add their own message after this." msgstr "" #: forward.module:203 -msgid "Oranization Ad" +msgid "Organization Ad" msgstr "" #: forward.module:207 -msgid "This message will be just above the footer message in the email." +msgid "This message will be just above the footer message in the e-mail." msgstr "" #: forward.module:211 @@ -196,7 +257,7 @@ msgstr "" #: forward.module:215 -msgid "This message will be postpended as a footer message to the email." +msgid "This message will be postpended as a footer message to the e-mail." msgstr "" #: forward.module:218 @@ -211,7 +272,7 @@ msgid "Latest Comments" msgstr "" -#: forward.module:221;528 +#: forward.module:221 msgid "Most Popular Content" msgstr "" @@ -224,63 +285,58 @@ msgstr "" #: forward.module:229 -msgid "Choose the dynamic block to send with these emails" +msgid "Choose the dynamic block to send with these e-mails." msgstr "" #: forward.module:276 -msgid "Message to Send" -msgstr "" - -#: forward.module:281;374 -msgid "Your Email" -msgstr "" - -#: forward.module:291;384 -msgid "Your Name" +msgid "Message to send" msgstr "" #: forward.module:301;394 -msgid "Send To" +msgid "Send to" msgstr "" #: forward.module:305;398 -msgid "Enter multiple addresses on separate lines or separate them with commas." +msgid "" +"Enter multiple addresses on separate lines or separate them with commas." msgstr "" #: forward.module:312 -msgid "Page Being Sent" +msgid "Page being sent" msgstr "" #: forward.module:318;404 -msgid "Message Subject" +msgid "Message subject" msgstr "" -#: forward.module:319;325;405;411 -msgid "(Your Name)" +#: forward.module:319;405;564 +msgid "%name has sent you a message from %site" msgstr "" #: forward.module:324;410 -msgid "Message Body" +msgid "Message body" msgstr "" #: forward.module:330;416 -msgid "Your Personal Message" +msgid "Your personal message" msgstr "" -#: forward.module:348;434 -msgid "Send Message" +#: forward.module:367;611;615;621;625 +msgid "Forward this page to a friend" msgstr "" -#: forward.module:367;614;622;626 -msgid "Forward this page to a friend" +#: forward.module:405;411 +msgid "(Your name)" msgstr "" #: forward.module:480 -msgid "Header injection attempt detected. Do not enter line feed characters into the from field!" +msgid "" +"Header injection attempt detected. Do not enter line feed characters into " +"the from field!" msgstr "" #: forward.module:483 -msgid "Your Email address is invalid." +msgid "Your e-mail address is invalid." msgstr "" #: forward.module:486 @@ -299,100 +355,80 @@ msgid "You must enter a message." msgstr "" -#: forward.module:513 -msgid "Recent blog posts" -msgstr "" - -#: forward.module:518 -msgid "Who's new" +#: forward.module:528 +msgid "Most popular content" msgstr "" -#: forward.module:523 -msgid "Recent comments" +#: forward.module:611;615 +msgid "e-mail this page" msgstr "" -#: forward.module:605 -msgid "email this page" -msgstr "" - -#: forward.module:614;622;626 -msgid "email this %type" -msgstr "" - -#: forward.module:637 -msgid "Time" +#: forward.module:621;625 +msgid "e-mail this %type" msgstr "" #: forward.module:638 -msgid "Type" -msgstr "" - -#: forward.module:639 -msgid "Path" +msgid "Show forwarding link/form" msgstr "" -#: forward.module:640 -msgid "Title" +#: forward.module:641 +msgid "" +"Displays the form/link to allow visitors to forward the page to a friend. " +"Further configuration is available on the %settings." msgstr "" -#: forward.module:657 -msgid "emails sent to" +#: forward.module:641 +msgid "settings page" msgstr "" -#: forward.module:657 -msgid "recipients" +#: forward.module:672 +msgid "" +"%total e-mails sent to %recipients " +"recipients." msgstr "" -#: forward.module:661 -msgid "No one has used Forward yet." +#: forward.module:676 +msgid "No one has used forward yet." msgstr "" -#: forward.module:664 -msgid "Forward Tracking" +#: forward.module:678 +msgid "Forward tracking" msgstr "" -#: forward.module:674;714 -msgid "Most Emailed" +#: forward.module:689;729 +msgid "Most e-mailed" msgstr "" -#: forward.module:678 -msgid "Most Emailed Today" +#: forward.module:693 +msgid "Most e-mailed today" msgstr "" -#: forward.module:679 -msgid "Most Emailed This Week" +#: forward.module:694 +msgid "Most e-mailed this week" msgstr "" -#: forward.module:680 -msgid "Most Emailed of All Time" +#: forward.module:695 +msgid "Most e-mailed of all time" msgstr "" -#: forward.module:681;719 -msgid "Most Recently Emailed" +#: forward.module:696;734 +msgid "Most recently e-mailed" msgstr "" -#: forward.module:685 +#: forward.module:700 msgid "Block Type" msgstr "" -#: forward.module:688 -msgid "Choose the block type" -msgstr "" - #: forward.module:703 -msgid "Today's Most Emailed" -msgstr "" - -#: forward.module:709 -msgid "This Week's Most Emailed" +msgid "Choose the block type" msgstr "" -#: forward.module:776 -msgid "Forward module installed tables successfully." +#: forward.module:718 +msgid "Today's most e-mailed" msgstr "" -#: forward.module:779 -msgid "The installation of forward module was unsuccessful." +#: forward.module:724 +msgid "This week's most e-mailed" msgstr "" #: forward.module:24 @@ -406,16 +442,3 @@ #: forward.module:0 msgid "forward" msgstr "" - -#: forward.theme:45;102 -msgid "Message from Sender" -msgstr "" - -#: forward.theme:54 -msgid "Click here to read more on our site" -msgstr "" - -#: forward.theme:105 -msgid "Click here to visit our site" -msgstr "" -