Welcome, Guest. Please Login or Register.
May 09, 2025, 02:45:22 AM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Karma Rating on Profile « previous next »
Pages: [1] Reply Ignore Print
Author Topic: Karma Rating on Profile  (Read 388 times)
PioneeR
Llama Hunter
YaBB God
*****
Posts: 767


Karma Rating on Profile
« on: December 25, 2002, 12:09:49 PM »
Reply with quote

How could this be done? My members are quite click happy and I know they would like to karma people from the profile page.

Logged
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:Karma Rating on Profile
« Reply #1 on: December 25, 2002, 12:47:09 PM »
Reply with quote

That wouldn't be hard....

<file>
Sources/Profile.php
</file>
<search>
   elseif ($settings[7] == 'Administrator' && $modSettings['karmaMode'] != 0)
   {
      $karmaStr = ",karmaGood='$member[karmaGood]',karmaBad='$member[karmaBad]'";
   }
   if(!is_numeric($member['settings6'])) { fatal_error("$txt[749]"); }
   $user = $member['user'];
</search>

<add after>
   if ($settings[6] >= $modSettings['karmaMinPosts'] && ($modSettings['karmaMemberGroups'][0]=='' || (sizeof($modSettings['karmaMemberGroups'])>=1 && in_array($settings[7],$modSettings['karmaMemberGroups'])) || $settings[7] == 'Administrator' || $settings[7] == 'Global Moderator') && $modSettings['karmaMode'] != '0' && $username!='Guest' && $username != $user)
   {
      $karmaString .= "<br><a href=\"$scripturl?action=modifykarma;karmaAction=applaud;uid={$userprofile[$user]['ID_MEMBER']}\">$modSettings[karmaApplaudLabel]</a> <a href=\"$scripturl?action=modifykarma;karmaAction=smite;uid={$userprofile[$user]['ID_MEMBER']}\">$modSettings[karmaSmiteLabel]</a>";
   }
</add after>

That would do the trick, would you say?

I'll write up a .mod and .mod.yp after I open my Christmas presents.

-[Unknown]
Logged
PioneeR
Llama Hunter
YaBB God
*****
Posts: 767


Re:Karma Rating on Profile
« Reply #2 on: December 25, 2002, 01:03:51 PM »
Reply with quote

Tried the above. Didnt cause any errors.. but I dont get the option either  ???
Logged
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:Karma Rating on Profile
« Reply #3 on: December 25, 2002, 07:31:09 PM »
Reply with quote

typo....

this part
!= $user)
   {
      $karmaString .= "<br><a href=\"$scripturl?action=modifykarma;karmaAction=applaud;uid={$userprofile

of the replacement string should be

!= $user)
   {
      $karmaStr .= "<br><a href=\"$scripturl?action=modifykarma;karmaAction=applaud;uid={$userprofile

Sorry.
Logged
PioneeR
Llama Hunter
YaBB God
*****
Posts: 767


Re:Karma Rating on Profile
« Reply #4 on: December 26, 2002, 10:56:20 AM »
Reply with quote

Hi,
I have changed the $karmastring to $karmaStr doesnt cause any errors but I dont see the option to change the karma either  ???
Logged
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:Karma Rating on Profile
« Reply #5 on: December 26, 2002, 11:22:33 AM »
Reply with quote

Sorry, I completely messed up... that was in /modify profile/...

here:
<search>
   if ($modSettings['karmaMode'] == '1')
      $karmastr = '
            <td>
               <font size="2"><b>' . $modSettings['karmaLabel'] . ' </b></font>
            </td><td>
               <font size="2">' . ($memsettings[23] - $memsettings[22]) . '</font>
            </td>
         </tr><tr>';
   elseif ($modSettings['karmaMode'] == '2')
      $karmastr = '
            <td>
               <font size="2"><b>' . $modSettings['karmaLabel'] . ' </b></font>
            </td><td>
               <font size="2">+' . $memsettings[23] . '/-' . $memsettings[22] . '</font>
            </td>
         </tr><tr>';
</search>

<add after>
  if ($settings[6] >= $modSettings['karmaMinPosts'] && ($modSettings['karmaMemberGroups']
=='' || (sizeof($modSettings['karmaMemberGroups'])>=1 && in_array($settings[7],$modSettings['karmaMemberGroups'])) || $settings[7] == 'Administrator' || $settings[7] == 'Global Moderator') && $modSettings['karmaMode'] != '0' && $username!='Guest' && $username != $user)
   {
      $karmaString .= "<br><a href=\"$scripturl?action=modifykarma;karmaAction=applaud;uid={$userprofile[$user]['ID_MEMBER']}\">$modSettings[karmaApplaudLabel]</a> <a href=\"$scripturl?action=modifykarma;karmaAction=smite;uid={$userprofile[$user]['ID_MEMBER']}\">$modSettings[karmaSmiteLabel]</a>";
   }
</add after>

Okay, that should work in the publically displayed profile.

-[Unknown]
Logged
PioneeR
Llama Hunter
YaBB God
*****
Posts: 767


Re:Karma Rating on Profile
« Reply #6 on: December 26, 2002, 11:45:44 AM »
Reply with quote

That does display it  ;D

It doesnt seem to pass over uid though.

Seems to work though  ;D
Logged
PioneeR
Llama Hunter
YaBB God
*****
Posts: 767


Re:Karma Rating on Profile
« Reply #7 on: December 26, 2002, 11:59:10 AM »
Reply with quote

just had to add

$userprofile[$user] = array();
$userprofile[$user]['ID_MEMBER'] = $memsettings['20'];

before that code..

all is working fine now
Logged
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:Karma Rating on Profile
« Reply #8 on: December 26, 2002, 12:04:34 PM »
Reply with quote

Sorry, I've never played with karma before....

-[Unknown]
Logged
PioneeR
Llama Hunter
YaBB God
*****
Posts: 767


Re:Karma Rating on Profile
« Reply #9 on: December 26, 2002, 12:05:44 PM »
Reply with quote

Thanks for all your help.

My members are happy now  ;D
Logged
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  Karma Rating on Profile « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.034 seconds with 21 queries.