XFileSharing Pro - need help about premium user

Message
Author
upmorefiles
Posts: 23
Joined: Aug 14, 2012 9:10 am

need help about premium user

#1 Postby upmorefiles » Sep 12, 2012 1:58 pm

HI Sir

i have saw users purchase premium account because of direct downloads so here is the coding in xfilesharing if a user purchase premium account they have to selected direct downloading option thought the my account page but lots of users dont know about it so i want any body to help me out in xfilesharing default coding is unselected but i want this coding like this if a user purchase a premium so they will able to download direct they dont need to select the option but if a user want to disable the direct download so they have to go to my account page and selected not direct download .

like this

select to not direct download

so can any one let meknow how to do this i mean how to make changings in this coding

Hi Sir,

im trying to fix a issue but i dont have any experience with your scripts sir here is the coding if a user purchase premium account

<TMPL_IF premium><TR><TD colspan=2><input type="checkbox" name="usr_direct_downloads" id="cdl" value="1"<TMPL_IF usr_direct_downloads> checked</TMPL_IF>> <label for="cdl"><b><TMPL_VAR lang_direct_downloads></b></label> <small>(<TMPL_VAR lang_premium_only>)</small></TD></TR></TMPL_IF>

i will wait for you thanks

trinsic
Posts: 149
Joined: Dec 21, 2009 9:24 am

#2 Postby trinsic » Sep 13, 2012 12:36 am

It's not the template you should be looking at but rather ipn.cgi line 98.

Code: Select all

# Add premium days
$db->Exec("UPDATE Users SET usr_premium_expire=NOW()+INTERVAL ? SECOND WHERE usr_id=?", $user->{exp_sec}, $transaction->{usr_id} );
When you confirm a premium user this command runs and adds premium days to the user. At the same time you'll want to set usr_direct_downloads to 1.

So you could add this below the previous mentioned code.

Code: Select all

# Set premium to direct download
$db->Exec("UPDATE Users SET usr_direct_downloads=1 WHERE usr_id=?", $transaction->{usr_id} );
Note this is UNTESTED, but I see no reason for it not to work. Let me know how you go.

afdah
Posts: 147
Joined: Jan 27, 2012 2:23 pm

#3 Postby afdah » Sep 13, 2012 4:48 am

cool. thanks for the tips. i would like to enable direct download by default for premium users too.

upmorefiles
Posts: 23
Joined: Aug 14, 2012 9:10 am

#4 Postby upmorefiles » Sep 13, 2012 11:25 pm

trinsic wrote:It's not the template you should be looking at but rather ipn.cgi line 98.

Code: Select all

# Add premium days
$db->Exec("UPDATE Users SET usr_premium_expire=NOW()+INTERVAL ? SECOND WHERE usr_id=?", $user->{exp_sec}, $transaction->{usr_id} );
When you confirm a premium user this command runs and adds premium days to the user. At the same time you'll want to set usr_direct_downloads to 1.

So you could add this below the previous mentioned code.

Code: Select all

# Set premium to direct download
$db->Exec("UPDATE Users SET usr_direct_downloads=1 WHERE usr_id=?", $transaction->{usr_id} );
Note this is UNTESTED, but I see no reason for it not to work. Let me know how you go.
Really Great job its really works thanks