XFileSharing Pro - <TMPL_LOOP plans> is ignored in download0.html

Message
Author
venture89
Posts: 95
Joined: Aug 30, 2011 12:11 am

<TMPL_LOOP plans> is ignored in download0.html

#1 Postby venture89 » Sep 13, 2011 2:23 am

Hello All,
I want to include my premium package pricing in download0.html

So I have added the following code that is used in payments.html by default

Code: Select all

<TMPL_INCLUDE payment_buy_with.html>
While above code display package pricing perfectly in payments.html it does not do so in the download0.html


Can someone please help me? I've been trying to do this for few hours now..any help is greatly appreciated.

P.S Specifically <TMPL_LOOP plans> content is completely ignored in download0.html while the same code displays everything fine in payments.html

applewar
Posts: 67
Joined: Feb 08, 2011 4:21 am

#2 Postby applewar » Sep 13, 2011 4:59 am

Hello,

In index_dl.pm, I think you can add this code in the download0.html configuration

Code: Select all

my @plans;
   if($c->{payment_plans} && !$premium && $c->{enabled_prem})
   {
      for( split(/,/,$c->{payment_plans}) )
      {
         /([\d\.]+)=(\d+)/;
         push @plans, { amount=>$1, days=>$2, site_url=>$c->{site_url} };
      }
   }
and modify the download0 printemplates like that

Code: Select all

return $ses->PrintTemplate("download0.html", 
                          %{$file},
                          %cc,
                          'plans'   => \@plans,
                          'referer' => $f->{referer} );
After that, you can add <TMPL_LOOP plans> in your download0.html and I think that's work.

Sorry if my explanation is not clear, I'm so bad with english.

venture89
Posts: 95
Joined: Aug 30, 2011 12:11 am

#3 Postby venture89 » Sep 13, 2011 7:47 am

Thanks, I tried what you mentioned above but getting the following error
Global symbol "@plans" requires explicit package name at index_dl.pm line 267.
Compilation failed in require at index_dl.cgi line 11.
BEGIN failed--compilation aborted at index_dl.cgi line 11.
I already had the first part of your code in my index_dl.pm


Code: Select all

my @plans; 
   if($c->{payment_plans} && !$premium && $c->{enabled_prem}) 
   { 
      for( split(/,/,$c->{payment_plans}) ) 
      { 
         /([\d\.]+)=(\d+)/; 
         push @plans, { amount=>$1, days=>$2, site_url=>$c->{site_url} }; 
      } 
   }
Line 267 in the code was the following from your code

Code: Select all

'plans'   => \@plans, 

applewar
Posts: 67
Joined: Feb 08, 2011 4:21 am

#4 Postby applewar » Sep 13, 2011 3:16 pm

I'm sorry that it does not work, unfortunately I do not have time to test it myself and give you the solution.

It also requires you to take into account the fact that download0.html page is just a transition that leads to the download page.

Why do not you make life easier and just include a summary table on page download1.html?
It would be simpler and aesthetically, it's better.

venture89
Posts: 95
Joined: Aug 30, 2011 12:11 am

#5 Postby venture89 » Sep 21, 2011 3:03 am

Anyone else have tried this?
I just need to add following code in my download0.html

<TMPL_INCLUDE payment_buy_with.html>

When I do that my payment packages are not displayed.

OooLong
Posts: 18
Joined: Feb 10, 2010 2:33 am

#6 Postby OooLong » Feb 27, 2012 6:34 pm

I was wondering if anyone have found a solution to this problem? I have the exact same problem. If anyone have a solution, it would be greatly appreciated.

admin
Site Admin
Posts: 1839
Joined: Mar 22, 2006 12:32 pm

#7 Postby admin » Feb 28, 2012 6:57 am

applewar's code is correct.
I guess you put this snipped in the wrong place or placed incorrectly.

Try to put it right before

Code: Select all

      return $ses->PrintTemplate("download0.html", 
                          %{$file},
                          %cc,
                          'referer' => $f->{referer} );
in Download1 function.

OooLong
Posts: 18
Joined: Feb 10, 2010 2:33 am

#8 Postby OooLong » Feb 28, 2012 10:08 pm

Hello,

The link to payment seem to be missing random r value "r=" on download0.html as oppose to download1.html where r have some random value.

For example:
http://mysite.com/?op=payments&amount=9 ... =paypal&r=

You can see r= is empty, is this important that "r" have to have a random value? the link get me to paypal fine but I haven't test signing up with it. Any help is appreciated.

admin
Site Admin
Posts: 1839
Joined: Mar 22, 2006 12:32 pm

#9 Postby admin » Feb 29, 2012 2:49 am

OooLong wrote:Hello,

The link to payment seem to be missing random r value "r=" on download0.html as oppose to download1.html where r have some random value.

For example:
http://mysite.com/?op=payments&amount=9 ... =paypal&r=

You can see r= is empty, is this important that "r" have to have a random value? the link get me to paypal fine but I haven't test signing up with it. Any help is appreciated.
Thats not important.

OooLong
Posts: 18
Joined: Feb 10, 2010 2:33 am

#10 Postby OooLong » Feb 29, 2012 4:33 am

Do you mind me asking, why it's there if it's not important?