It is currently 20 Feb 2018, 23:07

Anything GoesI wanted to add the ability award poster points (Showcase | Slideshow)

Anything, almost anything at all
(even advertisement if it's decent, spammers will be banned)
Post Reply
User avatar
tim

Administrator
View: Showcase | Slideshow
Topic Posts: 2/2
Posts: 2162
Joined: 26 Sep 2016, 00:16
Cash on hand: 7,946.37 GLP
Bank: 51,356.25 GLP
Gender: Guy
Location: Victoria, BC
Website: https://gimplearn.net
Operating System: Windows
GIMP Version: 2.8.22
My Personal Blog
My FineArtAmerica
x 1207
x 258
Contact:
Canada

I wanted to add the ability award poster points

Post#1 by tim » 18 May 2017, 15:52


In the Ultimate Points extension.
Users can pay a certain number of points for downloading but those points are just taken away and not stored anywhere.
I wanted to add those points to the attachment poster's account.
So this is what i did.
in ext/dmzx/ultimatepoints/event/listener.php file
I found a method called
public function download_file_send_to_browser_before($event)
I added the line

Code: Select all

$poster_id = (int) $event['attachment']['poster_id'];
in the beginning of method
Then right below

Code: Select all

$this->functions_points->substract_points($this->user->data['user_id'], $forum_cost);
I added the below code

Code: Select all

#added by Tin Tran to reward poster with points.
$this->functions_points->add_points($poster_id, $forum_cost);
So that's good I tested and it works.
0 x



aka Tin
Image gimplearn.net                                              

Registered members enjoy ads-free content
User avatar
tim

Administrator
View: Showcase | Slideshow
Topic Posts: 2/2
Posts: 2162
Joined: 26 Sep 2016, 00:16
Cash on hand: 7,946.37 GLP
Bank: 51,356.25 GLP
Gender: Guy
Location: Victoria, BC
Website: https://gimplearn.net
Operating System: Windows
GIMP Version: 2.8.22
My Personal Blog
My FineArtAmerica
x 1207
x 258
Contact:
Canada

Post#2 by tim » 19 May 2017, 20:04


I have changed this so that now
If you're logged in and have enough points it'll transfer 10 points to the poster (per download).
If you're not logged in or don't have enough points, you'll just download the file with no points transferred.
0 x



aka Tin
Image gimplearn.net                                              

Post Reply

Last 20 Members Who Visited This Topic

  • Similar Topics
    Replies
    Views
    Last post
• Featuring Members' Works (Image Attachments Only) •
1: Conbagui
2: oldmangrumpy
3: Issabella
4: RJKD
5: Ella
6: Pat625
7: oldmangrumpy

Who is online

Users browsing this forum: No registered users and 1 guest