Keyword

User rating

More
10 years 8 months ago #123238 by ross
User rating was created by ross
Hi,

have anyone here tried to create a user rating (a list of users that have highest number of items posted with good rating)?

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 8 months ago #123239 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: User rating
You can use the K2 content module for that list.

You can also sort the category and the menu item as well to Highest Rated as well.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #123240 by ross
Replied by ross on topic Re: User rating
I looked at the k2 content module, but it can give the list of items by popularity, not a list of users by popularity. Have i missed something?

Please Log in or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 8 months ago #123241 by Yiota
Replied by Yiota on topic Re: User rating
Hello,

If you need to show users with most popular items you need the K2 Users module. This one has the option to fetch users by most popular items.

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #123242 by ross
Replied by ross on topic Re: User rating
Thank you, it works!

Do you know how to change NAMES in this list to USERNAMES?

i have tried to change code in the module template php file:

<?php if($userName): ?>
<a rel="author" href="<?php echo $user->link; ?>"><?php echo $user->name; ?></a>
<?php else: ?>
<?php echo $user->name; ?>
<?php endif; ?>
</span>
<?php endif; ?>

to

<?php if($userName): ?>
<a rel="author" href="<?php echo $user->link; ?>"><?php echo $user->username; ?></a>
<?php else: ?>
<?php echo $user->username; ?>
<?php endif; ?>
</span>
<?php endif; ?>

but it didnt solve the problem
thank you in advance

Please Log in or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 8 months ago #123243 by Yiota
Replied by Yiota on topic Re: User rating
Try instead of $user->name to put $user->userName, I saw that this is included in the $user object.

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #123244 by ross
Replied by ross on topic Re: User rating
nope, tried userName, but it didnt worked - it just gives a blank space

Please Log in or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 8 months ago #123245 by Yiota
Replied by Yiota on topic Re: User rating
OK. I searched it a bit. The username is not fetched from database for this module. In order to fetch it you will have to modify core module files.

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #123246 by ross
Replied by ross on topic Re: User rating
Oh, thats bad

My programming skills are really poor, can anyone help me what to do in this situation?

Please Log in or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
10 years 8 months ago #123247 by Yiota
Replied by Yiota on topic Re: User rating
It is kind of easy though. Just edit the helper.php file of the mod_k2_users. Around line 125 there is this code
case 1 :
                    $query = "SELECT users.name,users.email,users.id AS UID, profiles.*, COUNT(i.id) AS counter FROM #__users AS users

right after the users.name, add users.username,

add this to the other 2 cases around lines 140 and 154 and save.

Then open the override of the mod_k2_users template file located in your template's folder and replace the $user->name with $user->username.

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum