WordPress.org

Plugin Directory

Changeset 344535


Ignore:
Timestamp:
02/12/11 14:43:14 (3 years ago)
Author:
webgrrrl
Message:

Version 1.4

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

Legend:

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

    r190520 r344535  
    44Tags: comments, widget, seo, sidebar 
    55Requires at least: 2.0.2 
    6 Tested up to: 2.9.1 
    7 Stable tag: 1.3 
     6Tested up to: 3.0.5 
     7Stable tag: 1.4 
    88 
    99Adds a sidebar widget to show the top commentators in your WP site. Adapted from Show Top Commentators plugin at Personal Financial Advice. 
     
    3434 
    3535== Changelog == 
     36 
     37= v.1.4 = 
     381. Added the Award option which will display image or icon of a medal/badge once a commentator reaches a certain number of comments determined by blog owner. 
     392. Modified the form to allow default values to be entered automatically when initialized (i.e. widget's Save button is pressed). 
     403. Added support for setting default Gravatars to 404, Mystery Man, Identicons, MonsterIDs or Wavatars. 
    3641 
    3742= v.1.3 = 
     
    6570== Buglist == 
    6671 
     721. I've just tested the e-mail and website filters; they don't seem to work for some reason. Will investigate and squash them in my next update. 
     73 
    6774= For those using the v.0.999a widget in WordPress 2.3.3 or lower = 
    6875 
     
    70772. Filtering by e-mail does not seem to work in WP 2.3.3 using full or partial address. 
    7178 
    72 This widget is extensively tested with the following settings: Firefox 3.5.7, PHP 5.3.0, Apache 2.2.12 (Win32), MySQL 5.1.37, WordPress 2.9.1. Further testing and bug report on this widget is greatly welcomed and appreciated. 
     79This widget is extensively tested with the following settings: Google Chrome 9.0.597.98, PHP 5.3.0, Apache 2.2.12 (Win32), MySQL 5.1.37, WordPress 3.0.5. Further testing and bug report on this widget is greatly welcomed and appreciated. 
    7380 
    7481== Frequently Asked Questions == 
     
    87941. **Change widget title**: Change the standard title (Top Commentators) to any snazzy title, like Bloggers of the Month or Commentors Who Owe Me a Million Bucks. 
    88952. **Add description below the title**: You can add an extra description if you want to. NOTE: Certain WP themes may not display this correctly. 
    89 3. **Exclude these users**: Exclude commentators based on their names, like Administrator or yourself. 
     963. **Exclude these users**: Exclude commentators based on their names, like Administrator or yourself. Don't enter any email filters here; they belong in the Filter full/partial emails field. 
    90974. **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. 
    91985. **Limit the number of names listed**: If you want to list the top 20 commentators, type in 20. 
    92996. **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... . 
    93 7. **Add remarks for empty list**: Display some notice to appear when your top commentator list is empty. 
     1007. **Add remarks for empty list**: Display some notice to appear when your top commentator list is empty, like "Be the first person to comment". 
    941018. **Filter full/partial URLs**: Works just like Exclude Users, except this will filter by URLs. 
    951029. **Filter full/partial e-mails**: Works just like Exclude Users, except this will filter by e-mail address. NOTE: This may not work with WP 2.3.3 and lower and currently in the buglist. 
     
    10110815. **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. 
    10210916. **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. 
    103 17. **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. 
     11017. **Display only commentators 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. 
    10411118. **Display Gravatar**: If you select Yes, then a Gravatar will appear on the left side of each commentators name in the Top Commentators list. 
    105 19. **Gravatar size**: If you select Yes in Display Gravatar, the images will appear based on the size you specify here. 
     11219. **Gravatar type and size**: If you select Yes in Display Gravatar, the images will appear based on the type and size you specify here. 
     11320. **Show an Award icon if comments reach a certain range**: If the number of comments is equal or greater than the number specified here, then an award icon will appear. No icon will appear if this number is set to zero (0). 
     11421. **Align Award icon**: Set where you want the award icon to appear. 
    106115 
    107116= The widget screwed with my sidebar design!! WTF?? = 
     
    113122- Identify the CSS elements that exist around and within the Top Commentators Widget. You can identify the tags surrounding the TC Widget with the words "top-commentators" or "widget widget_topcomm". 
    114123- You may or may not want to add a new CSS element specifically for the TC Widget. Get someone you know who's good with CSS if you're not comfortable doing this yourself. 
    115 (You could get me to do it for you, but it'll depend on how complicated the CSS is. If it's difficult, I might charge you around USD2.00 to USD5.00 per theme.) 
    116124 
    117 By the way, if you want to tinker with the style for this widget's Gravatar, just add a class called tcwGravatar to your style.css file and add any CSS element to it. 
     125By the way, if you want to tinker with the style for this widget's Gravatar, just add a class called tcwGravatar to your style.css file and add any CSS element to it. For the Award icon, look for the tcwAward class. 
    118126 
    119127== Screenshots == 
     
    1211291. Top Commentators Widget v.1.0 and v.0.999a control form snapshot in WordPress 2.5.1. 
    1221302. Top Commentators Widget v.0.999 control form snapshot in WordPress 2.3.3. 
     1313. Top Commentators Widget v.1.4 control form snapshot in WordPress 3.0.5. 
    123132 
    124133<?php code(); // goes in backticks ?> 
  • top-commentators-widget/trunk/topcommentators_widget.php

    r190514 r344535  
    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.3 
     5Version: 1.4 
    66Author URI: http://webgrrrl.net  
    77Plugin URI: http://webgrrrl.net/archives/my-top-commentators-widget-quick-dirty.htm 
     
    7777        if($options['limitList'] != "") 
    7878            $limitList = "LIMIT " . $options['limitList']; 
    79         if($options['limitChar'] != "") { 
    80             $limitChar = $options['limitChar']; 
    81         } else { 
    82             $limitChar = 20; 
    83         } 
     79        $limitChar = $options['limitChar']; 
    8480        $listDesc = $options['listDesc']; 
    8581        $listType = $options['listType']; 
    8682        $listPeriod = $options['listPeriod']; 
    87         if($options['listNull'] == "") { 
    88             $listNull = "No commentators."; 
    89         } else { 
    90             $listNull = $options['listNull']; 
    91         } 
     83        $listNull = $options['listNull']; 
    9284        $makeLink = $options['makeLink']; 
    9385        $targetBlank = $options['targetBlank']; 
    9486        $noFollow = $options['noFollow']; 
    95         $showCount = $options['showCount']; 
    96  
     87        $showCount = $options['showCount'];                    
    9788        // Gravatar variables by SNascimento 
    9889        $displayGravatar = $options['displayGravatar']; 
    9990        $avatarSize = $options['avatarSize']; 
    100  
     91        $defaultGravatar = $options['defaultGravatar']; 
     92    // Award variable 
     93    $displayAward = $options['displayAward']; 
     94    $iconAward = $options['iconAward']; 
     95    $alignAward = $options['alignAward']; 
     96     
    10197        // This sets the type of list to be used 
    10298        if($listType == "num") { 
     
    127123            $listPeriod = "comment_date BETWEEN $listPeriod"; 
    128124        } else { 
    129             $listPeriod = "DATE_FORMAT(comment_date, '%Y-%m') = DATE_FORMAT(CURDATE(), '%Y-%m')"; 
     125            $listPeriod = "comment_date >= CURDATE() - INTERVAL 30 DAY"; 
    130126        } 
    131127 
     
    181177                    } 
    182178                } 
    183  
     179                // Award display 
     180                $nCommentComments = $k->comment_comments; 
     181        $nCommentComments = (int)$nCommentComments;          
     182                if($nCommentComments >= $displayAward) { 
     183                    $strDisplayAward='<img class="tcwAward" src="' . $iconAward . '" alt="Top Commentator Award" title="Top Commentator Award" /> '; 
     184        } else { 
     185          $strDisplayAward=''; 
     186        } 
     187        // show award if aligned left before gravatar 
     188        if($alignAward==0) echo $strDisplayAward; 
    184189                // Gravatar display by SNascimento 
    185190                if($displayGravatar == 1)  { 
     
    188193                    echo '<img class="tcwGravatar" src="http://www.gravatar.com/avatar.php?gravatar_id='.$image.'&amp;size='.$avatarSize.'&amp;default='.$defavatar.'" alt ="'.$k->comment_author.'" title="'.$k->comment_author.'" /> '; 
    189194                } 
    190  
     195        // show award if aligned left after gravatar 
     196        if($alignAward==1) echo $strDisplayAward;         
    191197                echo ns_substr_ellipse($k->comment_author, $limitChar); 
    192198                if($showCount == 1) echo " (" . $k->comment_comments . ")"; 
     
    195201                        echo "</a>"; 
    196202                } 
     203                // show award if aligned right 
     204        if($alignAward==2) echo $strDisplayAward; 
    197205                echo "</li>\n"; 
    198206                unset($url); 
     
    212220                    } 
    213221                } 
    214  
    215                 // Gravatar display by SNascimento 
     222                // Award display 
     223                $nCommentComments = $k->comment_comments; 
     224                $nCommentComments = (int)$nCommentComments; 
     225                if($nCommentComments >= $displayAward) { 
     226                    $strDisplayAward='<img class="tcwAward" src="' . $iconAward . '" alt="Top Commentator Award" title="Top Commentator Award" /> '; 
     227        } else { 
     228          $strDisplayAward=''; 
     229        } 
     230        // show award if aligned left before gravatar 
     231        if($alignAward==0) echo $strDisplayAward; 
     232              // Gravatar display by SNascimento 
    216233                if($displayGravatar == 1)  { 
    217234                    $image=md5(strtolower($k->comment_author_email)); 
     
    219236                    echo '<img class="tcwGravatar" src="http://www.gravatar.com/avatar.php?gravatar_id='.$image.'&amp;size='.$avatarSize.'&amp;default='.$defavatar.'" alt ="'.$k->comment_author.'" title="'.$k->comment_author.'" border="0"/> '; 
    220237                } 
    221  
    222                 echo ns_substr_ellipse($k->comment_author, $limitChar); 
     238        // show award if aligned left after gravatar 
     239        if($alignAward==1) echo $strDisplayAward; 
     240          echo ns_substr_ellipse($k->comment_author, $limitChar); 
    223241                if($showCount == 1) echo " (" . $k->comment_comments . ")"; 
    224242                if(trim($url) != '') { 
     
    226244                        echo "</a>"; 
    227245                } 
     246                // show award if aligned right 
     247        if($alignAward==2) echo $strDisplayAward; 
    228248                echo "</li>\n"; 
    229249                unset($url); 
     
    276296        $options = get_option('widget_topcomm'); 
    277297        if (!is_array($options) ) 
    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'); 
     298            $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'=>'30', 'makeLink'=>'1', 'targetBlank'=>'0', 'noFollow'=>'1', 'showCount'=>'1', 'groupBy'=>'1', 'showInHome'=>'', 'onlyWithUrl'=>'', 'displayGravatar'=>'', 'avatarSize'=>'', 'defaultGravatar'=>'', 'displayAward'=>'', 'iconAward'=>'', 'alignAward'=>'0'); 
    279299        if ( $_POST['topcomm-submit'] ) { 
    280300            // Remember to sanitize and format use input appropriately. 
    281             $options['title'] = $_POST['topcomm-title']; 
     301            $options['title'] = ($_POST['topcomm-title'] ? $_POST['topcomm-title'] : "Top Commentators"); 
    282302            $options['excludeNames'] = $_POST['topcomm-excludeNames']; 
    283             $options['limitList'] = $_POST['topcomm-limitList']; 
    284             $options['limitChar'] = $_POST['topcomm-limitChar']; 
     303            $options['limitList'] = ($_POST['topcomm-limitList'] ? $_POST['topcomm-limitList'] : 10); 
     304            $options['limitChar'] = ($_POST['topcomm-limitChar'] ? $_POST['topcomm-limitChar'] : 20); 
    285305            $options['listDesc'] = $_POST['topcomm-listDesc']; 
    286306            $options['listType'] = $_POST['topcomm-listType']; 
    287             if($_POST['topcomm-listPeriodnum'] == '') { 
    288                 $options['listPeriod'] = $_POST['topcomm-listPeriod']; 
    289             } else { 
    290                 $options['listPeriod'] = $_POST['topcomm-listPeriodnum']; 
    291             } 
    292             $options['listNull'] = $_POST['topcomm-listNull']; 
     307            $options['listPeriod'] = ($_POST['topcomm-listPeriod'] ? $_POST['topcomm-listPeriod'] : 30); 
     308            $options['listNull'] = ($_POST['topcomm-listNull'] ? $_POST['topcomm-listNull'] : "Be the first to comment."); 
    293309            $options['filterUrl'] = $_POST['topcomm-filterUrl']; 
    294310            $options['filterEmail'] = $_POST['topcomm-filterEmail']; 
    295             $options['makeLink'] = $_POST['topcomm-makeLink']; 
    296             $options['targetBlank'] = $_POST['topcomm-targetBlank']; 
    297             $options['noFollow'] = $_POST['topcomm-noFollow']; 
    298             $options['showInHome'] = $_POST['topcomm-showInHome']; 
    299             $options['onlyWithUrl'] = $_POST['topcomm-onlyWithUrl']; 
    300             $options['showCount'] = $_POST['topcomm-showCount']; 
    301             $options['groupBy'] = $_POST['topcomm-groupBy']; 
     311            $options['makeLink'] = ($_POST['topcomm-makeLink'] ? $_POST['topcomm-makeLink'] : 1); 
     312            $options['targetBlank'] = ($_POST['topcomm-targetBlank'] ? $_POST['topcomm-targetBlank'] : 1); 
     313        $options['noFollow'] = ($_POST['topcomm-noFollow'] ? $_POST['topcomm-noFollow'] : 0); 
     314            $options['showInHome'] = ($_POST['topcomm-showInHome'] ? $_POST['topcomm-showInHome'] : 1); 
     315            $options['onlyWithUrl'] = ($_POST['topcomm-onlyWithUrl'] ? $_POST['topcomm-onlyWithUrl'] : 0); 
     316            $options['showCount'] = ($_POST['topcomm-showCount'] ? $_POST['topcomm-showCount'] : 1); 
     317            $options['groupBy'] = ($_POST['topcomm-groupBy'] ? $_POST['topcomm-groupBy'] : 1); 
    302318            // Gravatar options 
    303             $options['displayGravatar'] = $_POST['topcomm-displayGravatar']; 
    304             $options['avatarSize'] = ($_POST['topcomm-avatarSize'] ? $_POST['topcomm-avatarSize'] : 20) ; 
    305             update_option('widget_topcomm', $options); 
     319            $options['displayGravatar'] = $_POST['topcomm-displayGravatar'] ? $_POST['topcomm-displayGravatar'] : 0; 
     320            $options['avatarSize'] = ($_POST['topcomm-avatarSize'] ? $_POST['topcomm-avatarSize'] : 20); 
     321            $options['defaultGravatar'] = $_POST['topcomm-defaultGravatar']; 
     322            // Award options 
     323            $options['displayAward'] = ($_POST['topcomm-displayAward'] ? $_POST['topcomm-displayAward'] : 0); 
     324            $options['iconAward'] = ($_POST['topcomm-iconAward'] ? $_POST['topcomm-iconAward'] : "https://lh3.googleusercontent.com/_gE22WSc7tcQ/TVZOTOGQ66I/AAAAAAAAABg/1mAYCyHmMpw/s800/medal_icon.jpg"); 
     325            $options['alignAward'] = $_POST['topcomm-alignAward']; 
     326      update_option('widget_topcomm', $options); 
    306327        } 
    307328        // Be sure you format your options to be valid HTML attributes. 
     
    328349        $displayGravatar = $options['displayGravatar']; 
    329350        $avatarSize = $options['avatarSize']; 
     351        $defaultGravatar = $options['defaultGravatar']; 
     352        $displayAward = $options['displayAward']; 
     353        $iconAward = htmlspecialchars(stripcslashes($options['iconAward']), ENT_QUOTES); 
     354        $alignAward = $options['alignAward']; 
    330355        ?> 
    331356        <p style="text-align:right;"><label for="topcomm-title">Change widget title:</label> <input style="width: 200px;" id="topcomm-title" name="topcomm-title" type="text" value="<?php echo $title ?>" /></p> 
    332         <p style="text-align:right;"><label for="topcomm-listDesc">Add description below the title:</label> <input style="width: 200px;" id="topcomm-listDesc" name="topcomm-listDesc" type="text" value="<?php echo $listDesc ?>" /><br />Leave blank to exclude description.</p> 
    333         <p style="text-align:right;"><label for="topcomm-excludeNames">Exclude these users:</label> <input style="width: 200px;" id="topcomm-excludeNames" name="topcomm-excludeNames" type="text" value="<?php echo $excludeNames ?>" /><br />Separate each name with a comma (,)</p> 
     357        <p style="text-align:right;"><label for="topcomm-listDesc">Add description below the title:</label> <input style="width: 200px;" id="topcomm-listDesc" name="topcomm-listDesc" type="text" value="<?php echo $listDesc ?>" /><br /><small>Leave blank to exclude description</small></p> 
     358        <p style="text-align:right;"><label for="topcomm-excludeNames">Exclude these users:</label> <input style="width: 200px;" id="topcomm-excludeNames" name="topcomm-excludeNames" type="text" value="<?php echo $excludeNames ?>" /><br /><small>Separate each name with a comma (,)</small></p> 
    334359 
    335360        <p style="text-align:right;"><label for="topcomm-listPeriod">Reset list every:</label> <select size="1" id="topcomm-listPeriod" name="topcomm-listPeriod"><option value="h" <?php 
     
    352377            echo ' selected'; 
    353378        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)) 
     379        if(is_numeric($listPeriod) || (strpos($listPeriod, 'and') !== false)) 
    355380            echo $listPeriod; 
    356         echo '" /><br />E.g. <strong>100</strong> for # of days or <strong>20090301 and 20090531</strong> for date range</p>'; 
     381        echo '" /><br /><small>E.g. <strong>100</strong> for # of days or <strong>20090301 and 20090531</strong> for date range</small></p>'; 
    357382        ?> 
    358         <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> 
    359         <p style="text-align:right;"><label for="topcomm-limitChar">Limit characters in names to:</label> <input style="width: 200px;" id="topcomm-limitChar" name="topcomm-limitChar" type="text" value="<?php echo $limitChar ?>" /><br />Enter numbers only</p> 
     383        <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 /><small>Enter numbers only</small></p> 
     384        <p style="text-align:right;"><label for="topcomm-limitChar">Limit characters in names to:</label> <input style="width: 200px;" id="topcomm-limitChar" name="topcomm-limitChar" type="text" value="<?php echo $limitChar ?>" /><br /><small>Enter numbers only</small></p> 
    360385        <p style="text-align:right;"><label for="topcomm-listNull">Remarks for blank list:</label> <input style="width: 200px;" id="topcomm-listNull" name="topcomm-listNull" type="text" value="<?php echo $listNull ?>" /></p> 
    361         <p style="text-align:right;"><label for="topcomm-filterUrl">Filter the following full/partial URLs:</label> <input style="width: 200px;" id="topcomm-filterUrl" name="topcomm-filterUrl" type="text" value="<?php echo $filterUrl ?>" /><br />Separate each URl with a comma (,)</p> 
    362         <p style="text-align:right;"><label for="topcomm-filterEmail">Filter the following full/partial e-mail:</label> <input style="width: 200px;" id="topcomm-filterEmail" name="topcomm-filterEmail" type="text" value="<?php echo $filterEmail ?>" /><br />Separate each e-mail with a comma (,)</p> 
     386        <p style="text-align:right;"><label for="topcomm-filterUrl">Filter the following full/partial URLs:</label> <input style="width: 200px;" id="topcomm-filterUrl" name="topcomm-filterUrl" type="text" value="<?php echo $filterUrl ?>" /><br /><small>Separate each URL with a comma (,)</small></p> 
     387        <p style="text-align:right;"><label for="topcomm-filterEmail">Filter the following full/partial e-mail:</label> <input style="width: 200px;" id="topcomm-filterEmail" name="topcomm-filterEmail" type="text" value="<?php echo $filterEmail ?>" /><br /><small>Separate each e-mail with a comma (,)</small></p> 
    363388        <?php 
    364389        echo '<p style="text-align:right;"><label for="topcomm-listType">' . ('Display list type as:') . '</label><select size="1" id="topcomm-listType" name="topcomm-listType"><option value="bul"'; 
     
    433458            echo ' selected'; 
    434459        echo '>No</option></select></p>'; 
    435  
    436         ?> 
    437  
    438         <p style="text-align:right;"><label for="topcomm-avatarSize">Gravatar Size:</label> <input style="width: 200px;" id="topcomm-avatarSize" name="topcomm-avatarSize" type="text" value="<?php echo $avatarSize ?>" /></p> 
    439  
     460    echo '<p style="text-align:right;"><label for="topcomm-defaultGravatar">' . ('Use the following default Gravatar') . '</label><select size="1" id="topcomm-defaultGravatar" name="topcomm-defaultGravatar"><option value="404"'; 
     461    if($defaultGravatar == '404') echo ' selected'; 
     462        echo '>404</option><option value="mm"'; 
     463    if($defaultGravatar == 'mm') echo ' selected'; 
     464    echo '>Mystery Man</option><option value="identicon"'; 
     465    if($defaultGravatar == 'identicon') echo ' selected'; 
     466    echo '>Identicon</option><option value="monsterid"'; 
     467    if($defaultGravatar == 'monsterid') echo ' selected'; 
     468    echo '>MonsterID</option><option value="wavatar"'; 
     469    if($defaultGravatar == 'wavatar') echo ' selected'; 
     470    echo '>Wavatar</option></select>'; 
     471        ?> <label for="topcomm-avatarSize">Size:</label> <input style="width: 50px;" id="topcomm-avatarSize" name="topcomm-avatarSize" type="text" value="<?php echo $avatarSize ?>" /></p> 
     472        <!-- Award options --> 
     473        <p style="text-align:right;"><label for="topcomm-displayAward">Show an Award if comments are equal or greater than</label> <input style="width: 50px;" id="topcomm-displayAward" name="topcomm-displayAward" type="text" value="<?php echo $displayAward ?>" /><br /><small>Award image/icon appears if number greater than zero (0)</small></p> 
     474        <p style="text-align:right;"><label for="topcomm-iconAward">Award icon/image location</label> <input style="width: 200px;" id="topcomm-iconAward" name="topcomm-iconAward" type="text" value="<?php echo $iconAward ?>" /><br /><small>Enter the full URL of image, including http://</small></p> 
    440475        <?php 
    441  
     476    echo '<p style="text-align:right;"><label for="topcomm-alignAward">' . ('Align the Award icon') . '</label><select size="1" id="topcomm-alignAward" name="topcomm-alignAward"><option value="0"'; 
     477    if($alignAward == 0) echo ' selected'; 
     478        echo '>left before Gravatar</option><option value="1"'; 
     479    if($alignAward == 1) echo ' selected'; 
     480    echo '>left after Gravatar</option><option value="2"'; 
     481    if($alignAward == 2) echo ' selected'; 
     482    echo '>right</option></select></p>'; 
     483        // topcomm ending field 
    442484        echo '<input type="hidden" id="topcomm-submit" name="topcomm-submit" value="1" />'; 
    443485    } 
    444     // This registers our widget so it appears with the other available 
     486    // This registers our widget so it appears with the other available 
    445487    // widgets and can be dragged and dropped into any active sidebars. 
    446488    register_sidebar_widget(array('Top Commentators', 'widgets'), 'widget_topcomm'); 
    447  
    448         // This registers our optional widget control form. Because of this 
     489    // This registers our optional widget control form. Because of this 
    449490    // our widget will have a button that reveals a 410x500 pixel form. 
    450491    register_widget_control(array('Top Commentators', 'widgets'), 'widget_topcomm_control', 410, 500); 
    451492} 
    452  
    453493// Run our code later in case this loads prior to any required plugins. 
    454494add_action('widgets_init', 'widget_topcomm_init'); 
Note: See TracChangeset for help on using the changeset viewer.