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 10:57 am

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

We also have great domain names for your next website. Go through the list and make an offer now!

Shopping for a new website? See our design deals.

How much is your website worth? Get a free estimate.

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
  2. Post a review.- Posting a good review about this site could help us provide improved support.

Thank You!
User avatar
admin
Site Admin
 
Posts: 479
Joined: Sun Jan 12, 2014 11:18 pm
Location: New York City

Return to PhpBB 3.0.XX

Who is online

Users browsing this forum: No registered users and 0 guests

cron