Sorry for not adding all these ideas in one topic, they come to me at different times.
Again, this may already be a feature, I dunno, I'm not a tester.
How about a Karma Leaders block. Show 5-10 top users with the most karma.
That can be done I think..anyone else want this?
There was an SMF 1.0.5 Tip and Trick, that I use on Our-Local that added code to (iirc) who, that added highest and lowest Karma stats to the stats page, I haven't seen it for 1.1. To have highest or lowest displaying in a block would be a neat addition.
id be intrested.
maybe also for users of the smf shop mod, a top 10 cash and top 10 banked cash members like they have when you hit the shop button? i'm not sure if the smf shop mod works well or at all with tp, or if its even compatible with rc1 :)
someone should remake it lol only this time let admins choose whats for sale! :)
the shop mod need to be redone drastically to at least make it feel like the IPB one. installing the shop doesn't feel like it's worth it, especially if those are the only items on sale.
and also, it doesn't work with rc1.
and then it can be combioned with the vbuletting badge system ( i wish i had that one)
shop mod does need an overhaul.
badge system?
Quote from: Moocat on October 26, 2005, 02:33:18 AM
badge system?
yeah they badges underneath their avatar. and stuff.
Any progress on a Karma block?
duh..I totally forgot about this. I will see if I can put something together.
Thanks Bloc
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...
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 :-\
Let me know if anything comes of this I am interested.
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.
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.
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
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.
Quote from: ÂÃ,»cripÂÃ,« on March 15, 2006, 12:57:20 PM
Lmao ;D
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.nokonium.plus.com%2FDr_Fuss-Bogle%2FYou%2520have%2520been%2Fbp-asking.gif&hash=894812982a754103966b78e1d3dd98a5960c7d4c)
I've been fiddling for the last couple of hours trying to do a Karma Totals block based on the SMF code from Tau Online and now I'm stuck.
I have this added to Stats.php
// Top 5 Karma Rating
$karma_results = db_query("
SELECT realName, karmaGood, ID_MEMBER FROM {$db_prefix}members ORDER BY karmaGood DESC LIMIT 5", __FILE__, __LINE__);
$context['karma'] = array();
while( $row_karma = mysql_fetch_assoc($karma_results) )
{
$context['gkarma'][] = array(
'Karma' => $row_karma['karmaGood'],
'Link' => '<a href="' . $scripturl . '?action=profile;u=' . $row_karma['ID_MEMBER'] . '">' . $row_karma['realName'] . '</a>'
);
}
// Bottom 5 Karma Rating
$karma_results = db_query("
SELECT realName, karmaBad, ID_MEMBER FROM {$db_prefix}members ORDER BY karmaBad DESC LIMIT 5", __FILE__, __LINE__);
$context['bkarma'] = array();
while( $row_karma = mysql_fetch_assoc($karma_results) )
{
$context['bkarma'][] = array(
'Link' => '<a href="' . $scripturl . '?action=profile;u=' . $row_karma['ID_MEMBER'] . '">' . $row_karma['realName'] . '</a>',
'Karma' => $row_karma['karmaBad']
);
}
// Highest Total Karma
$karma_results = db_query("
SELECT karmaGood, karmaBad, realName, ID_MEMBER FROM {$db_prefix}members ORDER BY (karmaGood-karmaBad) DESC LIMIT 5", __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']
);
}
// Lowest karma total
$karma_results = db_query("
SELECT karmaGood, karmaBad, realName, ID_MEMBER FROM {$db_prefix}members ORDER BY (karmaGood-karmaBad) ASC LIMIT 5", __FILE__, __LINE__);
$context['ltkarma'] = array();
while( $row_karma = mysql_fetch_assoc($karma_results) )
{
$context['ltkarma'][] = array(
'Link' => '<a href="' . $scripturl . '?action=profile;u=' . $row_karma['ID_MEMBER'] . '">' . $row_karma['realName'] . '</a>',
'Good' => $row_karma['karmaGood'],
'Bad' => $row_karma['karmaBad']
);
}
And when this is added to Stats.template.php
if( $modSettings['karmaMode'] == 1 )
{
echo '<tr>
<td class="catbg" colspan="2">Well Bogled</td>
<td class="catbg" colspan="2">Goody Two Shoes</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>';
}
}
echo'</tr></td><tr><td class="catbg" colspan="4"><b>', $txt['smf_stats_5'], '</b></td>
Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, </tr>
<tr>
Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, <td class="windowbg" width="20" valign="middle" align="center"><img src="', $settings['images_url'], '/stats_history.gif" border="0" width="20" height="20" alt="" /></td>
Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, Ã, <td class="windowbg2" colspan="4">';
It works on SMF 1.1RC2 with TP 0.86b installed.
So having already got code added to Stats.php I set about adapting the code for a block. I've trimmed it down to just Karma Totals (I think) and stopped it messing up the other blocks, but I can't get the totals to display.
echo '<div style="padding: 5px;" class="smalltext">';
global $context, $settings, $options, $scripturl, $txt, $modSettings;
if( $modSettings['karmaMode'] == 1 )
{
'<table><tr><td class="windowbg2"Ã, width="80%" align="left">';
foreach($context['htkarma'] as $htkarma)
{
$total = $htkarma['Good'] - $htkarma['Bad'];'</td>
<td class="windowbg2" width="20%" align="right">'.$total.'</td>
</tr></table>';
}
}
echo '</div>';
I think I may need to 'require Stats.php' but when I try to I get a fatal error. Would adding Tau Online's code to TPortal.php work and if so where should it be put?
Where's your echo's?
echo '<div style="padding: 5px;" class="smalltext">';
global $context, $settings, $options, $scripturl, $txt, $modSettings;
if( $modSettings['karmaMode'] == 1 )
{
echo '<table><tr><td class="windowbg2" width="80%" align="left">';
foreach($context['htkarma'] as $htkarma)
{
$total = $htkarma['Good'] - $htkarma['Bad'];
echo '</td><td class="windowbg2" width="20%" align="right">'.$total.'</td></tr></table>';
}
}
echo '</div>';
Quote from: IchBinâ„¢ on March 21, 2006, 07:17:33 PM
Where's your echo's?
(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.nokonium.plus.com%2Fblack-cat%2Fsurprised%2Fconfused4.gif&hash=fc7d9c07085e67ae8df886a5b44c1e6898354065)
I think IchBin alterd the code and put in some echos ;)
Seems like it in his post :D
Yes, sorry. I posted what I thought the php code should look like.
Ooops, sorry head like a turnip today. Thanks, I'll try it
Parse error: parse error, unexpected T_CLASS in /homepages/6/d119724375/htdocs/Fiddlers-Elbow/Sources/Load.php(1613) : eval()'d code(46) : eval()'d code on line 12
Off to fiddle ...
echo' <table
Messes up the left sidebar blocks
Maybe try setting some sizes on your tables or something. Its hard to say when I can't fiddle myself. :)
i will make a karma block... leave it with me ;)
Quote from: IchBinâ„¢ on March 22, 2006, 12:57:26 AM
Maybe try setting some sizes on your tables or something. Its hard to say when I can't fiddle myself. :)
I went the other way and got rid of the tables, but still a blank block.
echo '<div style="padding: 5px;" class="smalltext">';
global $context, $settings, $options, $scripturl, $txt, $modSettings;
if( $modSettings['karmaMode'] == 1 )
{
echo '<span class="windowbg2" width="80%" align="left">';
foreach($context['htkarma'] as $htkarma)
{
$total = $htkarma['Good'] - $htkarma['Bad'];'</span>';
echo '<span class="windowbg2" width="20%" align="right">'.$total.'</span>';
}
}
echo '</div>';
Quote from: OnTap! on March 22, 2006, 05:07:13 AM
i will make a karma block... leave it with me ;)
Thanks that is really appreciated ;D
Quote from: nokonium on March 22, 2006, 06:57:38 AM
Thanks that is really appreciated ;D
http://www.tinyportal.net/smf/index.php?topic=3630.0 ;)