Facebook  Twitter 

SMFHacks.com

+- +-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 12424
Latest: serbenfiquista
New This Month: 5
New This Week: 0
New Today: 0
Stats
Total Posts: 40038
Total Topics: 7046
Most Online Today: 42
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 46
Total: 46

Author Topic: Karma Option update  (Read 3488 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: 15022
    • 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: 15022
    • 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
4115 Views
Last post November 10, 2007, 10:05:25 pm
by SMFHacks
0 Replies
2526 Views
Last post November 19, 2007, 11:51:41 am
by jasonwatkins
1 Replies
2951 Views
Last post April 05, 2009, 08:56:50 am
by SMFHacks
9 Replies
3183 Views
Last post October 17, 2018, 11:17:16 pm
by SMFHacks
1 Replies
2602 Views
Last post March 09, 2013, 06:17:38 pm
by RC Storick

+- Recent Topics

Cannot install by SMFHacks
January 18, 2020, 09:40:56 pm

Call to undefined function mysql_query() by SMFHacks
January 18, 2020, 02:06:47 pm

English British Translation file by HAL9000
January 17, 2020, 05:44:28 pm

Characters dispayed as boxes by SMFHacks
January 16, 2020, 07:21:51 am

Multiple adds where one used to be? by SMFHacks
January 07, 2020, 08:20:38 am

Ribbon Theme Logo Position by slizzie1986
January 06, 2020, 08:52:31 pm

System enhancement? by SMFHacks
January 03, 2020, 09:22:45 am

Pretty Url Pro Is it compatible with 7.2? by Rock Lee
January 01, 2020, 08:53:50 pm

Order of photos by SMFHacks
December 29, 2019, 02:02:28 pm

SMF Cookie Change Compatibly by HDB
December 28, 2019, 03:33:49 pm

Powered by EzPortal