Author Topic: Free for female members [auto subscription]  (Read 8803 times)

blueeyeddevil

  • Active Member
  • ***
  • Posts: 45
  • Karma: +3/-0
Re: Free for female members [auto subscription]
« Reply #15 on: December 28, 2014, 08:45:39 PM »
I found out how to solve this issue in way that can handle even more genders but the problem is that after submitting second page of registration form it will return blank page. To prevent it make sure you set all registration fields to 1st page only.
To fix it open processors/join.php and follow instructions:
FIND:
Code: [Select]
// auto subscriptions
if (!isset($_GET['nas'])) {
AFTER ADD:
Code: [Select]
$query="SELECT * FROM `{$dbtable_prefix}user_profiles` WHERE `fk_user_id`='".$_SESSION[_LICENSE_KEY_]['user']['reg_id']."'";
$getfields=@mysql_query($query);
$regfields=mysql_fetch_assoc($getfields);
FIND:
Code: [Select]
('','".join("','",array_keys($input))
REPLACE WITH:
Code: [Select]
('','".join("','",array_keys($regfields))

With this code you will have also added memberships into payments table with zero payment which is good if you offer something like 3 days trial on signup. But if you offer permanent membership like women for free you may consider following edit as well so permanent membership will be not added to payments table.
in same file:
FIND:
Code: [Select]
// save as a payment with amount 0
BEFORE ADD:
Code: [Select]
if($rsrow['duration']>0){
FIND:
Code: [Select]
if (!($res2=@mysql_query($query))) {trigger_error(mysql_error(),E_USER_ERROR);}
break;
AFTER ADD:
Code: [Select]
}

Marble

  • Global Moderator
  • Veteran Member
  • *****
  • Posts: 1006
  • Karma: +56/-7
Re: Free for female members [auto subscription]
« Reply #16 on: December 29, 2014, 10:15:48 PM »
I found out how to solve this issue in way that can handle even more genders but the problem is that after submitting second page of registration form it will return blank page. To prevent it make sure you set all registration fields to 1st page only.
To fix it open processors/join.php and follow instructions:
FIND:
Code: [Select]
// auto subscriptions
if (!isset($_GET['nas'])) {
AFTER ADD:
Code: [Select]
$query="SELECT * FROM `{$dbtable_prefix}user_profiles` WHERE `fk_user_id`='".$_SESSION[_LICENSE_KEY_]['user']['reg_id']."'";
$getfields=@mysql_query($query);
$regfields=mysql_fetch_assoc($getfields);


In this first part, you say to add the above code. I placed it between this code
Code: [Select]
// auto subscriptions
if (!isset($_GET['nas'])) {

and this code
Code: [Select]
$query="SELECT a.`dbfield`,a.`field_value`,b.`subscr_id`,b.`is_recurent`,b.`m_value_to`,b.`duration` FROM `{$dbtable_prefix}subscriptions_auto` a, `{$dbtable_prefix}subscriptions` b WHERE a.`dbfield` IN ('','".join("','",array_keys($input))."') AND a.`fk_subscr_id`=b.`subscr_id` AND a.`date_start`='0000-00-00'";
I tested it and all of your code change suggestions. All is working great.
Thanks for your code contribution!
If you see that I'm logged in forever... it just means I turned the page on my browser and forgot to logout.