Changeset 6112

Show
Ignore:
Timestamp:
06/09/06 10:24:59 (2 years ago)
Author:
GamerZ
Message:

FIXED: Modified Get Most Emailed Post Function

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wp-email/trunk/email/email.php

    r6084 r6112  
    44Plugin URI: http://www.lesterchan.net/portfolio/programming.php 
    55Description: Enable You To Send Your Webblog Entry To A Friend. 
    6 Version: 2.05 
     6Version: 2.06 
    77Author: GaMerZ 
    88Author URI: http://www.lesterchan.net 
     
    404404### Function: Get Most E-Mailed 
    405405if(!function_exists('get_mostemailed')) { 
    406       function get_mostemailed($mode = '', $limit = 10) { 
     406      function get_mostemailed($mode = '', $limit = 10, $chars = 0) { 
    407407            global $wpdb, $post; 
    408408            $where = ''; 
     
    416416            $mostemailed= $wpdb->get_results("SELECT $wpdb->posts.ID, post_title, post_name, post_date, COUNT($wpdb->email.email_postid) AS 'email_total' FROM $wpdb->email LEFT JOIN $wpdb->posts ON $wpdb->email.email_postid = $wpdb->posts.ID WHERE post_date < '".current_time('mysql')."' AND $where AND post_password = '' GROUP BY $wpdb->email.email_postid ORDER  BY email_total DESC LIMIT $limit"); 
    417417            if($mostemailed) { 
    418                   foreach ($mostemailed as $post) { 
    419                               $post_title = htmlspecialchars(stripslashes($post->post_title)); 
    420                               $email_total = intval($post->email_total); 
    421                               echo "<li><a href=\"".get_permalink()."\">$post_title</a> - $email_total ".__('Emails')."</li>"; 
     418                  if($chars > 0) { 
     419                        foreach ($mostemailed as $post) { 
     420                                    $post_title = htmlspecialchars(stripslashes($post->post_title)); 
     421                                    $email_total = intval($post->email_total); 
     422                                    echo "<li><a href=\"".get_permalink()."\">".snippet_chars($post_title, $chars)."</a> - $email_total ".__('Emails')."</li>"; 
     423                        } 
     424                  } else { 
     425                        foreach ($mostemailed as $post) { 
     426                                    $post_title = htmlspecialchars(stripslashes($post->post_title)); 
     427                                    $email_total = intval($post->email_total); 
     428                                    echo "<li><a href=\"".get_permalink()."\">$post_title</a> - $email_total ".__('Emails')."</li>"; 
     429                        } 
    422430                  } 
    423431            } else { 
  • wp-email/trunk/readme.html

    r6098 r6112  
    33<head>       
    44      <meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
    5       <title>WP-EMail 2.05 Readme</title> 
     5      <title>WP-EMail 2.06 Readme</title> 
    66      <style type="text/css" media="screen"> 
    77            /* Default Style */ 
     
    181181<div id="Container"> 
    182182      <!-- Title --> 
    183       <div id="Title">WP-EMail 2.05&nbsp;&nbsp;&nbsp;<span style="color: #aaaaaa;">Readme</span></div> 
     183      <div id="Title">WP-EMail 2.06&nbsp;&nbsp;&nbsp;<span style="color: #aaaaaa;">Readme</span></div> 
    184184 
    185185      <!-- Tabs --> 
     
    202202                        <script type="text/javascript"> 
    203203                              /* <![CDATA[*/ 
    204                               document.write(' <a href="mailto:gamerz84@hotmail.com?Subject=WP-EMail%202.05%20Support" title="EMail To gamerz84@hotmail.com">gamerz84@hotmail.com</a>'); 
     204                              document.write(' <a href="mailto:gamerz84@hotmail.com?Subject=WP-EMail%202.06%20Support" title="EMail To gamerz84@hotmail.com">gamerz84@hotmail.com</a>'); 
    205205                              /* ]]> */ 
    206206                        </script> 
     
    211211                  <p><b>Development:</b><br /><b>&raquo;</b> <a href="http://dev.wp-plugins.org/browser/wp-email/" title="http://dev.wp-plugins.org/browser/wp-email/">http://dev.wp-plugins.org/browser/wp-email/</a></p> 
    212212                  <p><b>Support Forums:</b><br /><b>&raquo;</b> <a href="http://forums.lesterchan.net/viewforum.php?f=13" title="http://forums.lesterchan.net/viewforum.php?f=13">http://forums.lesterchan.net/viewforum.php?f=13</a></p> 
    213                   <p><b>Updated:</b><br /><b>&raquo;</b> 1st June 2006</p> 
     213                  <p><b>Updated:</b><br /><b>&raquo;</b> 1st July 2006</p> 
    214214                  <div class="SubSubTitle">Changelog</div> 
    215215                  <ul> 
     216                        <li> 
     217                              <b>Version 2.06 (01-07-2006)</b> 
     218                              <ul> 
     219                                    <li>FIXED: Modified Get Most Emailed Post Function</li> 
     220                              </ul> 
     221                        </li> 
    216222                        <li> 
    217223                              <b>Version 2.05 (06-06-2006)</b> 
     
    341347            <div id="Upgrade" style="display: none;"> 
    342348                  <div class="SubTitle">&raquo; Upgrade Instructions</div> 
    343                   <div class="SubSubTitle">From v2.0x To v2.05</div> 
     349                  <div class="SubSubTitle">From v2.0x To v2.06</div> 
    344350                  <ol> 
    345351                        <li> 
     
    360366                        </li> 
    361367                  </ol> 
    362                   <div class="SubSubTitle">From v1.0x To v2.05</div> 
     368                  <div class="SubSubTitle">From v1.0x To v2.06</div> 
    363369                  <ol> 
    364370                        <li> 
     
    476482      </div> 
    477483</div> 
    478 <p id="Copyright">WP-EMail 2.05<br />Copyright &copy; 2006 Lester 'GaMerZ' Chan. All Rights Reserved.</p> 
     484<p id="Copyright">WP-EMail 2.06<br />Copyright &copy; 2006 Lester 'GaMerZ' Chan. All Rights Reserved.</p> 
    479485</body> 
    480486</html>