TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

May 17, 2024, 08:08:46 PM

Login with username, password and session length
Members
  • Total Members: 3,886
  • Latest: Grendor
Stats
  • Total Posts: 195,189
  • Total Topics: 21,220
  • Online today: 107
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online

Karma Blocks Package v0.4

Started by ontap, March 22, 2006, 11:43:17 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

elpvn


alan s

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?

Nokonium

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>';
}

G6Cad

Got it working :)
Thanks a lot for this snippet OnTapÂÃ,©

Nokonium

Supplementary info

Webhost php version is 5.1

ontap

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?

Nokonium

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. 

Xarcell

Ultra Cool, thanks a TON dude...

Chodhry

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

ontap

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 Log
ssi_karmalog();
Lowest Karma
ssi_lowestkarma();
Top Karma
ssi_topkarma();