WordPress.org

Ready to get started?Download WordPress

Forums

Top Contributors
[resolved] Added code to distinguish top contributors by stars (2 posts)

  1. menkaur
    Member
    Posted 3 years ago #

    hey!
    Liked you plugin, changed it to distinguish top contributors by adding different number of stars depending on the contributor rating.
    here's the code (used around line 876 in top-contributors.php)

    if($jmetc_options['show_icon'] == 1) {
    		$stUser = strip_tags($user);
    		$haystack = $jmetc_options['toplist'];
    		if(in_array($stUser,$haystack ))
    		{
    			$nStars = count($haystack);
    			for($i=0;$i<$nStars;$i++)
    			{
    				if($stUser==$haystack[$i])
    				{
    					$nStars-=$i;
    					break;
    				}
    			}
    
    			$string= $user;
    			for($i=0;$i<$nStars;$i++)
    			{
    				$string  .= ' <img class="tc-icon" src="' . JMETC_PLUGINPATH . 'images/' . $jmetc_options['icon'] . '" alt="" title="Активний дописувач" />';
    			}
    
    			//$string = $user . ' <img class="tc-icon" src="' . JMETC_PLUGINPATH . 'images/' . $jmetc_options['icon'] . '" alt="" title="Активний дописувач" />';
    
    		}
    
    	}

    http://wordpress.org/extend/plugins/top-contributors/

  2. blueinstyle
    Member
    Plugin Author

    Posted 3 years ago #

    this functionality has been added to latest version 1.4

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic