Warning: The author of this contribution does not provide support for it anymore.

Thanks for posts

Thanks for posts and Ultimate points - Thanks for posts

Thanks for posts and Ultimate points

by DennyTX » Thu Sep 02, 2010 7:11 pm

well, one small hint. working 4 me.
(ultimate points mod required)

very simple code additions. allowing to add poins if admin give thanks. (remove IF construction if u want to allow points adds when anybody thanks post)

in functions_thanks.php

1. find (add thanks)

Code: Select all

         $sql = 'INSERT INTO ' . THANKS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
            'user_id'   => $user_id,
            'post_id'   => $post_id,
            'poster_id'   => $to_id,
            'topic_id'   => $row['topic_id'],
            'forum_id'   => $row['forum_id'],
            'thanks_time'   => time()
         ));
         $db->sql_query($sql);


insert after

Code: Select all

if ($user_id == 2)
    {
    $thanks_points=10;
      $sql = "UPDATE " . USERS_TABLE . "
               SET user_points = user_points + $thanks_points
               WHERE user_id = $to_id" ;
      $db->sql_query($sql);
    }


2. find (off)

Code: Select all

         $sql = "DELETE FROM " . THANKS_TABLE . '
            WHERE post_id ='. (int) $post_id ." AND user_id = " . $user->data['user_id'];
         $db->sql_query($sql);   

insert after

Code: Select all

if ($user_id == 2)
    {
    $thanks_points=10;
      $sql = "UPDATE " . USERS_TABLE . "
               SET user_points = user_points - $thanks_points
               WHERE user_id = $to_id" ;
      $db->sql_query($sql);
    }


where $thanks_points=10; - points for action
User avatar
DennyTX
Registered User
Posts: 9
Joined: Thu Mar 25, 2010 8:50 am
Contact:

Re: Thanks for posts and Ultimate points

by Палыч » Thu Nov 04, 2010 9:57 am

Sorry for my bad english
User avatar
Палыч
Translator
Posts: 1543
Joined: Sun Jul 01, 2007 7:59 pm
Location: St. Petersburg
Name: Сергей
Contact:

Re: Thanks for posts and Ultimate points

by reptilerob » Fri Feb 18, 2011 8:15 pm

DennyTX wrote:well, one small hint. working 4 me.
(ultimate points mod required)

very simple code additions. allowing to add poins if admin give thanks. (remove IF construction if u want to allow points adds when anybody thanks post)

in functions_thanks.php

1. find (add thanks)

Code: Select all

         $sql = 'INSERT INTO ' . THANKS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
            'user_id'   => $user_id,
            'post_id'   => $post_id,
            'poster_id'   => $to_id,
            'topic_id'   => $row['topic_id'],
            'forum_id'   => $row['forum_id'],
            'thanks_time'   => time()
         ));
         $db->sql_query($sql);


insert after

Code: Select all

if ($user_id == 2)
    {
    $thanks_points=10;
      $sql = "UPDATE " . USERS_TABLE . "
               SET user_points = user_points + $thanks_points
               WHERE user_id = $to_id" ;
      $db->sql_query($sql);
    }


2. find (off)

Code: Select all

         $sql = "DELETE FROM " . THANKS_TABLE . '
            WHERE post_id ='. (int) $post_id ." AND user_id = " . $user->data['user_id'];
         $db->sql_query($sql);   

insert after

Code: Select all

if ($user_id == 2)
    {
    $thanks_points=10;
      $sql = "UPDATE " . USERS_TABLE . "
               SET user_points = user_points - $thanks_points
               WHERE user_id = $to_id" ;
      $db->sql_query($sql);
    }


where $thanks_points=10; - points for action


I like this is there ant way to get it to give points to any one who give thanks
reptilerob
Registered User
Posts: 59
Joined: Sun Sep 12, 2010 11:23 pm
Contact:

Re: Thanks for posts and Ultimate points

by Палыч » Mon Feb 21, 2011 8:28 pm

reptilerob send PM to DennyTX
Sorry for my bad english
User avatar
Палыч
Translator
Posts: 1543
Joined: Sun Jul 01, 2007 7:59 pm
Location: St. Petersburg
Name: Сергей
Contact:

Re: Thanks for posts and Ultimate points

by reptilerob » Wed Feb 23, 2011 1:25 am

Did that and no reply back yet.
reptilerob
Registered User
Posts: 59
Joined: Sun Sep 12, 2010 11:23 pm
Contact:

Re: Thanks for posts and Ultimate points

by minoumimi » Sat Jul 12, 2014 7:28 am

sorry this post is old but it is the only one around and it works

Solution To allow Anyone to Give points you have to do

if ($user_id) simply remove the * == 2 *

you can also give more points i like to set it to 50 since people Barely ever give likes,
i want it to really matter now
so u could change $thanks_points=50;

Now i am trying to figure out a way that it would give the VOTER points has well
anyone has an idea for that?
minoumimi
Registered User
Posts: 22
Joined: Thu Jul 03, 2014 7:21 am
Contact:

Re: Thanks for posts and Ultimate points

by niwes » Sat Aug 08, 2015 11:51 pm

old post but awesome ;)

i used the AjaxAddon viewtopic.php?f=70&t=2091416
and will dont work in my forum
any solution?
niwes
Registered User
Posts: 30
Joined: Fri Feb 22, 2013 12:48 am
Contact: