Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 12357
Latest: cyntholsns01
New This Month: 0
New This Week: 1
New Today: 0
Stats
Total Posts: 40080
Total Topics: 7056
Most Online Today: 91
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 1
Guests: 40
Total: 41

Author Topic: Karma Option update  (Read 3547 times)

0 Members and 1 Guest are viewing this topic.

Offline Empire

  • Newbie
  • *
  • Posts: 48
    • View Profile
Karma Option update
« on: May 03, 2015, 02:26:59 am »
I have updated my Karma option, Improved it more for the posts on the forums. I have the Karma Description Mod. From the images you see I have up and down images.

Anyway I wanted that option for the comments in the Gallery pro and the download pro to. So that way it does not look blend. it will look all the same 

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15041
    • View Profile
Re: Karma Option update
« Reply #1 on: May 05, 2015, 01:29:33 pm »
You would need to modify gallery.template.php and downloads.template.php and find the code that displays the profilebox then change it to the same code that the karma mod is using.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline Empire

  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: Karma Option update
« Reply #2 on: May 06, 2015, 12:05:23 am »
You would need to modify gallery.template.php and downloads.template.php and find the code that displays the profilebox then change it to the same code that the karma mod is using.
Found it alright and changed it, but The images does not show or it works.

I have not done the Download pro just Yet
Code: [Select]
// Is karma display enabled?  Total or +/-?
      if ($modSettings['karmaMode'] == '1')
         echo '
      <br />
      ', $modSettings['karmaLabel'], ' ', $memberContext[$memCommID]['karma']['good'] - $memberContext[$memCommID]['karma']['bad'], '<br />';
      elseif ($modSettings['karmaMode'] == '2')
         echo '
      <br />
      ', $modSettings['karmaLabel'], ' +', $memberContext[$memCommID]['karma']['good'], '/-', $memberContext[$memCommID]['karma']['bad'], '<br />';

      // Is this user allowed to modify this member's karma?
      if ($memberContext[$memCommID]['karma']['allow'])
         echo '
      <a href="', $scripturl, '?action=modifykarma;sa=applaud;uid=', $memberContext[$memCommID]['id'], ';sesc=', $context['session_id'], '">', $modSettings['karmaApplaudLabel'], '</a>
      <a href="', $scripturl, '?action=modifykarma;sa=smite;uid=', $memberContext[$memCommID]['id'],  ';sesc=', $context['session_id'], '">', $modSettings['karmaSmiteLabel'], '</a><br />';

And this is what I added.

Code: [Select]
// Is karma display enabled?  Total or +/-?

            $context['show_karmastat'] = allowedTo('karmalog_view') && empty($modsettings['karmapermiss']);

         if ($modSettings['karmaMode'] == '1')
            echo '
                        <li class="karma">', (!empty($modSettings['karmadescmod']) && !empty($modSettings['karmalabellink']) && $context['show_karmastat']) ? '<a href="'. $scripturl . '?action=ownkarma;u='. $message['member']['id'] .'">'. $modSettings['karmaLabel'] .'</a>' : $modSettings['karmaLabel'] ,' ', $message['member']['karma']['good'] - $message['member']['karma']['bad'], '</li>';

         elseif ($modSettings['karmaMode'] == '2')
            echo '
                        <li class="karma">', (!empty($modSettings['karmadescmod']) && !empty($modSettings['karmalabellink']) && $context['show_karmastat']) ? '<a href="'. $scripturl . '?action=ownkarma;u=' . $message['member']['id'] . '">'.$modSettings['karmaLabel'].'</a>' : $modSettings['karmaLabel'] ,  ' +', $message['member']['karma']['good'], '/-', $message['member']['karma']['bad'], '</li>';


         // Is this user allowed to modify this member's karma?
         if ($message['member']['karma']['allow'])
            echo '
                        <li class="karma_allow">
                           <a href="', $scripturl, '?action=modifykarma;sa=applaud;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.' . $context['start'], ';m=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $modSettings['karmaApplaudLabel'], '</a>
                           <a href="', $scripturl, '?action=modifykarma;sa=smite;uid=', $message['member']['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';m=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $modSettings['karmaSmiteLabel'], '</a>
                        </li>';

Offline Empire

  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: Karma Option update
« Reply #3 on: May 06, 2015, 12:08:22 am »
Just an remainder that it needs to work with the Karma Statistic, so if anyone hit the up... I can see who like what image and so on. If that option works


Thanks

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 15041
    • View Profile
Re: Karma Option update
« Reply #4 on: May 06, 2015, 08:14:53 am »
Replace all
Code: [Select]
$message['member']
With
Code: [Select]
$memberContext[$memCommID]
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline Empire

  • Newbie
  • *
  • Posts: 48
    • View Profile
Re: Karma Option update
« Reply #5 on: May 06, 2015, 08:14:55 pm »
Replace all
Code: [Select]
$message['member']
With
Code: [Select]
$memberContext[$memCommID]

All that did is added Dot points next to them

 

Related Topics

  Subject / Started by Replies Last post
1 Replies
4126 Views
Last post November 10, 2007, 10:05:25 pm
by SMFHacks
0 Replies
2553 Views
Last post November 19, 2007, 11:51:41 am
by jasonwatkins
1 Replies
2967 Views
Last post April 05, 2009, 08:56:50 am
by SMFHacks
9 Replies
3327 Views
Last post October 17, 2018, 11:17:16 pm
by SMFHacks
1 Replies
2624 Views
Last post March 09, 2013, 06:17:38 pm
by RC Storick

+- Recent Topics

Only variables should be passed by reference by Zaphod
Today at 01:30:09 pm

Cannot install Gallery Pro on SMF 2.1 RC2 by Hatshepsut
March 19, 2020, 12:55:00 am

Newbie questions by SMFHacks
March 08, 2020, 09:28:17 am

Update detect mobile mode PHP5 to PHP7 by Plus
March 05, 2020, 11:19:05 am

Just a hello by Plus
March 05, 2020, 11:05:56 am

Enotify Copyright Problem by SMFHacks
March 04, 2020, 09:21:09 pm

Cannot import by shawnb
March 02, 2020, 12:17:00 pm

Error message with latest SMF 2.1 Github build by Hatshepsut
March 01, 2020, 10:06:10 am

[Mod]Avatars Display Integration by SMFHacks
February 15, 2020, 07:30:47 pm

[Mod]BBC Message Boxes 1.0 by SMFHacks
February 15, 2020, 07:26:46 pm

Powered by EzPortal