AVeryNiceWeb

Allowing Users To Give Thanks For Post With Points (UPS)

Here we discuss all topic related to PHPBB 3.0 and up

Allowing Users To Give Thanks For Post With Points (UPS)

Postby admin » Wed Jun 14, 2017 2:57 pm

MOD REQUIREMENTS:
    Ultimate Point System
    Thanks For Posts

This code will allow all users to thank for posts and at the same time give an amount of points predetermined by the admin.

Go to /includes/functions_thanks.php
FIND:
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);


ADD AFTER:
Code: Select all
if ($user_id)
    {
    $thanks_points=10;
      $sql = "UPDATE " . USERS_TABLE . "
               SET user_points = user_points + $thanks_points
               WHERE user_id = $to_id" ;
      $db->sql_query($sql);
    }


FIND:
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);   


ADD AFTER:
Code: Select all
if ($user_id)
    {
    $thanks_points=10;
      $sql = "UPDATE " . USERS_TABLE . "
               SET user_points = user_points - $thanks_points
               WHERE user_id = $to_id" ;
      $db->sql_query($sql);
    }


Modify the line $thanks_points=10; to change the points value.
Done.
The AVNW Support Team
http://www.AVeryNiceWeb.com

If you wish to add visual documentation (screenshots), make a donation and we'll let you know when the post has been updated


And, if our post has provided you with great information, there are a few ways you can show your appreciation:
  1. Like us on Facebook.- Our account had recently a hacking problem on FB and we were forced to create a new one. We lost all our posts & likes. :(
  2. Send us a testimonial.- Testimonials thanking for our good team work can be valuable to us and may encourage others to seek our support.
  3. Post a review.- Posting a good review about this site could also compel others to seek our advice & support.

Thank You!
User avatar
admin
Site Admin
 
Posts: 452
Joined: Mon Jan 13, 2014 3:18 am
Location: New York City

Return to PhpBB 3.0.XX

Who is online

Users browsing this forum: No registered users and 0 guests

cron