Here's A Karma Mod For Use With SMF & Of Course Tinyportal :)
Install Via Package Manager....
3 Different Karma Blocks Based On Your Forum Members
Karma Log, Top Karma & Lowest Karma Using SSI.
NOTE: Karma Must Be Enabled On Your Forum For These Blocks To Work.
Download V0.4 Here! (http://www.tinyportal.net/index.php?action=tpmod;dl=item637)
V.04 Changes:
Fixed Package Installer For SMF 1.1 Final & SMF 1.1.1
Fixed Lowest Karma SQL Code - This May Give Problems Depending On SQL Version?
Tested With SMF 1.1.1 Final & 1.1.1 With Tinyportal v9
Not Tested On SMF 1.0.8 Or Lower
Use Php Block For Each Karma Block...
Karma Log
ssi_karmalog();
Lowest Karma
ssi_lowestkarma();
Top Karma
ssi_topkarma();
Please remember to backup your SSI.php file before you try this mod.
comments, ideas welcome :coolsmiley:
Demo Of Blocks @ http://TheGaff.net/Forums
Just downloaded the zipfile from the first link, and the file is empty :o
yeah gota wait for bloc to change that..
Thanks OnTap, that was quick. I'd asked about a Karma SSI over on SMF but didn't get a reply over there.
I've installed it via the package manager, have high and low working in Fiddlers Elbow but I dont seem to have anything showing for the log.
Quote from: nokonium on March 22, 2006, 12:35:02 PM
but I dont seem to have anything showing for the log.
strange... do you get an error in the error log?
Nothing related to the SSI.
Quote from: nokonium on March 22, 2006, 12:49:11 PM
Nothing related to the SSI.
can you test it on another webiste?, will wait to see if others have the same prob...
That is my only test site with TP & Karma and I don't want to try it on the main site yet, lets see what others find.
Thanks OnTapÂÃ,© ! I'd love mod ;)
If you want to tweak the format a bit, say to match the User or Online blocks, try something like this
echo '<div style="padding: 5px;" class="smalltext">';
ssi_topkarma();
echo '</div>';
or whatever style class you want.
Thank nokonium 2 ;D
works really well!!!!!!!! thanks, i've been looking for something like this for ages, what i'd like to do though is have the karma log on a seperate page with a link to it on the nav bar. Any ideas on how to do this?
I've just double checked everything, PHP block, function name.
Here is the relevent section of SSI.php
// Latest Karma Block For Use With TinyPortal
// Created By OnTap - Leave Credits!
function ssi_karmalog()
{
global $context, $settings, $options, $txt, $scripturl, $db_prefix;
echo '
<table border="0" cellpadding="0" cellspacing="3" width="100%">
<tr>';
$karma_result = db_query("
SELECT lk.ID_TARGET, lk.ID_EXECUTOR, lk.logTime, lk.action, memt.realName AS targetName, meme.realName AS executorName, meme.ID_MEMBER as executorID, memt.ID_MEMBER as targetID
FROM {$db_prefix}log_karma AS lk, {$db_prefix}members AS memt, {$db_prefix}members AS meme
WHERE memt.ID_MEMBER = lk.ID_TARGET
AND meme.ID_MEMBER = lk.ID_EXECUTOR
ORDER BY logTime DESC
LIMIT 05", __FILE__, __LINE__);
$return = array();
while ($row_karmas = mysql_fetch_assoc($karma_result))
{
$return[] = array(
'executor' => $row_karmas['executorName'],
'executorID' => $row_karmas['executorID'],
'target' => $row_karmas['targetName'],
'targetID' => $row_karmas['targetID'],
'action' => $row_karmas['action'] == 1 ? '<font color=green>Applauds' : '<B><font color=#FF0000>Smites</B>',
'time' => timeformat($row_karmas['logTime'])
);
}
mysql_free_result($karma_result);
echo '
<td width="100%" valign="top">';
foreach ($return as $data)
echo '<span class="smalltext"><a href=', $scripturl, '?action=profile;u=', $data['executorID'], '><font color=#000000>', $data['executor'], '</font></a> ', $data['action'], ' <a href=', $scripturl, '?action=profile;u=', $data['targetID'], '>', $data['target'], '</a></font><br> ', $data['time'], '<hr> ';
echo '
</td>
</tr>
</table>';
}
Got it working :)
Thanks a lot for this snippet OnTapÂÃ,©
Supplementary info
Webhost php version is 5.1
Quote from: nokonium on March 22, 2006, 02:23:02 PM
Supplementary info
Webhost php version is 5.1
ive tested it on 3 sites and it works perfect...
try Applaudin a few people and see does it show up?
Our karma is set to totals and admin only, there are no applaud or smite links to use. We 'award' our karma by changing the plus/applaud total in the users profile. I have done that and the revised total shows, but the log didn't register anything.
Ultra Cool, thanks a TON dude...
How do you get this thing working? I dont see any block option added in SSI function. From where I can add this block on my site?
Thanks!
Chodhry
http://www.WebmasterTradeCenter.com
Quote from: Chodhry on March 24, 2006, 08:51:59 PM
How do you get this thing working? I dont see any block option added in SSI function. From where I can add this block on my site?
you gota add a php block for each and insert the codes below
Karma Logssi_karmalog();Lowest Karmassi_lowestkarma();Top Karmassi_topkarma();
oh, ok, thanks a million. :)
Quote from: Alan S on March 22, 2006, 01:19:16 PM
works really well!!!!!!!! thanks, i've been looking for something like this for ages, what i'd like to do though is have the karma log on a seperate page with a link to it on the nav bar. Any ideas on how to do this?
Any Ideas Anyone?
Put the Karma log block code into a php article and link to it through the menu.
thank you!!!!!!!!
needed to fix up a few things in the mod, will post update later...
I installed it and tested it everything works great for me. But there is one thing I'd like to change, In the karma log where it says:
Name1 Applauds Name2 for example.
Name1's font color is in black, and I use a dark theme so it makes it really hard to read. All the other names just come up fine as the forum default colors.
If someone could tell me where to edit it so I can Change the font color of Name1 that would be great ;)
Thanks
How many entries will the log keep and is there a way to set it so you one see the last 20 Karmas?
I guess you can change the number to show.
Try this ( havent tryed it myselfe though so backup the files before you try this)
In theme dir ssi.php find
LIMIT 05", __FILE__, __LINE__); Change the 05 to 20
SELECT karmaGood, karmaBad, realName, ID_MEMBER FROM {$db_prefix}members ORDER BY (karmaGood-karmaBad) ASC LIMIT 5", __FILE__, __LINE__); change 05 to 20
SELECT karmaGood, karmaBad, realName, ID_MEMBER FROM {$db_prefix}members ORDER BY (karmaGood-karmaBad) DESC LIMIT 5", __FILE__, __LINE__); Change 5 to 20
I hope that will work :)
Quote from: G6 on March 27, 2006, 05:41:03 PM
Try this ( havent tryed it myselfe though so backup the files before you try this)
I hope that will work :)
the old way of changing it :P this has being fixed in the new version.
V0.2See Attachment In First Post
http://www.tinyportal.net/smf/index.php?topic=3630.msg29944#msg29944
Quote from: RoarinRow on March 27, 2006, 05:13:16 PM
is there a way to set it so you one see the last 20 Karmas?
Yeah, Download 0.2 & if you wanna show 20 in the karma log put it ssi_karmalog(20);
Well, i did give it a try though ;) :2funny:
Quote from: OnTapÂÃ,© on March 27, 2006, 06:03:29 PM
Quote from: G6 on March 27, 2006, 05:41:03 PM
Try this ( havent tryed it myselfe though so backup the files before you try this)
I hope that will work :)
the old way of changing it :P this has being fixed in the new version.
V0.2
http://thegaff.net/forums/index.php?action=tpmod;dl=item18
Quote from: RoarinRow on March 27, 2006, 05:13:16 PM
is there a way to set it so you one see the last 20 Karmas?
Yeah, Download 0.2 & if you wanna show 20 in the karma log put it ssi_karmalog(20);
Cool, thanks!
This is interesting. I installed v.2 on my test site. Look at the first user. He has -1, but he shows up in the Top Karma block.
I have Total Karma enabled instead of Positive/negative Karma.
Perhaps it counts it backwards? like the negative numbers comes out first cause it counts before the actuall first numer
-1 0 1 etc...
Quote from: RoarinRow on March 27, 2006, 10:03:19 PM
Look at the first user. He has -1,
very strange is right....
try changing that members karma and see will it change it?
I uninstalled 0.1 before I installed 0.2 and all my admin disappeared, all I had was the sidebar. So I reloaded the 0.1 karma SSI file and ran it as an update. When I checked the SSI file it had both 0.1 & 0.2 code.
I've edited it now to only 0.2 code, what is the correct task order to update from 0.1 to 0.2?
Quote from: nokonium on March 28, 2006, 01:11:58 PM
I uninstalled 0.1 before I installed 0.2 and all my admin disappeared
Disable the karma blocks first... then uninstall.
Thanks
Quote from: RoarinRow on March 27, 2006, 10:03:19 PM
This is interesting. I installed v.2 on my test site. Look at the first user. He has -1, but he shows up in the Top Karma block.
I have Total Karma enabled instead of Positive/negative Karma.
There is a solution for this somewhere at the SMF boards. It also happened when someone created a mod that displayed karma stats on stat page. I believe it may have been in the trips & tricks, I can't remember.
has anyone found this? I will be looking too.
Quote from: londonhogfan on April 10, 2006, 11:11:44 PM
has anyone found this? I will be looking too.
dont understand what you mean, the mod is attached at the start of this topic?
This is what I was talking about.
Quote from: Xarcell on March 31, 2006, 02:03:15 AM
Quote from: RoarinRow on March 27, 2006, 10:03:19 PM
This is interesting. I installed v.2 on my test site. Look at the first user. He has -1, but he shows up in the Top Karma block.
I have Total Karma enabled instead of Positive/negative Karma.
There is a solution for this somewhere at the SMF boards. It also happened when someone created a mod that displayed karma stats on stat page. I believe it may have been in the trips & tricks, I can't remember.
I did find a couple of topics that brought it up, but no one ever had a solution for it....
How do I make it only display the member with the most karma.
I only want one person displayed.
Would my php code look like this?
echo '<div style="padding: 5px;" class="smalltext">';
ssi_topkarma(1);
echo '</div>';
Quote from: Mitchâââ,¬Å¾Ã,¢ on April 11, 2006, 11:52:10 PM
I only want one person displayed.
Would my php code look like this?
echo '<div style="padding: 5px;" class="smalltext">';
ssi_topkarma(1);
echo '</div>';
yup.
Hi, i ÂÃ,´m from spain, sorry for my english.
My karma log, restarts to empty after x time.
How can i make the loog permanent?
Thanks ^-^
New thing, the log restarts when after x minute’s one member makes new karma assignment.
Please can anyone’s help me?
I would post your questions over at SMF.
is there anyway to show it to time? say karma action in the last 24 or 48 hrs?
karma log does not work here.. lowest and highest karma codes work though.
SMF 1.1RC2 and TinyPortal 0.8.6
Hey, has anyone figured out how to solve the problem of negative Karma showing up as #1 in the Leader block? I searched over at SMF but couldnt figure it out.
Package Manager - Install Actions
Install Actions for archive KarmaBlocks02.zip:
The package you are trying to download or install is either corrupt or not compatible with this version of SMF
O_o
Quote from: vulcan on June 20, 2006, 05:33:20 AM
The package you are trying to download or install is either corrupt or not compatible with this version of SMF
what version of SMF are you tryin to install it on?
1.0.7
Quote from: vulcan on June 21, 2006, 01:09:14 AM
1.0.7
havent tested this mod on 1.0.7 or lower, i suggest you use 1.1 RC2
Hi, I have Karma Blocks Package 0.2 installed on my site, but in my list of Top Karmas I get users with negative Karma showing as the highest. http://mac-central.com to see what I mean. Any ideas how to fix this?
This appears to be an SMF/php5 problem, I've just had a look at SMF support and I cannot find a fix for it yet, hopefully RC3 will have one.
Quote from: nokonium on June 26, 2006, 05:59:23 PM
This appears to be an SMF/php5 problem, I've just had a look at SMF support and I cannot find a fix for it yet, hopefully RC3 will have one.
Thanks for the reply. I dont even think my server is running php5. It's 4.something.
-1 on top sounds like a Signed/Unsigned integer problem to me...
My 2ÂÃ,¢
cool! works nice! ^_^
thanks ya@!
hey how do i change the text wartog ""smites"" wartog
How can I change "smites" to a different word?
In SMF admin , there is a place to change the name of the Karma labels. (SMF 1.1RC2)
Yeah I changed those and they show up to what I changed them to in a post, but in the karma block karma log it shows up wartog"smites"coolmike
K never mind I found it. Thanks tho.
Anyone ever figure out how to make the person with the highest Karma be displayed?
mine is displaying the users with the lowest negative karma in the Topkarma block and showing the anyone with 0 karma in the lowestkarma block, if you give the person with 0 karma +1 karma it dont show him anymore.
Quote from: Wartog on August 06, 2006, 07:48:56 AM
Anyone ever figure out how to make the person with the highest Karma be displayed?
mine is displaying the users with the lowest negative karma in the Topkarma block and showing the anyone with 0 karma in the lowestkarma block, if you give the person with 0 karma +1 karma it dont show him anymore.
Yep. Mine does the same thing. I haven't found a fix yet either :(
i will do and update for this soon....
will fix the -1 showing in top karma, and possibly a way to change the text "Smites" & "Applauds"
Quote from: Maxâââ,¬Å¾Ã,¢ on August 06, 2006, 07:49:48 PM
i will do and update for this soon....
will fix the -1 showing in top karma, and possibly a way to change the text "Smites" & "Applauds"
Okay, thanks for that bro!
Ive updated this mod a small bit... see my first post for the download link & changes made
any packages for 1.1rc3 yet?
so i can upgrade my forum.
current mods are: tinyportal, smfarcade, and karma blocks
thanks,
phong
Quote from: phong1 on August 28, 2006, 01:54:07 AM
any package for 1.1rc3 yet?
Edit:Karma Blocks Package v0.3 Will Work On SMF 1.1 RC3
Quote from: Avinash on August 06, 2006, 02:31:56 PM
Quote from: Wartog on August 06, 2006, 07:48:56 AM
Anyone ever figure out how to make the person with the highest Karma be displayed?
mine is displaying the users with the lowest negative karma in the Topkarma block and showing the anyone with 0 karma in the lowestkarma block, if you give the person with 0 karma +1 karma it dont show him anymore.
Yep. Mine does the same thing. I haven't found a fix yet either :(
Me too.. (using KBP v0.3)
Quote from: Avinash on August 06, 2006, 02:31:56 PM
Yep. Mine does the same thing. I haven't found a fix yet either :(
Quote from: slebe on September 21, 2006, 03:58:48 PM
Me too.. (using KBP v0.3)
Think its something to do with PHP5 Or MYSQL versions maybe?
Havent yet found the problem.
it does not work on smf1.0.8 tp?? huhu...
this error comes out
''The package you are trying to download or install is either corrupt or not compatible with this version of SMF.''
Quote from: metal13 on September 26, 2006, 10:58:44 PM
it does not work on smf1.0.8
thats correct..
Did'nt do a package for 1.0.8, Only 1.1
i cant believe people actually enjoy karma ...
oh the smfrep system is horrible!
come on max develop us a vB style Rep system :D
lol... uve to pay for vb never mind that! :P
Hey, I have a problem with karmalog, I tried ssi_karmalog() but it shows just last action, never more then 1 is printed ( tried also ssi_karmalog(20); )
thx for help ;)
Great mod Maxâââ,¬Å¾Ã,¢ , I just added it to my site, thanks so much.
I also added an image to the php block:
echo '<a href="'.$scripturl.'?action=stats"><img src="'.$settings['actual_images_url'].'/your image.gif '.'" /> </a><br>
<span class="smalltext">';
ssi_topkarma();
echo '</span>';
Quote from: antichrist on October 01, 2006, 02:33:36 PM
Hey, I have a problem with karmalog, I tried ssi_karmalog() but it shows just last action, never more then 1 is printed
Sounds like the mod didnt install?
That is how it is showing on mine as well Maxâââ,¬Å¾Ã,¢ , I did some yesterday and it showed them now it is just showing one I did after midnight. But the other blocks are showing fine.
just like me, top & lower are showing fine but not the karma log function
is this possible?
Quote from: Wartog on August 06, 2006, 07:48:56 AM
Anyone ever figure out how to make the person with the highest Karma be displayed?
mine is displaying the users with the lowest negative karma in the Topkarma block and showing the anyone with 0 karma in the lowestkarma block, if you give the person with 0 karma +1 karma it dont show him anymore.
You need to change the SSI.php file a little - back it up before you do anything, just in case.
For lowest karma, go to the section titled Lowest Karma Block and find :-
echo '<table border="0" cellpadding="0" cellspacing="3" width="100%"> ';
$karma_results = db_query("SELECT karmaGood, karmaBad, realName, ID_MEMBER FROM {$db_prefix}members ORDER BY (karmaGood-karmaBad) ASC LIMIT $lowestkarma", __FILE__, __LINE__);
Change it to :-
echo '<table border="0" cellpadding="0" cellspacing="3" width="100%"> ';
$karma_results = db_query("SELECT realName, karmaBad, ID_MEMBER FROM {$db_prefix}members ORDER BY karmaBad DESC LIMIT 5", __FILE__, __LINE__);Then go to the section marked Top Karma block and find :-
echo '
<table border="0" cellpadding="0" cellspacing="2" width="100%"> ';
$karma_results = db_query("SELECT karmaGood, karmaBad, realName, ID_MEMBER FROM {$db_prefix}members ORDER BY (karmaGood-karmaBad) DESC LIMIT $topkarma", __FILE__, __LINE__);
Change it to :-
echo '
<table border="0" cellpadding="0" cellspacing="2" width="100%"> ';
$karma_results = db_query("SELECT realName, karmaGood, ID_MEMBER FROM {$db_prefix}members ORDER BY karmaGood DESC LIMIT 5", __FILE__, __LINE__);Worked for me.
Edit - the above threw a couple of errors, so try this instead - btw, 5 is the number to change for however many you want to display. It doesn't work doing it through the brackets after the function this way..
// Karma Package V0.3
// Lowest Karma Block
// Created By Maxâââ,¬Å¾Ã,¢ - Leave Credits!
function ssi_lowestkarma($lowestkarma = 3, $output_method = 'echo')
{
global $context, $settings, $options, $txt, $scripturl, $db_prefix;
echo '<table border="0" cellpadding="0" cellspacing="2" width="100%"> ';
$karma_results = db_query("SELECT realName, karmaBad, ID_MEMBER FROM {$db_prefix}members ORDER BY 'Bad' DESC LIMIT 1", __FILE__, __LINE__);
$context['ltkarma'] = array();
while( $row_karma = mysql_fetch_assoc($karma_results) )
{
$context['ltkarma'][] = array(
'Link' => '<span class="smalltext"><a href="' . $scripturl . '?action=profile;u=' . $row_karma['ID_MEMBER'] . '">' . $row_karma['realName'] . '</a></span>',
'Bad' => - $row_karma['karmaBad']
);
}
mysql_free_result($karma_results);
echo ' <td width="100%" valign="top"> ';
foreach($context['ltkarma'] as $ltkarma)
{
$total = $ltkarma['Bad'];
echo ' <table border="0" cellpadding="0" cellspacing="3" width="100%">
<td> '.$ltkarma['Link'].'</td>
<td width="20%" align="right"><font color="'. $txt['karma_smite_color'] .'">'.$total.'</font></td></table>';
}
echo '</td></tr></table>';
}
// Karma Package V0.3
// Top Karma Block
// Created By Maxâââ,¬Å¾Ã,¢ - Leave Credits!
function ssi_topkarma($topkarma = 3, $output_method = 'echo')
{
global $context, $settings, $options, $txt, $scripturl, $db_prefix;
echo '
<table border="0" cellpadding="0" cellspacing="2" width="100%"> ';
$karma_results = db_query("SELECT realName, karmaGood, ID_MEMBER FROM {$db_prefix}members ORDER BY 'Good' DESC LIMIT 1", __FILE__, __LINE__);
$context['htkarma'] = array();
while( $row_karma = mysql_fetch_assoc($karma_results) )
{
$context['htkarma'][] = array(
'Link' => '<span class="smalltext"><a href="' . $scripturl . '?action=profile;u=' . $row_karma['ID_MEMBER'] . '">' . $row_karma['realName'] . '</a></span>',
'Good' => $row_karma['karmaGood']
);
}
mysql_free_result($karma_results);
echo '
<td width="100%" valign="top">';
foreach($context['htkarma'] as $htkarma)
{
$total = $htkarma['Good'];
echo '
<table border="0" cellpadding="0" cellspacing="3" width="100%">
<td> '.$htkarma['Link'].'</td><td width="20%" align="right"><font color="'. $txt['karma_applaud_color'] .'"> '.$total.'</font>
</td></table>';
}
echo '</td></tr></table>';
}
The 'realName' is allready in the code but not at the start,
didnt think it would make a difference.. hmm will look into it more.
'karmaGood, karmaBad' - it should only be 1 or the other (not both)
Thanks For Correcting That Glampers.
So Maxâââ,¬Å¾Ã,¢ , if I make the above changes the karma log will work like it does on your site?
is there a way so that the wait time can be reduced to 5 mins?
or even better yet a check to see if the userAKU has given userMAX karma recently then they must wait Z number of hours before giving them karma again BUT userAKU can give other members karma in the meanwhile normally
basically once userAKU gives karma to any other user he is subject to a wait time of Z before being able to give them karma again but it does not effect his ability to give other new users karma
Does this work with SMF 1.1.1?
It works fine with 1.1.1 installed as an upgrade, I don't know about installing it into 1.1.1 though.
Quote from: nokonium on December 24, 2006, 04:43:35 PM
It works fine with 1.1.1 installed as an upgrade, I don't know about installing it into 1.1.1 though.
I've installed it in 1.1.1 and it seems to be working fine...
This has being updated for 1.1.1 in my first post .. Let me know of any errors/problems ;)
it works! thx Maxâ„¢
Hello,
ssi_topkarma of Karma v0.4 count only KarmaGood instead of KarmaGood-KarmaBad :o
is it normal ? :uglystupid2:
exemple :
v.0.4:
$karma_results = db_query("SELECT realName, karmaGood, ID_MEMBER FROM {$db_prefix}members ORDER BY karmaGood DESC LIMIT $topkarma", __FILE__, __LINE__);
V.0.3 :
$karma_results = db_query("SELECT karmaGood, karmaBad, realName, ID_MEMBER FROM {$db_prefix}members ORDER BY (karmaGood-karmaBad) DESC LIMIT $topkarma", __FILE__, __LINE__);
Quote from: Soph on January 04, 2007, 04:43:15 PM
Hello,
ssi_topkarma of Karma v0.4 count only KarmaGood instead of KarmaGood-KarmaBad :o
is it normal ? :uglystupid2:
yea theres no need to count the karmaBad in the top karma ;)
i have modified it to count it ;)
else it display (in my forum) 63 Karma or i have 63 :) - 16 :tickedoff:
I wanted to sort by Total Karma (Good - Bad) but the ORDER BY was returning some strange results. Turns out that on some installs of SQL the unsigned status of karmaGood and karmaBad causes issue. I changed these to blank, and presto.. it worked. If anyone else is having the same problem, try this sql query is phpmyadmin:
SELECT realName, karmaGood, karmaBad, ID_MEMBER, karmaGood - karmaBad as karmaTotal FROM smf_members ORDER BY karmaTotal DESC
if karmaTotal is returning a value of around 10000000000000.. then you've got the same problem i had!
Because user have "negatif" Karma you have this result
do you have many user with more bad karma than good karma ?
in my forum, i have only 2 users where karmaGood-karmaBad < 0 then i "cheat" : i take in my DB: 20 result but i display only (it's a Top Ten) 10 result where the karmaTotal is > 0 ;)
that i use :
// Karma Package V0.4
// Top Karma Block
// Created By Maxâ„¢ - Leave Credits!
function ssi_topkarma($topkarma = 3, $output_method = 'echo')
{
global $context, $settings, $options, $txt, $scripturl, $db_prefix;
echo '
<table border="0" cellpadding="0" cellspacing="2" width="100%"> ';
$karma_results = db_query("SELECT realName, karmaGood, karmaBad, ID_MEMBER FROM {$db_prefix}members ORDER BY (karmaGood-karmaBad) DESC LIMIT 20", __FILE__, __LINE__);
$context['htkarma'] = array();
while( $row_karma = mysql_fetch_assoc($karma_results) )
{
$context['htkarma'][] = array(
'Link' => '<a href="' . $scripturl . '?action=profile;u=' . $row_karma['ID_MEMBER'] . '">' . $row_karma['realName'] . '</a>',
'Good' => $row_karma['karmaGood'],
'Bad' => $row_karma['karmaBad']
);
}
mysql_free_result($karma_results);
$recompte=1;
echo '
<td width="100%" valign="top">';
foreach($context['htkarma'] as $htkarma)
{
$total = $htkarma['Good']-$htkarma['Bad'];
if (($recompte<=10) && ($total>=0)) {
echo '
<table border="0" cellpadding="0" cellspacing="3" width="100%">
<td> '.$htkarma['Link'].'</td><td width="20%" align="right"><font color="'. $txt['karma_applaud_color'] .'"> '.$total.'</font>
</td></table>';
$recompte++;
}
}
echo '</td></tr></table>';
}
I know it's not the best code to solve this problem but it work ;)
PS: Sorry for my English.
Soph. KarmaGood - KarmaBad was returning a positive figure of over 1000000, putting them at the top. THe ONLY way i could find to fix it was to change the database schema itself.
and yeah.. i have about a 50/50 ratio of positives to negatives. Its a very opinionated board!
Quote from: Roar_Fan on January 23, 2007, 09:13:33 PM
Soph. KarmaGood - KarmaBad was returning a positive figure of over 1000000
yeah i have same result that what i use my code.
But if you have many user with karmaBad more than theire karmaGood, my code is'nt good to solve the problem.
QuoteTHe ONLY way i could find to fix it was to change the database schema itself.
i think it's better, add a row karmatotal to smf_members and update it in source code when user add or remove karma.
Quote from: Roar_Fan on January 23, 2007, 09:13:33 PM
Soph. KarmaGood - KarmaBad was returning a positive figure of over 1000000, putting them at the top. THe ONLY way i could find to fix it was to change the database schema itself.
and yeah.. i have about a 50/50 ratio of positives to negatives. Its a very opinionated board!
It's presenting it as a large positive because of unsigned integer wraparound.
uint(1) - uint(2) is usually not presented as -1 but as the integer limit in the positive direction (unsigned MEANS no sign, no positive, no negative and results are most often given in the same data type as the arguments).
Hey!!
Thanks for this Mod, it kicks ass for anyone who wants to get more with Karma.
Well i give in return my block:
echo '<img src="http://YOUR SITE/Themes/YOUR THEME/images/TPdivider.gif"> <font size="1pt" face="Verdana">Últimos Classificados:</font>';
echo '<hr>';
ssi_karmalog(6);
echo '<br>';
echo '<img src="http://YOUR SITE/Themes/YOUR THEME/images/up.gif"> <font size="1pt" face="Verdana">Membros + <font color="green">Aplaudidos</font>:</font>';
echo '<hr>';
ssi_topkarma(5);
echo '<br>';
echo '<img src="http://YOUR SITE/Themes/YOUR THEME/images/down.gif"> <font size="1pt" face="Verdana">Membros + <font color="red">Avisados</font>:</font>';
echo '<hr>';
ssi_lowestkarma(5);
It's in Portuguese but you can change to whatever you want in order suit to your site.
Does anyone know if it is possible to keep a log or to track who's giving who Karma? I think I have users padding their friends' Karma and I'd like to kind of keep an eye on it.
I think the best bet to get an answer is to ask on simplemachines.org and the mod board there.
I havent read or heard of anything like that in here though :-\
Thanks! :)
look here but its not been updated for a while http://custom.simplemachines.org/mods/index.php?mod=127
Thank you for you quick responses guys! :)
QuoteThe package you are trying to download or install is either corrupt or not compatible with this version of SMF.
Yeah :-\ I don't think it's compatable with the latest versions of SMF. That looks to be exactly what I'm needing too unfortunatley.
Have you checked this one ?
http://custom.simplemachines.org/mods/index.php?mod=192
I was just about to point to that one, G6.
I believe that the original Karma Log mod is no longer supported as the developer felt that the Karma Description mod did everything his did and more.
A believe that's updated through 1.1.1 (if at 1.1.2, you might need to tweak the package).
Is it possible to make a block that will show your true karma count?
For example I have 10 positive karma and 9 positive karma. So it shows that im 10 positive karma in the top karma.
But in reality my karma is really only "1" since i got 9 positive?
Does anyone have code.
Jd
Quote from: J.A.Cortina on February 22, 2007, 04:15:00 PM
I was just about to point to that one, G6.
I believe that the original Karma Log mod is no longer supported as the developer felt that the Karma Description mod did everything his did and more.
A believe that's updated through 1.1.1 (if at 1.1.2, you might need to tweak the package).
Except the Karma Description Mod is really picky, all the moons of jupiter have to be in alignment with the stars of the galaxy in order to get it to install. I just liked the simple little karma log that we could keep on our site, just for admins to see, nothing bulky and huge and invasive.
I hope someone can figure it out for 1.1.2 because I don't know the first thing :P
I get this when trying to install on SMF 1.1.3 with TP .9:
The package you are trying to download or install is either corrupt or not compatible with this version of SMF.
sorry, I am found karma code...