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

Recent

Welcome to TinyPortal. Please login or sign up.

April 25, 2024, 09:43:20 PM

Login with username, password and session length
Members
  • Total Members: 3,885
  • Latest: Growner
Stats
  • Total Posts: 195,173
  • Total Topics: 21,219
  • Online today: 319
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online

Karma Leaders Block

Started by Xarcell, October 25, 2005, 03:48:23 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bloc

duh..I totally forgot about this. I will see if I can put something together.

Nokonium


ontap

#12
dunno if this helps... i have it in "Statistics Center"
if your intrested heres how...

Open:
Themes\Default\Stats.template.php

Find:
echo'</tr></td><tr><td class="catbg" colspan="4"><b>', $txt['smf_stats_5'], '</b></td>

Before Add:

if( $modSettings['karmaMode'] == 1 )
{
echo '<tr>
<td class="catbg" colspan="2">Highest Karma Total</td>
<td class="catbg" colspan="2">Lowest Karma Total</td>
</tr>
<tr>
<td class="windowbg" colspan="1">
<img src="'. $settings['images_url']. '/stats_posters.gif" width="20" height="20" />
</td>
<td class="windowbg2">';

foreach($context['htkarma'] as $htkarma)
{
$total = $htkarma['Good'] - $htkarma['Bad'];
echo '<table border="0" cellpadding="1" cellspacing="0" width="100%"><tr>
<td class="windowbg2" width="80%" align="left">'.
$htkarma['Link']
.'</td>
<td class="windowbg2" width="20%" align="right">'.$total.'</td>
</tr></table>';
}

echo'</td><td class="windowbg" colspan="1">
<img src="'. $settings['images_url']. '/stats_posters.gif" width="20" height="20" />
</td>
<td class="windowbg2">';


foreach($context['ltkarma'] as $ltkarma)
{
$total = $ltkarma['Good'] - $ltkarma['Bad'];
echo '<table border="0" cellpadding="1" cellspacing="0" width="100%"><tr>
<td class="windowbg2" width="80%" align="left">'.
$ltkarma['Link']
.'</td>
<td class="windowbg2" width="20%" align="right">'.$total.'</td>
</tr></table>';
}
}

if( $modSettings['karmaMode'] == 2)
{
echo '<tr>
<td class="catbg" colspan="2">Highest Karma Rating</td>
<td class="catbg" colspan="2">Lowest Karma Rating</td>
</tr>
<tr>
<td class="windowbg" colspan="1">
<img src="'. $settings['images_url']. '/stats_posters.gif" width="20" height="20" />
</td>
<td class="windowbg2">';

foreach($context['gkarma'] as $gkarma)
{
echo '<table border="0" cellpadding="1" cellspacing="0" width="100%"><tr>
<td class="windowbg2" width="80%" align="left">'.
$gkarma['Link']
.'</td>
<td class="windowbg2" width="20%" align="right">+'.$gkarma['Karma'].'</td>
</tr></table>';
}

echo'</td><td class="windowbg" colspan="1">
<img src="'. $settings['images_url']. '/stats_posters.gif" width="20" height="20" />
</td>
<td class="windowbg2">';

foreach($context['bkarma'] as $bkarma)
{
echo '<table border="0" cellpadding="1" cellspacing="0" width="100%">
<tr valign="top"><td class="windowbg2" width="80%" align="left">'.
$bkarma['Link']
.'</td>
<td class="windowbg2" width="20%" align="right">-'.$bkarma['Karma'].'</td>
</tr></table>';
}
}


Works with SMF 1.0.5 not sure about SMF 1.1

.. a block with maybe the top 5 highest or lowest karma would be great,
ill try and do one if i can...

Nokonium

Thanks for the try Ontap, I've got that as well in 1.0.5 but it doesn't work in 1.1RC2. If I just paste it straight into a php block I get

Parse error: parse error, unexpected T_STRING in /homepages/########/htdocs/Fiddlers-Elbow/Sources/Load.php(1606) : eval()'d code(32) : eval()'d code on line 78

G_STRING's I know about, but T_STRING's  :-\

Mitch

Let me know if anything comes of this I am interested.

Nokonium

You can change any block name to whatever you want in the block admin. Within SMF you can call the Karma whatever you want. We use Bogle Points and the admins 'award' them for acts of stupidity.

Mitch

I am thinking what he meant was when you call up the function that it wont say something like:

Top Five Karma Leaders:
Bloc
>>Crip<<
IchBintm
borgBob
GerryMo

I am pretty sure Twin knows that he knows he can change the title of the block.

Or I could be totally wrong.

crip

Quote from: nokonium on March 15, 2006, 12:25:38 PM
You can change any block name to whatever you want in the block admin. Within SMF you can call the Karma whatever you want. We use Bogle Points and the admins 'award' them for acts of stupidity.

Lmao ;D

Nokonium

Quote from: Mitch on March 15, 2006, 12:53:41 PM
I am thinking what he meant was when you call up the function that it wont say something like:

Top Five Karma Leaders:
Bloc
>>Crip<<
IchBintm
borgBob
GerryMo

I am pretty sure Twin knows that he knows he can change the title of the block.

Or I could be totally wrong.
I would doubt if that would be hard coded, if it is you change it in the file, more likely to be "Top Five ['karma'] Leaders:" or similar. As what you call it is already defined in SMF, I'd expect someone creating a Karma block to use it.