SMFHacks.com

SMF Gallery Pro => Support => Topic started by: Empire on May 03, 2015, 02:26:59 am

Title: Karma Option update
Post by: Empire 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 
Title: Re: Karma Option update
Post by: SMFHacks 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.
Title: Re: Karma Option update
Post by: Empire 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>';
Title: Re: Karma Option update
Post by: Empire 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
Title: Re: Karma Option update
Post by: SMFHacks on May 06, 2015, 08:14:53 am
Replace all
Code: [Select]
$message['member']
With
Code: [Select]
$memberContext[$memCommID]
Title: Re: Karma Option update
Post by: Empire 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