XFileSharing Pro - i need user should Register first then redirect to payment

Message
Author
free515
Posts: 17
Joined: Apr 03, 2012 11:13 am

i need user should Register first then redirect to payment

#1 Postby free515 » Aug 04, 2015 4:00 pm

HI,now i am still using very old xfilesharing pro mabybe 2.0 (April 2012)
.So i need user to Register first then redirect to payment,what should i do?

Steve9e8
Posts: 81
Joined: Jun 19, 2014 11:27 am

#2 Postby Steve9e8 » Aug 04, 2015 4:24 pm

There are two ways for that

#1 method

Go to admin settings ... then payments settings ... then but correct mark in checkbox of ( Register anon users first, then redirect to payment )


#2 method

Open the file cgi-bin/XFileConfig.pm in any text editor, then go to the term :
no_anon_payments => ' ' ... now put the value ( 1 ) :
no_anon_payments => '1'

free515
Posts: 17
Joined: Apr 03, 2012 11:13 am

#3 Postby free515 » Aug 05, 2015 4:29 am

As im using old xfilesharing pro v2.0,
#1 there is no checkbox of ( Register anon users first, then redirect to payment )
#2 i do not find no_anon_payments in cgi-bin/XFileConfig.pm,
so is there any other method?
thanks so much

Steve9e8
Posts: 81
Joined: Jun 19, 2014 11:27 am

#4 Postby Steve9e8 » Aug 05, 2015 7:09 am

Well... there is another method ... It works for XFS 2.1 and the following releases, but about XFS 2.0 and the previous releases I'm not sure, so you have to try ...

Go to the file ( cgi-bin/index.cgi ) and open it by any text editor, then add this code in the bottom of page :

Code: Select all

   if($c->{no_anon_payments} && !$ses->getUser)
   {
      $ses->redirect("$c->{site_url}/?op=registration&next=payments-$f->{type}-$f->{amount}");
   }
save the editing and check on the filehost, does it work ?

But make sure to make a backup for the file index.cgi, to recover it if that method didn't work or if it caused any problem in script ...

free515
Posts: 17
Joined: Apr 03, 2012 11:13 am

#5 Postby free515 » Aug 05, 2015 8:11 am

hi,i just tried it,i got error The server encountered an internal error or misconfiguration and was unable to complete your request.
i am using xfilesharing v2.0

Steve9e8
Posts: 81
Joined: Jun 19, 2014 11:27 am

#6 Postby Steve9e8 » Aug 05, 2015 1:58 pm

I really didn't deal with XFS 2.0 before and I don't have a copy of it to see what are the values it exactly contains ... so I cannot help a lot ...

The last method I can tell you about it is to go to the file " template/main.html " ... and to edit the code of premium/ payment button.

In the following code, just the registered users can see the premium/payment page, but the anonymous will see registration page when they click on premium/payment page ...

Code: Select all

<TMPL_IF my_login>
<a href="<TMPL_VAR site_url>/premium.html">PREMIUM</a>
<TMPL_ELSE>	
<a href="<TMPL_VAR site_url>/?op=registration">PREMIUM</a>
</TMPL_IF>
And if in your XFS script there is no need for a message to activate the account :

Code: Select all

<TMPL_IF my_login>
<a href="<TMPL_VAR site_url>/premium.html">PREMIUM</a>
<TMPL_ELSE>	
<a href="<TMPL_VAR site_url>/?op=registration&next=payments--"> PREMIUM</a>
</TMPL_IF>
So the anonymous should register first then immediately he will be redirected to payment page ( I'm not sure this code will work in XFS 2.0 because some values might be not exist )


That is the simplest method. if it didn't work I suggest to wait for answer from guys who have an experience with old releases of XFS, or to ask Sibsoft support .... but the best thing is to upgrade your XFS script to 2.1 at least ...
.

free515
Posts: 17
Joined: Apr 03, 2012 11:13 am

#7 Postby free515 » Aug 05, 2015 3:35 pm

thanks so much i will try it
have a good day

free515
Posts: 17
Joined: Apr 03, 2012 11:13 am

#8 Postby free515 » Aug 05, 2015 5:13 pm

yeah,i got it
it is in payment_buy_with.html
<TMPL_IF paypal_email><TD><a href="<TMPL_VAR site_url>/?op=payments&amount=<TMPL_VAR amount>&type=paypal&r=<TMPL_VAR rand>"><img src="<TMPL_VAR site_url>/images/buy_paypal.gif" border=0 alt="PayPal"></a></TD></TMPL_IF>.
BUT i do not know how to edit it with <TMPL_IF my_login> and <TMPL_ELSE>??
as there are two <TMPL_IF

thanks for your help

Steve9e8
Posts: 81
Joined: Jun 19, 2014 11:27 am

#9 Postby Steve9e8 » Aug 05, 2015 6:25 pm

free515 wrote:yeah,i got it
it is in payment_buy_with.html
<TMPL_IF paypal_email><TD><a href="<TMPL_VAR site_url>/?op=payments&amount=<TMPL_VAR amount>&type=paypal&r=<TMPL_VAR rand>"><img src="<TMPL_VAR site_url>/images/buy_paypal.gif" border=0 alt="PayPal"></a></TD></TMPL_IF>.
BUT i do not know how to edit it with <TMPL_IF my_login> and <TMPL_ELSE>??
as there are two <TMPL_IF
no not this one ... the button I meant is the one of menu bar, which you want it to redirect the anonymous first to registration page, then to payment/premium page ! ... it supposes to be in the main page of your filehost ...