Sep 2, 2002, 4:20 AM
Veteran (19537 posts)
Sep 2, 2002, 4:20 AM
Post #5 of 20
Views: 11179
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%>
Sep 2, 2002, 6:52 PM
User (117 posts)
Sep 2, 2002, 6:52 PM
Post #7 of 20
Views: 11137
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?
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?
Sep 21, 2002, 4:51 AM
Enthusiast (648 posts)
Sep 21, 2002, 4:51 AM
Post #11 of 20
Views: 11060
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
I have set this up in a second set of templates so I was wondering whether this may have some effect ???
John
Significant Media
Sep 21, 2002, 5:44 AM
User (190 posts)
Sep 21, 2002, 5:44 AM
Post #12 of 20
Views: 10990
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
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
Sep 21, 2002, 9:12 AM
Enthusiast (648 posts)
Sep 21, 2002, 9:12 AM
Post #13 of 20
Views: 11026
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
I still get the unauthorised access message. Did you do something else ?
John
Significant Media
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

I still get the unauthorised access message. Did you do something else ?
John
Significant Media
Sep 21, 2002, 10:36 AM
Enthusiast (648 posts)
Sep 21, 2002, 10:36 AM
Post #15 of 20
Views: 11061
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 ?
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...
Thanks again Paul, I wish I knew as much as you do, you'd get some holidays that way
Have a nice week-end
John
PS : BTW for info the complete path is admin/Gforum/Config/Data.pm
Significant Media
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 ?

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...

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

Have a nice week-end
John
PS : BTW for info the complete path is admin/Gforum/Config/Data.pm
Significant Media
Oct 9, 2002, 9:37 AM
Enthusiast (648 posts)
Oct 9, 2002, 9:37 AM
Post #19 of 20
Views: 10943
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
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