Code: Select all
if( $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD || $uservip == 1 )
Code: Select all
//-- mod : Loewen Enterprise - PAYPAL IPN REG / SUBSCRIPTION - GROUP
//-- add
//is user a vip?
$uservip = 0;
if($userdata['user_rank'] > 0)
{
$sql = "SELECT r.rank_id, r.rank_title
FROM " . RANKS_TABLE . " r
WHERE r.rank_id = " . $userdata['user_rank'];
if ( ($resultr = $db->sql_query($sql)) )
{
if( $rowr = $db->sql_fetchrow($resultr) )
{
if(strcmp($rowr['rank_title'], VIP_RANK_TITLE) == 0)
{
$uservip = 1;
}
}
}
}
//or is it a temp vip: within trial period
if($userdata['user_expire_date'] == 0 && time() <= ( $userdata['user_expire_date'] == 0 ? ($userdata['user_regdate'] + intval($board_config['lw_trial_period']) * 24 * 60 * 60) : (time() - 100) ))
{
$uservip = 1;
}
//-- fin mod : Loewen Enterprise - PAYPAL IPN REG / SUBSCRIPTION - GROUP
defender39 wrote: This mod is listed as CASH MOD compatible.
But HOW? My points are already called user_points.
I have the paypal IPN working great as I have already a dozen paid subscribers in a couple days. But what I want to do is also allow those who have earned enough points to be able to buy a subscription as well.
Any help would be great.
Johnny T wrote: I installed this MOD fine but there is a bug. If your trial period is set to anything except 0 then any visitor can view / post etc in ANY forum regardless of whether they are set to private / MOD/ Admin etc.
The piece of code that is the problem is here:It seems the last bit of the code that says that someone is in their trial period is setting the $uservip to equal 1 for anyone who is just visiting the board. Later in the code this then overwrites any forum permissions you have set by allowing them to post / view regardless of phpBB permissions.Code: Select all
//-- mod : Loewen Enterprise - PAYPAL IPN REG / SUBSCRIPTION - GROUP //-- add //is user a vip? $uservip = 0; if($userdata['user_rank'] > 0) { $sql = "SELECT r.rank_id, r.rank_title FROM " . RANKS_TABLE . " r WHERE r.rank_id = " . $userdata['user_rank']; if ( ($resultr = $db->sql_query($sql)) ) { if( $rowr = $db->sql_fetchrow($resultr) ) { if(strcmp($rowr['rank_title'], VIP_RANK_TITLE) == 0) { $uservip = 1; } } } } //or is it a temp vip: within trial period if($userdata['user_expire_date'] == 0 && time() <= ( $userdata['user_expire_date'] == 0 ? ($userdata['user_regdate'] + intval($board_config['lw_trial_period']) * 24 * 60 * 60) : (time() - 100) )) { $uservip = 1; } //-- fin mod : Loewen Enterprise - PAYPAL IPN REG / SUBSCRIPTION - GROUP
Is there a fix for this?
Thanks for the help, its gonna be a great MOD when this is fixed...