Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
invite
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Support

2021-11-07 11:39:13
Hello, when a member sends an invitation, this invitation is valid for a few days only, can you tell me how to increase the duration of the invitation to 1 month for example, I can't find the piece of code for the expiry time of the invitation in the code of invite.php below.

Thank you in advance for your help

<?php
require_once("backend/functions.php");
dbconn();
loggedinonly();

$site_config["LEFTNAV"] = false;

$site_config["MIDDLENAV"] = false;

$site_config["RIGHTNAV"] = false;



if (!$site_config["INVITEONLY"] && !$site_config["ENABLEINVITES"]) {
show_error_msg(T_("INVITES_DISABLED"), T_("INVITES_DISABLED_MSG"), 1);
}

$users = get_row_count("users", "WHERE enabled = 'yes'");

if ($users >= $site_config["maxusers_invites"]) {
show_error_msg(T_("ERROR"), "Sorry, The current user account limit (" . number_format($site_config["maxusers_invites"]) . ") has been reached. Inactive accounts are pruned all the time, please check back again later...", 1);
}

if ($CURUSER["invites"] == 0) {
show_error_msg(T_("YOU_HAVE_NO_INVITES"), T_("YOU_HAVE_NO_INVITES_MSG"), 1);
}

if ($_GET["take"]) {
$email = $_POST["email"];
if (!validemail($email))
show_error_msg(T_("ERROR"), T_("INVALID_EMAIL_ADDRESS"), 1);

//check email isnt banned
$maildomain = (substr($email, strpos($email, "@") + 1));
$a = (@mysqli_fetch_row(@SQL_Query_exec("select count(*) from email_bans where mail_domain='$email'")));
if ($a[0] != 0)
$message = sprintf(T_("EMAIL_ADDRESS_BANNED"), $email);

$a = (@mysqli_fetch_row(@SQL_Query_exec("select count(*) from email_bans where mail_domain='$maildomain'")));
if ($a[0] != 0)
$message = sprintf(T_("EMAIL_ADDRESS_BANNED"), $email);

// check if email addy is already in use
if (get_row_count("users", "WHERE email='$email'"))
$message = sprintf(T_("EMAIL_ADDRESS_INUSE"), $email);

if ($message)
show_error_msg(T_("ERROR"), $message, 1);

$secret = mksecret();
$username = "invite_".mksecret(20);
$ret = SQL_Query_exec("INSERT INTO users (username, secret, email, status, invited_by, added, stylesheet, language) VALUES (".
implode(",", array_map("sqlesc", array($username, $secret, $email, 'pending', $CURUSER["id"]))) . ",'" . get_date_time() . "', $site_config[default_theme], $site_config[default_language])");

if (!$ret) {
// If username is somehow taken, keep trying
while (mysqli_errno($GLOBALS["DBconnector"]) == 1062) {
$username = "invite_".mksecret(20);
$ret = SQL_Query_exec("INSERT INTO users (username, secret, email, status, invited_by, added, stylesheet, language) VALUES (".
implode(",", array_map("sqlesc", array($username, $secret, $email, 'pending', $CURUSER["id"]))) . ",'" . get_date_time() . "', $site_config[default_theme], $site_config[default_language])");
}
show_error_msg(T_("ERROR"), T_("DATABASE_ERROR"), 1);
}

$id = mysqli_insert_id($GLOBALS["DBconnector"]);
$invitees = "$id $CURUSER[invitees]";
SQL_Query_exec("UPDATE users SET invites = invites - 1, invitees='$invitees' WHERE id = $CURUSER[id]");

$psecret = md5($secret);

$mess = strip_tags($_POST["mess"]);

$body = <<<EOD
You have been invited to $site_config[SITENAME] by $CURUSER[username]. They have specified this address ($email) as your email.
If you do not know this person, please ignore this email. Please do not reply.

Message:
-------------------------------------------------------------------------------
$mess
-------------------------------------------------------------------------------

Il s'agit d'un site privé et vous devez accepter les règles avant de pouvoir participer.:

$site_config[SITEURL]/rules.php
$site_config[SITEURL]/faq.php

This is a private site and you must agree to the rules before you can enter:

$site_config[SITEURL]/rules.php
$site_config[SITEURL]/faq.php


To confirm your invitation, you have to follow this link:

$site_config[SITEURL]/account-signup.php?invite=$id&secret=$psecret

After you do this, you will be able to use your new account. If you fail to
do this, your account will be deleted within a few days. We urge you to read
the RULES and FAQ before you start using $site_config[SITENAME].
EOD;
sendmail($email, "$site_config[SITENAME] user registration confirmation", $body, "", "-f$site_config[SITEEMAIL]");

header("Refresh: 0; url=account-confirm-ok.php?type=invite&email=" . urlencode($email));
die;
}

stdhead(T_("INVITE"));
begin_frame(T_("INVITE"));
?>

<form method="post" action="invite.php?take=1">
<table border="0" cellspacing="0" cellpadding="3">
<tr valign="top"><td align="center"><b><?php echo T_("EMAIL_ADDRESS");?>:</b></td><td align="left"><input type="text" size="50" name="email" />


<table width="850" border="0" cellspacing="0" cellpadding="10"><tr><td><font class="small"><?php echo T_("EMAIL_ADDRESS_VALID_MSG");?></font></td></tr></table>


</td></tr>  
<tr><td align="right"><b><?php echo T_("MESSAGE");?>:</b></td><td align="left"><textarea name="mess" rows="10" cols="80"></textarea>
</td></tr>
<tr><td colspan="2" align="center"><input type="submit" value="<?php echo T_("SEND_AN_INVITE");?>" /></td></tr>
</table>
</form>
<?php
end_frame();
stdfoot();

?>
2021-11-07 11:46:09
For reference this is the code in cleanup.php
//DELETE PENDING USER ACCOUNTS OVER TIMOUT AGE
$deadtime = gmtime() - $site_config["signup_timeout"];
SQL_Query_exec("DELETE FROM users WHERE status = 'pending' AND added < FROM_UNIXTIME($deadtime)");


So to change edit this line in config.php

$site_config['signup_timeout'] = '259200';


It's set at 3 days - for 30 days maybe try 2592000
Last edited by M-jay warn on 2021-11-07 12:46:49
2021-11-07 13:53:47
Thank you very much M-jay for the information I am making the changes and will see if it works  :razz
2021-11-07 17:36:18
 $site_config['INVITE_TIMEOUT'] = '302400';  //Max (3 Days...) 


so 30 days is 3024000

good luck


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
2021-11-07 18:14:09
Can not see that in v3 can you search cleanup.php Botanicar for INVITE_TIMEOUT might be some code we can use
2021-11-08 11:37:42
Sorry this part is from my 2.08

I coming to install stable V3 on my test-page and test this mode,
if it be OK I leave code here of course

Just need some stable V3 it is many versions of that   :love

PS
Thanks for oportunity to be part of this comunity mate


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
2021-11-10 22:05:51
Thank you all, appreciated!   :thumb
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 2
  • Members: 0
  • Guests online: 2
  • Comments: 3
  • Messages: 1,728