FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Plugins and Code Hacks » Karma/user reputation patch (patch to allow rate users based on their posts and create user karma)  () 2 Votes
Show: Today's Messages :: Unread Messages :: Show Polls :: Message Navigator
| Subscribe to topic | Bookmark topic 
Switch to threaded view of this topic Create a new topic Submit Reply
Karma/user reputation patch [message #166923] Fri, 30 March 2012 10:54 Go to next message
trepstrer is currently offline  trepstrer   Czech Republic
Messages: 9
Registered: November 2009
Karma: 2
Junior Member
add to buddy list
ignore all messages by this user
Hi,

I've created a small patch to add karma feature into current FUDforum 3.0.3. Initially I thought it should be a plugin, but it turned out to be easier to write a patch.
The patch require modification of the database (attached SQL script) and some new messages (also in the patch)

Features:

* full AJAX support (no page reloads)
* use current Rate Topic and Can rate permissions
* users with "can rate" permission can add +1 or -1 to the author of the post
* author can't change karma for own posts
* forum admin can remove karma rating (click on Karma counter next to the user)

Installation:

1. install FUDforum 3.0.3
2. edit attached fudforum_karma.sql to match your table prefix (it's on default fud30_)
3. import fudforum_karma.sql - 'mysql -p <database_name> < fudforum_karma.sql'
* this will add new table karma_rating_track and also add new column to the users table (named karma)
4. apply patch to forum files in web directory (default /var/www/html/fudforum) by 'patch -p0 < fudforum_karma.patch'
5. apply patch to forum data folder (default /var/www/FUDforum) by 'patch -p0 < fudforum_karma_datadir.patch'
6. login to forum administration and rebuild default theme. You should see "Karma: 0" next to user avatar. Works only for default theme.

[Updated on: Fri, 30 March 2012 10:59]

Report message to a moderator

Re: Karma/user reputation patch [message #166952 is a reply to message #166923] Fri, 06 April 2012 21:36 Go to previous messageGo to next message
Anonymous
Karma:
In looking for

Τhanks!
Re: Karma/user reputation patch [message #166964 is a reply to message #166952] Tue, 10 April 2012 08:49 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3708
Registered: December 2004
Karma: 25
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
Would be great if we could integrate this into FUDforum.
However, you've copyrighted it!?!
Re: Karma/user reputation patch [message #166967 is a reply to message #166964] Tue, 10 April 2012 08:58 Go to previous messageGo to next message
trepstrer is currently offline  trepstrer   Czech Republic
Messages: 9
Registered: November 2009
Karma: 2
Junior Member
add to buddy list
ignore all messages by this user
Only the new files I created. However, it's still under GPL so feel free to use it or modify it.
Re: Karma/user reputation patch [message #167057 is a reply to message #166967] Thu, 19 April 2012 09:24 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3708
Registered: December 2004
Karma: 25
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
I've applied your patch, but cannot see any up and down rating links/buttons. CSS declarations for "a.up" and "a.down" are never used. Can you please post the missing code as well?
Re: Karma/user reputation patch [message #167058 is a reply to message #167057] Thu, 19 April 2012 09:34 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3708
Registered: December 2004
Karma: 25
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
Sorry, it is actually working! I've missed the "Rate author of the post: +1 -1" links.
Re: Karma/user reputation patch [message #167059 is a reply to message #167057] Thu, 19 April 2012 09:34 Go to previous messageGo to next message
trepstrer is currently offline  trepstrer   United States
Messages: 9
Registered: November 2009
Karma: 2
Junior Member
add to buddy list
ignore all messages by this user
Everything is already in the patch. Look into patched thm/default/tmpl/drawmsg.tmpl.
Re: Karma/user reputation patch [message #167066 is a reply to message #167059] Fri, 20 April 2012 14:42 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3708
Registered: December 2004
Karma: 25
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
The Karma/user reputation patch was committed and will be part of FUDforum 3.0.4. To enable it, navigate to the Global Settings Manager and change "Karma" from "no" to "yes".
Re: Karma/user reputation patch [message #167800 is a reply to message #166923] Sat, 29 September 2012 16:49 Go to previous messageGo to next message
gooner is currently offline  gooner
Messages: 1
Registered: September 2012
Karma: 0
Junior Member
add to buddy list
ignore all messages by this user
hi!
I have a question about mod

I check enable on the Karma in settings..ok, I see +1 -1 in every message..but i can't see quantity of Karma in message and under user avatar

can you help me, please?
Re : Re: Karma/user reputation patch [message #168122 is a reply to message #167066] Sun, 03 February 2013 19:02 Go to previous messageGo to next message
LucZC is currently offline  LucZC
Messages: 4
Registered: February 2013
Location: France
Karma: 0
Junior Member
remove from buddy list
ignore all messages by this user
Thanks for the inclusion of this patch in the code base.

This may be a good basis to implement a future REDDIT-like comment ranking mechanism, that I will describe later in FUDforum Suggestions.
Re: Karma/user reputation patch [message #168220 is a reply to message #166923] Wed, 06 March 2013 12:41 Go to previous messageGo to next message
trepstrer is currently offline  trepstrer   United States
Messages: 9
Registered: November 2009
Karma: 2
Junior Member
add to buddy list
ignore all messages by this user
I have discovered that users were to able vote repeatedly for the same message under certain conditions.
Attached is a patch which will fix that and allows only one vote per message per user.

[Updated on: Wed, 06 March 2013 12:41]

Report message to a moderator

Message by littleking is ignored  [reveal message]  [reveal all messages by littleking]  [stop ignoring this user] Go to previous messageGo to next message
Re: Karma/user reputation patch [message #168483 is a reply to message #168481] Tue, 07 May 2013 02:14 Go to previous messageGo to next message
naudefj is currently offline  naudefj   
Messages: 3708
Registered: December 2004
Karma: 25
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
I've just +1'ed you and it's working just fine on this forum.
Message by littleking is ignored  [reveal message]  [reveal all messages by littleking]  [stop ignoring this user] Go to previous messageGo to next message
Re: Karma/user reputation patch [message #187573 is a reply to message #168485] Thu, 13 September 2018 11:01 Go to previous message
naudefj is currently offline  naudefj   United States
Messages: 3708
Registered: December 2004
Karma: 25
Senior Member
Administrator
Core Developer
remove from buddy list
ignore all messages by this user
Patch was applied @ https://sourceforge.net/p/fudforum/code/6198
Thank you Petr!
Quick Reply
Formatting Tools:   
  Switch to threaded view of this topic Create a new topic
Previous Topic: How would i change the Id of a whole thread ?
Next Topic: Make the » in the Pager jump to the very end ?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Dec 11 13:33:17 EST 2019

Total time taken to generate the page: 0.00825 seconds