Thread Rating:
  • 10 Vote(s) - 2.7 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[For 1.8] MySubscriptions - Paid Usergroup Subscriptions (Paypal IPN)
#68
(2016-04-02, 04:53 PM)darkhk3r Wrote:
(2016-04-02, 03:35 PM)24Sevn Wrote: Could someone make this for Bitcoins too? Would really appreciate it!

https://github.com/blockchain/receive-pa...master/php


And to move the buyer to specific group:

Replace the following lines (587-589) in inc/plugins/mysubs.php
https://github.com/EthanDelong/MySubscri...#L587-L589
replace with this code, where "999" is the ID of your custom group.


// This is the ID of the custom usergroup which has all of the extra perks (Thread permissions, PM Quota, etc..)
$additional_group = 999;

$gids = explode(',', $user['additionalgroups']);

if (!in_array($additional_group, $gids)) {
    $gids[] = $additional_group;
}

$update_data = array(
    'usergroup' => intval($item['new_group']),
    'additionalgroups' => implode(',', $gids) 
); 


This will add the custom group to the user who purchases the subscription when the order is processed on your server.



If you want to remove the additional group when the subscription expires:


Replace the following line (33) in inc/tasks/mysubs.php

https://github.com/EthanDelong/MySubscri...bs.php#L33
Replace it with the following code:

$additional_group = 999;

$temp_user = get_user($sub['uid']);
$gids = explode(',', $temp_user['additionalgroups']);

if (($key = array_search($additional_group, $gids)) !== false) {
    unset($gids[$key]);
}

$db->update_query('users', array('usergroup' => $sub['old_gid'], 'additionalgroups' => implode(',', $gids)), "`uid` = {$sub['uid']}"); 
Again, "999" is the same ID of the custom group which will be removed when the subscription is automatically removed.

Okey, I've done that but where do I put in my BTC adress and stuff and where is the buy page
Reply


Messages In This Thread
RE: MySubscriptions - Paypal IPN Plugin - by Zueq - 2012-07-31, 08:47 PM
RE: MySubscriptions - Paypal IPN Plugin - by JimR - 2014-02-22, 04:10 PM
RE: MySubscriptions - Paypal IPN Plugin - by ytt - 2014-10-03, 06:49 PM
RE: MySubscriptions - Paid Usergroup Subscriptions (Paypal IPN) - by 24Sevn - 2016-04-03, 10:10 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)