![]() |
| | LinkBack | Thread Tools | Display Modes |
| |||
| user's total received votes [hack] How to count a user's total received votes? If a user submit, for example, 4 stories and each one have 10 votes... I want to show in the "Top Users" table his received votes' total count (40 votes) That means that every time someone votes a story the pligg system add 1 to the author "total votes" count. I want to show "most voted users" and "most voted stories". How can I do that? Any Idea? Maybe editing de karma.php file? Last edited by inggenia : 07-09-2007 at 06:31 AM. |
| Sponsored Links |
| |||
| I´m working on a possible solution, but it is difficult. I first think how to sum 1 every time someone click on "vote" on a user's count. But it means that you have to add a new column to the "users" table, like "karma". How to make it without touching the database? |
| |||
| here is my solution to this problem. I read the TopUsers.php, topusers_center.tpl, and users.php code and I looked up how "total_votes" and "published_votes" were made and I made the same for "total_received_votes" Please, read this, use it, and tell me if it works for you and if is possible to add this to the next release 1. first go to /libs/user.php 1.1. on line 37 add a new "for stats" var for the User class PHP Code: PHP Code: PHP Code: 2. now the idea is to show this variable on the topusers.php page 2.1 let's add a new config var on /libs/lang.conf: go to line 618 where section "top users" vars are and add before "karma": PHP Code: PHP Code: PHP Code: PHP Code: PHP Code: PHP Code: 2.5 with this you have your topusers table and a new column "Received Votes" but you must modify your template to show it 3. add the new column to topusers table in topusers themplate .tpl 3.1 go to /templates/yget/topusers_center.tpl, go to line 32 after "user_published_links" and add this line: PHP Code: PHP Code: 4. to show it on user profile: 4.1 go to /libs/lang.conf: and go to line 797 where section "profile" vars are and add berofe "modify profile": PHP Code: PHP Code: thats all... Last edited by inggenia : 07-09-2007 at 06:49 AM. |
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to check if a registering user's email is valid? | rhythm | General Help | 26 | 01-10-2008 05:58 PM |
| Pligg beta 9.5 [updated] | kbeeveer46 | Current Version | 0 | 04-29-2007 08:58 PM |
| RSS for a user's votes in a specific category? | revolver | General Help | 6 | 01-18-2007 12:56 PM |
| Total votes sorting in top users page it is not working correctly! | Nikes77 | Bug Report | 2 | 12-06-2006 05:10 PM |




Linear Mode

