Gossamer Forum
Post deleted by Paul

Last edited by:

Paul: Sep 21, 2002, 6:11 AM
Quote Reply
Re: [Paul] [NEW] Karma Plugin (well newish) In reply to
Suggestion:

http://www.gossamer-threads.com/...orum.cgi?post=203945
Quote Reply
Re: [backdream] [NEW] Karma Plugin (well newish) In reply to
>>
the karma is only a positive number like 1,2,3,4,5.
<<

Nope, it goes negative.

>>
the number will add up to a value of post owner. And now user_post_title = post_num + all_post_karma
<<

Can be done with a global.
Quote Reply
Re: [Paul] [NEW] Karma Plugin (well newish) In reply to
But how to?
Quote Reply
Re: [Paul] [NEW] Karma Plugin (well newish) In reply to
Code:
sub {
my $user = shift;
my $post = $DB->table('User')->select( { user_id => $user }, 'user_posts' )->fetchrow;
my $karma = $DB->table('Post')->select( { user_id_fk => $user }, 'SUM(post_karma)' )->fetchrow;

return { user_post_title => $post + $karma };
}

I think you can add something like that as a global then add the tag in include_post_display.html - the tag would be:

<%calculate_karma($user_id_fk)%>

And then you can put <%user_post_title%> wherever you want. You can turn it into a name rather than a number with something like:

Code:
<%if user_post_title > '-50' and user_post_title < '1'%>
Naughy Boy
<%elsif user_post_title > '0' and user_post_title < '51'%>
Average Person
<%elsif user_post_title > '50' and user_post_title < '101'%>
Mr Nice Guy
<%elsif user_post_title > '100'>
Karma God
<%endif%>
Quote Reply
Re: [Paul] [NEW] Karma Plugin (well newish) In reply to
Thanks, It works fine. But how to link it to "user_title"?
Quote Reply
Re: [backdream] [NEW] Karma Plugin (well newish) In reply to
I modify user.pm to solve it:

change :

$user->{user_title} ||= generate_user_title($user->{user_posts});

to :

my $karma = $DB->table('Post')->select( { user_id_fk => $user->{user_id} }, 'SUM(post_karma)' )->fetchrow;
$user->{user_title} ||= generate_user_title($karma + $user->{user_posts});

It can work , But does there a simple way or not to modify user.pm?

Last edited by:

backdream: Sep 2, 2002, 6:53 PM
Quote Reply
Re: [Paul] [NEW] Karma Plugin (well newish) In reply to
The current_user_id seems not do , the user guest also display karma.... and the user can add karma to himself?

By the way, when delete post, Does the karma of it delete?

Last edited by:

backdream: Sep 3, 2002, 6:38 PM
Quote Reply
Re: [Paul] [NEW] Karma Plugin (well newish) In reply to
How can I watch the good or bad karma posts that I post?
Quote Reply
Re: [backdream] [NEW] Karma Plugin (well newish) In reply to
Paul why not reply me?
Quote Reply
Re: [Paul] [NEW] Karma Plugin (well newish) In reply to
Has anyone come across a permission denied error after having installed the Karma plug-in. I'm not getting errors just that when I click on the plus or the minus that appears under a user I get a permission denied page from the forum.

I have set this up in a second set of templates so I was wondering whether this may have some effect ???

John
Significant Media
Quote Reply
Re: [Jag] [NEW] Karma Plugin (well newish) In reply to
hello jag

i get this eerror too.
i have edit the action for this plugin to
rate a posting.

Now the plugin works very fine

mfg hoefti
linktobuy Web Directory
Ratgeber Recht
Quote Reply
Re: [hoefti] [NEW] Karma Plugin (well newish) In reply to
Are you talking about modifying an action through the web admin panel -> Setup -> Actions then Edit Action.

I edited the actions karma_add and karma_subtract and the settings I had created through the plug-in area for KarmaPolice weren't visible.

I set it up with :
activated : yes
Type of action : Run function
Show in "Who's Online": show
pages :
groups : no restrictions
Minimum user status : all

But it still won't work Frown

I still get the unauthorised access message. Did you do something else ?

John
Significant Media
Quote Reply
Re: [Jag] [NEW] Karma Plugin (well newish) In reply to
Hi,

In ConfigData.pm could you look for the functions named karma_add and karma_subtract and make sure the line saying:

'min_forum_permission' => '3'

...is removed from both.
Quote Reply
Re: [Paul] [NEW] Karma Plugin (well newish) In reply to
God it's working...

Bravo Paul, great function

I think it will be very useful because as you know, now and again we get people that really piss you off and you're wondering am I the only one that this guy is pissing off ? Is this his one and only day this year where he is acting like a complete idiot and the poor guy is having a bad day ? Crazy
Well this will give the power to the users to say what they think...

Obviously there'll be some hicups on the way there but hey that's life... Smile

Thanks again Paul, I wish I knew as much as you do, you'd get some holidays that way Wink

Have a nice week-end

John

PS : BTW for info the complete path is admin/Gforum/Config/Data.pm
Significant Media
Quote Reply
Re: [Jag] [NEW] Karma Plugin (well newish) In reply to
Oops sorry you are right, I was thinking of Links SQL which uses ConfigData.pm

Last edited by:

Paul: Sep 21, 2002, 11:32 AM
Quote Reply
Re: [Paul] [NEW] Karma Plugin (well newish) In reply to
Thanks for the plugin Paul!

Last edited by:

shiner: Oct 9, 2002, 7:58 AM
Quote Reply
Re: [Paul] [NEW] Karma Plugin (well newish) In reply to
Does anyone know how to modify this from post ID to user id? I would like to allow users to have the ability to ignore all posts from certain users instead of just specific posts.
Quote Reply
Re: [shiner] [NEW] Karma Plugin (well newish) In reply to
Paul wrote another plug-in that does this and it works fine for me but you'll need to read this post from Paul before you download it :

http://www.gossamer-threads.com/...i?post=217146#217146

Link to plug-in to block forum messages (from specific users):
http://www.gossamer-threads.com/...i?post=214321#214321
Significant Media

Last edited by:

Jag: Oct 9, 2002, 9:39 AM
Quote Reply
Re: [Jag] [NEW] Karma Plugin (well newish) In reply to
Thanks Jag ~ I appreciate the link!