WordPress.org

Plugin Directory

Changeset 160440


Ignore:
Timestamp:
10/04/09 11:58:41 (5 years ago)
Author:
webgrrrl
Message:

Committing updates and tagging to version 1.2.

Location:
top-commentators-widget/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • top-commentators-widget/trunk/readme.txt

    r127967 r160440  
    44Tags: comments, widget, seo, sidebar 
    55Requires at least: 2.0.2 
    6 Tested up to: 2.8 
    7 Stable tag: 1.1 
     6Tested up to: 2.8.4 
     7Stable tag: 1.2 
    88 
    99Adds a sidebar widget to show the top commentators in your WP site. Adapted from Show Top Commentators plugin at Personal Financial Advice. 
     
    3535== Changelog == 
    3636 
     37= v.1.2 = 
     381. Added target=_blank option which will open links in a new browser window. 
     392. Added filtering based on range of dates. 
     40 
    3741= v.1.1 = 
    38421. Fixed the Year value error which prevented it from being highlighted when selected and saved in the widget control form. (noted by Sebastien, http://wordpress.org/support/topic/205463?replies=2#post-876591) 
     
    63672. Filtering by e-mail does not seem to work in WP 2.3.3 using full or partial address. 
    6468 
    65 This widget is extensively tested with the following settings: Firefox 3.0.5, PHP 5.2.5, Apache 2.2.8 (Win32), MySQL 5.0.51a. Further testing and bug report on this widget is greatly welcomed and appreciated. 
     69This widget is extensively tested with the following settings: Minefield 3.7a1pre, PHP 5.3.0, Apache 2.2.12 (Win32), MySQL 5.1.37, WordPress 2.8.4. Further testing and bug report on this widget is greatly welcomed and appreciated. 
    6670 
    6771== Frequently Asked Questions == 
     
    81852. **Add description below the title**: You can add an extra description if you want to. NOTE: Certain WP themes may not display this correctly. 
    82863. **Exclude these users**: Exclude commentators based on their names, like Administrator or yourself. 
    83 4. **Reset list every period**: Reset the list to generate commentors hourly, daily, weekly, monthly, yearly, or all-time. You can also reset the list within a certain number of days, like every 15 days or 66 days and so forth. 
     874. **Reset list every period**: Reset the list to generate commentors hourly, daily, weekly, monthly, yearly, or all-time. You can also reset the list within a certain number of days, like every 15 days or 66 days and so forth. As of version 1.2, you can specify a specific range of date; for example, to display top commentators between January 1, 2009 and March 31, 2009, you should type 20090101 and 20090331. 
    84885. **Limit the number of names listed**: If you want to list the top 20 commentators, type in 20. 
    85896. **Limit the number of characters in each name**: Useful if you want to control the list from breaking your sidebar design. Names that have characters longer than your setting will have a trailing ellipses. If you want the names to be longer, change to a higher value such as 35. Otherwise, if, say, you change it to 3, then Lorna will become Lor... . 
     
    899310. **Display list type as bulleted or numbered list**: That's pretty much straight-forward. 
    909411. **Hyperlink names**: Choose whether you want the commentors' names to be linked to their URLs or not. 
    91 12. **NoFollow links**: In case you want to display their URLs but make it NoFollow to stop Google juice. 
    92 13. **Show number of comments made**: Like it says. 
    93 14. **Group commentors based on e-mail or user names**: This option is added to solve the hijacking problem various blogs have been reporting if commentors are grouped by user names. 
    94 15. **Show in home page only**: If you select Yes, then the Top Commentators list will only appear in your main page; otherwise, the list will appear in all pages that have your sidebar displayed. 
    95 16. **Show only commentors with URL**: If you select Yes, then the Top Commentators list filter out commentators who did not leave any web site URL in their latest comment. 
    96 17. **Display Gravatar**: If you select Yes, then a Gravatar will appear on the left side of each commentators name in the Top Commentators list. 
    97 18. **Gravatar size**: If you select Yes in Display Gravatar, the images will appear based on the size you specify here. 
     9512. **Open each link in a new window**: Choose whether you want the links to open a new window (target=_blank). 
     9613. **NoFollow links**: In case you want to display their URLs but make it NoFollow to stop Google juice. 
     9714. **Show number of comments made**: Like it says. 
     9815. **Group commentors based on e-mail or user names**: This option is added to solve the hijacking problem various blogs have been reporting if commentors are grouped by user names. 
     9916. **Show in home page only**: If you select Yes, then the Top Commentators list will only appear in your main page; otherwise, the list will appear in all pages that have your sidebar displayed. 
     10017. **Show only commentors with URL**: If you select Yes, then the Top Commentators list filter out commentators who did not leave any web site URL in their latest comment. 
     10118. **Display Gravatar**: If you select Yes, then a Gravatar will appear on the left side of each commentators name in the Top Commentators list. 
     10219. **Gravatar size**: If you select Yes in Display Gravatar, the images will appear based on the size you specify here. 
    98103 
    99104= The widget screwed with my sidebar design!! WTF?? = 
  • top-commentators-widget/trunk/topcommentators_widget.php

    r127966 r160440  
    33Description: Adds a sidebar widget to show the top commentators in your WP site. Adapted from Show Top Commentators plugin.   
    44Author: Lorna Timbah (WebGrrrl.net) 
    5 Version: 1.1 
     5Version: 1.2 
    66Author URI: http://webgrrrl.net  
    77Plugin URI: http://webgrrrl.net/archives/my-top-commentators-widget-quick-dirty.htm 
     
    9191        } 
    9292        $makeLink = $options['makeLink']; 
     93        $targetBlank = $options['targetBlank']; 
    9394        $noFollow = $options['noFollow']; 
    9495        $showCount = $options['showCount']; 
     
    122123        } elseif(is_numeric($listPeriod)) { 
    123124            $listPeriod = "comment_date >= CURDATE() - INTERVAL $listPeriod DAY"; 
     125        // check if a range of date is entered, then split them and generate the appropriate SQL statement 
     126        } elseif(strpos($listPeriod, 'and') !== false) { 
     127            $listPeriod = "comment_date BETWEEN $listPeriod"; 
    124128        } else { 
    125129            $listPeriod = "DATE_FORMAT(comment_date, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m')"; 
     
    173177                        echo "<a href='" . $url . "'"; 
    174178                        if($noFollow == 1) echo " rel='nofollow'"; 
     179                        if($targetBlank == 1) echo " target='_blank'"; 
    175180                        echo ">"; 
    176181                    } 
     
    203208                        echo "<a href='" . $url . "'"; 
    204209                        if($noFollow == 1) echo " rel='nofollow'"; 
     210                        if($targetBlank == 1) echo " target='_blank'"; 
    205211                        echo ">"; 
    206212                    } 
     
    222228                echo "</li>\n"; 
    223229                unset($url); 
    224                 $countList = $ $countList + 1; 
     230                $countList = $countList + 1; 
    225231// end check onlyWithUrl 
    226232} 
     
    270276        $options = get_option('widget_topcomm'); 
    271277        if (!is_array($options) ) 
    272             $options = array('title'=>'Top Commentators', 'listDesc'=>'You commented; therefore you are loved:', 'excludeNames'=>'\'Lorna\', \'Administrator\'','limitList'=>'10', 'limitChar'=>'25', 'listNull'=>'Be the first to comment in my site.', 'filterUrl'=>'', 'filterEmail'=>'', 'listType'=>'bul', 'listPeriod'=>'m', 'makeLink'=>'1', 'noFollow'=>'1', 'showCount'=>'1', 'groupBy'=>'1', 'showInHome'=>'0', 'onlyWithUrl'=>'0', 'displayGravatar'=>'0', 'avatarSize'=>'20'); 
     278            $options = array('title'=>'Top Commentators', 'listDesc'=>'You commented; therefore you are loved:', 'excludeNames'=>'\'Lorna\', \'Administrator\'','limitList'=>'10', 'limitChar'=>'25', 'listNull'=>'Be the first to comment in my site.', 'filterUrl'=>'', 'filterEmail'=>'', 'listType'=>'bul', 'listPeriod'=>'m', 'makeLink'=>'1', 'targetBlank'=>'0', 'noFollow'=>'1', 'showCount'=>'1', 'groupBy'=>'1', 'showInHome'=>'0', 'onlyWithUrl'=>'0', 'displayGravatar'=>'0', 'avatarSize'=>'20'); 
    273279        if ( $_POST['topcomm-submit'] ) { 
    274280            // Remember to sanitize and format use input appropriately. 
     
    288294            $options['filterEmail'] = $_POST['topcomm-filterEmail']; 
    289295            $options['makeLink'] = $_POST['topcomm-makeLink']; 
     296            $options['targetBlank'] = $_POST['topcomm-targetBlank']; 
    290297            $options['noFollow'] = $_POST['topcomm-noFollow']; 
    291298            $options['showInHome'] = $_POST['topcomm-showInHome']; 
     
    313320        $filterEmail = $options['filterEmail']; 
    314321        $makeLink = $options['makeLink']; 
     322        $targetBlank = $options['targetBlank']; 
    315323        $noFollow = $options['noFollow']; 
    316324        $showInHome = $options['showInHome']; 
     
    343351        if($listPeriod== 'a') 
    344352            echo ' selected'; 
    345         echo '>List all</option></select><br />Or specify number of days: <input style="width: 50px;" id="topcomm-listPeriodnum" name="topcomm-listPeriodnum" type="text" value="'; 
    346         if (is_numeric($listPeriod)) 
     353        echo '>List all</option></select><br />Or specify number of days / enter range of date: <input style="width: 200px;" id="topcomm-listPeriodnum" name="topcomm-listPeriodnum" type="text" value="'; 
     354        if (is_numeric($listPeriod) || (strpos($listPeriod, 'and') !== false)) 
    347355            echo $listPeriod; 
    348         echo '" /></p>'; 
     356        echo '" /><br />E.g. <strong>100</strong> for # of days or <strong>20090301 and 20090531</strong> for date range</p>'; 
    349357        ?> 
    350358        <p style="text-align:right;"><label for="topcomm-limitList">Limit number of names to:</label>  <input style="width: 200px;" id="topcomm-limitList" name="topcomm-limitList" type="text" value="<?php echo $limitList ?>" /><br />Enter numbers only</p> 
     
    369377        echo '>No</option></select></p>'; 
    370378 
     379        echo '<p style="text-align:right;"><label for="topcomm-targetBlank">' . ('Open each link in a new window?') . '</label><select size="1" id="topcomm-targetBlank" name="topcomm-targetBlank"><option value="1"'; 
     380        if($targetBlank == 1) 
     381            echo ' selected'; 
     382        echo '>Yes</option><option value="0"'; 
     383        if($targetBlank == 0) 
     384            echo ' selected'; 
     385        echo '>No</option></select></p>'; 
     386 
    371387        echo '<p style="text-align:right;"><label for="topcomm-noFollow">' . ('NoFollow each name if hyperlinked?') . '</label><select size="1" id="topcomm-noFollow" name="topcomm-noFollow"><option value="1"'; 
    372388        if($noFollow == 1) 
     
    431447 
    432448        // This registers our optional widget control form. Because of this 
    433     // our widget will have a button that reveals a 300x100 pixel form. 
     449    // our widget will have a button that reveals a 410x500 pixel form. 
    434450    register_widget_control(array('Top Commentators', 'widgets'), 'widget_topcomm_control', 410, 500); 
    435451} 
Note: See TracChangeset for help on using the changeset viewer.