Hi everyone,
I wasn't able to make
user-verification plugin work on my website, so i have done a very simple modification to the plugin
Rating and added an option
Certified user.
In fact when using the plugin user-verification, only the admin has the mighty power to set a user as certified. And i thought that's not best. To me members/users of your website should be the ones to recognize a particular seller as verified/certified.
So i decided to apply the following approach:
- When a seller gets 10 ratings/votes then the rating results change to
Certified user. So in that way "certified user recognition" is granted by buyers and other sellers, not only by the site admin. Fair enough.
How to do it:1 - Just download the modified plugin attached, and follow the normal installation as describe by the author (OSCLASS). And that is it.
The voting will just work fine till a user hits 10 votes. Then the text Certified user will be attached to his name on all places where the voting results is set to be displayed.
2 - If you want to do it manually, then get the original plugin at
https://market.osclass.org/plugins/reviews-ratings/rating_35 and add the following code:
in the file
view_votes_user.php from the plugin folder
replace:
<div class="votes_results">
<?php
$avg_vote = $vote['vote'];
if($avg_vote==5) {
$tooltip = __('Essential', 'voting');
} else if($avg_vote>=4 && $avg_vote<5) {
$tooltip = __('Very interesting', 'voting');
} else if($avg_vote>=3 && $avg_vote<4) {
$tooltip = __('Interesting', 'voting');
} else if($avg_vote>=2 && $avg_vote<3) {
$tooltip = __('Uninteresting', 'voting');
} else if($avg_vote>=1 && $avg_vote<2) {
$tooltip = __('Without interest', 'voting');
} else {
$tooltip = __('Without information', 'voting');
}
?>
<img title="<?php echo $tooltip; ?>" src="<?php voting_star(1, $avg_vote); ?>">
<img title="<?php echo $tooltip; ?>" src="<?php voting_star(2, $avg_vote); ?>">
<img title="<?php echo $tooltip; ?>" src="<?php voting_star(3, $avg_vote); ?>">
<img title="<?php echo $tooltip; ?>" src="<?php voting_star(4, $avg_vote); ?>">
<img title="<?php echo $tooltip; ?>" src="<?php voting_star(5, $avg_vote); ?>">
<span style="float:left; padding-right: 4px; padding-left: 4px;"><?php echo $vote['total'];?> <?php _e('votes', 'voting');?></span>
</div>
</div>
with:
<?php if ( $vote['total']>9 ) { ?>
<div style="display:inline-block; color:#f00; font-weight:600;">
<?php echo '&#10004;Certified user';?>
</div>
<?php } else { ?>
<div class="votes_results">
<?php
$avg_vote = $vote['vote'];
if($avg_vote==5) {
$tooltip = __('Essential', 'voting');
} else if($avg_vote>=4 && $avg_vote<5) {
$tooltip = __('Very interesting', 'voting');
} else if($avg_vote>=3 && $avg_vote<4) {
$tooltip = __('Interesting', 'voting');
} else if($avg_vote>=2 && $avg_vote<3) {
$tooltip = __('Uninteresting', 'voting');
} else if($avg_vote>=1 && $avg_vote<2) {
$tooltip = __('Without interest', 'voting');
} else {
$tooltip = __('Without information', 'voting');
}
?>
<img title="<?php echo $tooltip; ?>" src="<?php voting_star(1, $avg_vote); ?>">
<img title="<?php echo $tooltip; ?>" src="<?php voting_star(2, $avg_vote); ?>">
<img title="<?php echo $tooltip; ?>" src="<?php voting_star(3, $avg_vote); ?>">
<img title="<?php echo $tooltip; ?>" src="<?php voting_star(4, $avg_vote); ?>">
<img title="<?php echo $tooltip; ?>" src="<?php voting_star(5, $avg_vote); ?>">
<span style="float:left; padding-right: 4px; padding-left: 4px;"><?php echo $vote['total'];?> <?php _e('votes', 'voting');?></span>
</div>
<?php }; ?>
</div>
if you want to change the number of votes/rates then change the 9 at line 29 with the number you like.
<?php if ( $vote['total']>9 ) { ?> <!-- change the 9 the the number you want -->
NB: The same logic can be apply item rating if you want to use it as you recognition criteria instead of user rating.
The first image is a capture of item-page. The second one is a capture of User-public-profile page. On both pages you can clearly see the text
Certified UserLastly don't forget that the default behaviour of the orignal plugin is set to allow only registered and logged in users to vote for a user (that's how it work on my site, I don't know if it will be the same for yours too).
I am sure there could be a better and cleaner way to achieve this, but that's how far my beginner knowledge allowed me to do.