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
User Posts

Go to Profile

Announce Class — 2022-05-30 16:07:18 in Downloads & Updates
Looking good mate, looks so much cleaner in functions  👍

Not sure you need all the keys especially as we go to v2 for example numwant, compact, no peer id these are no longer required.

Compact is a good example if client didn't have compact before it would not work but now all clients have it so it should be expected behaviour. The highest I've seen num want is 200 so again not needed you can limit this site side if you wish but it's not really neede

Have a look at this http://bittorrent.org/beps/bep_0052.html

Tracker GET requests have the following keys:
info_hash
peer_id
ip
port
uploaded
downloaded
left
event

You would still need a key but that's for personal use - not for client. What does the encryption function do ?

Debugging announce is a pain - not sure how you handler exceptions so might be worth wrapping querys in try/catch with the fail function
Blank coment — 2022-05-30 13:36:00 in v3 Support
For comments just add strlen

Find in comments.php
$body = $_POST['body'];


Below add
if (strlen($body)  < 3) { 
     autolink($_SERVER['HTTP_REFERER'], 'Body too short');
}
Help — 2022-05-23 13:35:34 in v3 Support
1) Has this just started out of blue
2) Which client do you use

The first thing I thought was maybe it's a v2 torrent, have you tried different internal torrents ?

Search PARSE_OPEN in backend/parse.php you will find two, might be worth add 1 & 2 at end to see which one eg PARSE_OPEN2 (this is just to see which one remember to change back after)

I think it will be reading file fine but is struggling to read the array - again this makes me think v2 torrent or maybe character in the array
snatched — 2022-05-12 17:18:02 in v3 Support
from what i remember its because you dont add snatched if freeleech in announce.php it will be something like
	if ( ($MEMBERSONLY) && (($seeder == 'no' && $torrent['freeleech'] == 0)) ) {
   SQL_Query_exec("INSERT INTO `snatched` (`uid`, `tid`, `stime`, `utime`) VALUES ('$userid', '$torrentid', '".gmtime()."', '".gmtime()."') ON DUPLICATE KEY UPDATE `utime` = '" . gmtime() . "'");
}


removing this should work
&& $torrent['freeleech'] == 0 


however might be worth seeing how you update the snatched table in announce you will have a sql query like UPDATE snatched

but you update on announce from client calculations so shouldn't be a issue - should test this before live site  👍
Should be http for localhost with xammp for live server you would need ssl certificate which you can get for free online
do you have the v3 function send mail because this should work in admincp - this is link url/admincp.php?action=pendinginvitecode

For test not live

# View Pending Invited Users - Created by mjay
#======================================================================#
if ($action == "pendinginvitecode")
{
 if ($do == "confirm")
 {
     if (!@count($_POST["users"])) show_error_msg(T_("ERROR"), "Rien de sélectionné.", 1);

     $ids = array_map("intval", $_POST["users"]);
     $ids = implode(", ", $ids);

     // Add Email to sql
     $res = SQL_Query_exec("SELECT u.id, u.invited_by, u.email, i.invitees FROM users u LEFT JOIN users i ON u.invited_by = i.id WHERE u.status = 'pending' AND u.invited_by != '0' AND u.id IN ($ids)");
     while ($row = mysqli_fetch_assoc($res))
     {    
          // confirm user
          SQL_Query_exec("UPDATE `users` SET `status` = 'confirmed' WHERE `id` = '$row[id]'");
          // Send mail
          sendmail($row["email"], "Confirm", "Admin has confirmed", "", "-f".$site_config['SITEEMAIL']);
     }

     autolink("admincp.php?action=pendinginvitecode", "Entrées supprimées");
 }

 $count = get_row_count("users", "WHERE status = 'pending' AND invited_by != '0'");

 list($pagertop, $pagerbottom, $limit) = pager(25, $count, 'admincp.php?action=pendinginvite&');  
                                                               
 $res = SQL_Query_exec("SELECT u.id, u.username, u.email, u.added, u.invited_by, i.username as inviter FROM users u LEFT JOIN users i ON u.invited_by = i.id WHERE u.status = 'pending' AND u.invited_by != '0' ORDER BY u.added DESC $limit");

 stdhead("Invited Pending Users");
 #navmenu();

 begin_frame("Utilisateurs en attente d'invitations");
 ?>
 <center>
 Cette page affiche tous les utilisateurs invités auxquels des invitations ont été envoyées mais qui n'ont pas encore été activées. En supprimant un utilisateur, l'invité recevra son invitation et toutes les données associées à l'invité seront supprimées. <hr class="barre"/><?php echo number_format($count); ?> les membres sont en attente.
 </center>

 <?php if ($count > 0): ?>
 <br />
 <form id="pendinginvite" method="post" action="admincp.php?action=pendinginvitecode">
 <input type="hidden" name="do" value="confirm" />
 <table border="0" cellpadding="3" cellspacing="0" width="100%" align="center" class="table_table">
 <tr>
     <th class="table_head">Pseudo</th>
     <th class="table_head">E-mail</th>
     <th class="table_head">Invité</th>
     <th class="table_head">Invité Par..</th>
     <th class="table_head"><input type="checkbox" name="checkall" onclick="checkAll(this.form.id);" /></th>
 </tr>
 <?php while ($row = mysqli_fetch_assoc($res)): ?>
 <tr>
     <td class="table_col1" align="center"><?php echo $row["username"]; ?></td>
     <td class="table_col2" align="center"><?php echo $row["email"]; ?></td>
     <td class="table_col1" align="center"><?php echo utc_to_tz($row["added"]); ?></td>
     <td class="table_col2" align="center"><a href="account-details.php?id=<?php echo $row["invited_by"]; ?>"><?php echo $row["inviter"]; ?></a></td>
     <td class="table_col1" align="center"><input type="checkbox" name="users[]" value="<?php echo $row["id"]; ?>" /></td>
 </tr>
 <?php endwhile; ?>
 <tr>
     <td colspan="5" align="right">
     <input type="submit" value="confirm Les Cochés" />
     </td>
 </tr>
 </table>        
 </form>
 <?php
 endif;

 if ($count > 25) echo $pagerbottom;

 end_frame();
navmenu();
 stdfoot();
}

in your files i do not see insert user
if new user with code is status pending if this code changes user to confirmed then sending mail is easy

try this in admincp this is link admincp.php?action=pendinginvitecode
if this

# View Pending Invited Users - Created by mjay
#======================================================================#
if ($action == "pendinginvitecode")
{
  if ($do == "confirm")
  {
      if (!@count($_POST["users"])) show_error_msg(T_("ERROR"), "Rien de sélectionné.", 1);

      $ids = array_map("intval", $_POST["users"]);
      $ids = implode(", ", $ids);
     
      $res = SQL_Query_exec("SELECT u.id, u.invited_by, i.invitees FROM users u LEFT JOIN users i ON u.invited_by = i.id WHERE u.status = 'pending' AND u.invited_by != '0' AND u.id IN ($ids)");
      while ($row = mysqli_fetch_assoc($res))
      {    
           
           SQL_Query_exec("UPDATE `users` SET `status` = 'confirmed' WHERE `id` = '$row[id]'");
      }

      autolink("admincp.php?action=pendinginvitecode", "Entrées supprimées");
  }
 
  $count = get_row_count("users", "WHERE status = 'pending' AND invited_by != '0'");
 
  list($pagertop, $pagerbottom, $limit) = pager(25, $count, 'admincp.php?action=pendinginvite&');  
                                                                 
  $res = SQL_Query_exec("SELECT u.id, u.username, u.email, u.added, u.invited_by, i.username as inviter FROM users u LEFT JOIN users i ON u.invited_by = i.id WHERE u.status = 'pending' AND u.invited_by != '0' ORDER BY u.added DESC $limit");
 
  stdhead("Invited Pending Users");
  #navmenu();
 
  begin_frame("Utilisateurs en attente d'invitations");
  ?>
  <center>
  Cette page affiche tous les utilisateurs invités auxquels des invitations ont été envoyées mais qui n'ont pas encore été activées. En supprimant un utilisateur, l'invité recevra son invitation et toutes les données associées à l'invité seront supprimées. <hr class="barre"/><?php echo number_format($count); ?> les membres sont en attente.
  </center>

  <?php if ($count > 0): ?>
  <br />
  <form id="pendinginvite" method="post" action="admincp.php?action=pendinginvitecode">
  <input type="hidden" name="do" value="confirm" />
  <table border="0" cellpadding="3" cellspacing="0" width="100%" align="center" class="table_table">
  <tr>
      <th class="table_head">Pseudo</th>
      <th class="table_head">E-mail</th>
      <th class="table_head">Invité</th>
      <th class="table_head">Invité Par..</th>
      <th class="table_head"><input type="checkbox" name="checkall" onclick="checkAll(this.form.id);" /></th>
  </tr>
  <?php while ($row = mysqli_fetch_assoc($res)): ?>
  <tr>
      <td class="table_col1" align="center"><?php echo $row["username"]; ?></td>
      <td class="table_col2" align="center"><?php echo $row["email"]; ?></td>
      <td class="table_col1" align="center"><?php echo utc_to_tz($row["added"]); ?></td>
      <td class="table_col2" align="center"><a href="account-details.php?id=<?php echo $row["invited_by"]; ?>"><?php echo $row["inviter"]; ?></a></td>
      <td class="table_col1" align="center"><input type="checkbox" name="users[]" value="<?php echo $row["id"]; ?>" /></td>
  </tr>
  <?php endwhile; ?>
  <tr>
      <td colspan="5" align="right">
      <input type="submit" value="confirm Les Cochés" />
      </td>
  </tr>
  </table>        
  </form>
  <?php
  endif;
 
  if ($count > 25) echo $pagerbottom;
 
  end_frame();
navmenu();
  stdfoot();
}


users emails code to friend - friend signups up - you confirm - is this correct

here is what i have so far on my side for v3
https://torrenttrader.uk/topic?topicid=10452
In Progress but should work fully - needs some testing before live site.

1) If user has invite - user can make code
2) user sends code to friend by email
3) friend inputs code
4) if code ok - signup - include admin confirm, welcome message etc etc

Works same as invites except user NOT created unless code excepted

SQL
CREATE TABLE `invites` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`inviter` int(10) unsigned NOT NULL DEFAULT '0',
`inviteid` int(10) NOT NULL DEFAULT '0',
`invite` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',
`time_invited` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`confirmed` char(3) COLLATE utf8_bin NOT NULL DEFAULT 'no',
PRIMARY KEY (`id`),
KEY `inviter` (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=182 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


create file invitecode.php
<?php
// Get File
require_once "backend/functions.php";
require_once "backend/config.php";

// Get Functions
dbconn();
loggedinonly();

// Count Max Users
$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);
}

// Form Submitted
$mail = $_POST['email'];
$code = $_POST['secretcode'];
$specailcode = $_POST['specialcode'];
$type = $_GET['type'];

// Delete Code
if ($type == 'del') {
SQL_Query_exec("DELETE FROM invites WHERE invite = '$_GET[invite]'");
SQL_Query_exec("UPDATE users SET invites = ($CURUSER[invites] +1 ) WHERE id = $CURUSER[id]");
autolink("invitecode.php", "deleted invite code");
   die();
}

// Create Code
if (!empty($code)) {
   // Get User ID
   $id = 0 + $_GET["id"];
   if ($id == 0) {
       $id = $CURUSER["id"];
   }
   if (get_user_class() <= 6)
       $id = $CURUSER["id"];

   SQL_Query_exec("INSERT INTO invites (inviter, invite, time_invited) VALUES ('$id', '$code', '" . get_date_time() . "')");
   SQL_Query_exec("UPDATE users SET invites = invites - 1 WHERE id = $id");
   header("Refresh: 0; url=invitecode.php");
}

// Count Invites
$count = get_row_count("users", "WHERE invites > 0 AND id = $CURUSER[id]");
if ($count <= 0) {
   show_error_msg(T_("ERROR"), "Vous avez aucune invitation!");
}

// create secret
$secret = mksecret();
$psecret = md5($secret);

// show page
stdhead("Invite");
begin_frame("Invites");
echo "<center>This is last code $psecret</center>";
print("<br /><center><a class=stylebouton href=invitetree.php>".T_("INVITE_TREE")."</a></center>"); //one small space here!
?>
<form method="post" action="invitecode.php">
   <input type="hidden" name="secretcode" value="<?php echo $psecret ?>">
   <input type="submit" value="Create Code">
</form>
<?php
$rul = get_row_count("invites", "WHERE inviter = $CURUSER[id]");
$rer = SQL_Query_exec("SELECT inviteid, invite, time_invited FROM invites WHERE inviter = $CURUSER[id] AND confirmed='no'");
$num1 = mysqli_num_rows($rer);
print("<table border=0 width=750 cellspacing=0 cellpadding=5>".
"<tr class=tabletitle><td class=table_head colspan=6><b>Statut actuel des codes créés</b> ($rul) <br/><font color=#B0FF30><b>NB</b></font>: <i>Signalez à vos invités que le code est valide pour 5 jours.</i></td></tr>");
if(!$num1){
print("<tr class=ttable_col1><td colspan=6><i><b>...Aucun code d'invitation créé pour le moment !</b></i></tr>");
} else {
print("<tr class=tableb><td class=table_head><b>".T_("CODE_INVITE_")."</b></td><td class=table_head><b>".T_("CREATED_DATE")."</b></td><td class=table_head><b>".T_("DELETE_INVITE")."</td></tr>");
for ($i = 0; $i < $num1; ++$i)
{
$arr1 = mysqli_fetch_assoc($rer);
print("<tr><td class=table_col1 align=center>$arr1[invite]</td><td class=table_col1 align=center>$arr1[time_invited]</td>");
//print("<td><input type=\"checkbox\" name=\"conusr[]\" value=\"" . $arr['id'] . "\" /></td></tr>");
print ("<td class=table_col2 align=center><a href=\"invitecode.php?invite=$arr1[invite]&type=del\"><img src='images/delete.png' alt='".T_("DELETE_INVITE")."' width='17' height='17' border='0' /></a></td></tr>");
}
}
print("</table><br/>");
end_frame();
stdfoot();


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

// FORM SUBMITTED
if ($_GET["take"]) {
   $code = $_POST['secret'];
$secret = mksecret(20);

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

// Update Inviter
$last_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]");

// Delete Invite
//SQL_Query_exec("DELETE FROM invites WHERE invite = $code");

autolink("account-signup.php?invite=$last_id&secret=$code", "Now Signup");
die;
}

// Show Page
stdhead(T_("activate"));
begin_frame(T_("activate"));
?>
<form method="post" action="activatecode.php?take=1">
 <label for="secret">PLACE CODE:</label>
 <input type="text" id="secret" name="secret">
 <input type="submit">
</form>
<?php
end_frame();
stdfoot();


account-signup.php find
		$res = SQL_Query_exec("SELECT id FROM users WHERE id = $_REQUEST[invite] AND MD5(secret) = ".sqlesc($_REQUEST["secret"]));

replace with
		$cutsecret = substr($_REQUEST["secret"], 0, 20);	
$res = SQL_Query_exec("SELECT id FROM users WHERE id = $_REQUEST[invite] AND secret = ".sqlesc($cutsecret));

find
		if (!$invite_row) {
show_error_msg(T_("ERROR"), T_("INVITE_ONLY_NOT_FOUND")." ".($site_config['signup_timeout']/86400)." days.", 1);
}

below add
		$res = SQL_Query_exec("SELECT * FROM invites WHERE invite = ".sqlesc($_REQUEST["secret"]));	
$invite_code = mysqli_fetch_assoc($res);
if (!$invite_code) {
show_error_msg(T_("ERROR"), T_("strange code are you sure"));
} else {
$invite_code = true;
}

find
<?php if (!$invite_row) {?>

replace with
<?php if (!$invite_row || $invite_code) {?>


1) visit yoursiteaddresscom/invitecode.php
2) make code
3) visit yoursiteaddresscom/activatecode.php
4) enter code
5) signup

any ideas let me know
😀  👍
file is hard to read - missing takeconfirm.php, language & invite sql

but i think we can make it simple - you can then build - i like this idea - maybe you can offer invites on torrentinvite sites

we just nee to create user from email that will be the takeconfirm.php maybe something in file to guide us  but this is the code i played with - very simple - once it works we can add everything back

example
1) we make user
2) remove 1 invite
3) send email with code
4) if code on signup - we welcome

if you sell or give invites we just add to array see line 21 of my code - maybe should be in database so we can delete if used
$os = array(222, 333, 444, 555);


create invitecode.php  progress ideas welcome
<?php
require_once "backend/functions.php";
require_once "backend/config.php";
dbconn();
loggedinonly();

stdhead("Invite");

// submitted form
$mail = $_POST['email'];
$code = $_POST['secretcode'];
$specailcode = $_POST['specialcode'];

// create secret
$secret = mksecret();
$psecret = md5($secret);

// show page
begin_frame("Invites");

if (!empty($code)) {
echo "<center>This is old code $code</center>";
echo "<center>This is email $email</center>";
echo "<center>now we make user</center>";

// Maybe sell codes or give away
$os = array(222, 333, 444, 555);
if (in_array($specailcode, $os)) {
echo "<center>Great you used specail code $specailcode</center>";
}
}

echo "<center>This is last code $psecret</center>";
?>
<form method="post"  action="invitecode.php">
email only - code automatic
<input type="hidden" name="secretcode" value="<?php echo $psecret ?>">
<label for="email">Email:</label>
<input type="email" id="email" name="email"><br><br>


code we buy try 222 or 333
<label for="specialcode">specialcode:</label>
<input type="number" id="specialcode" name="specialcode"><br><br>
<input type="submit" value="Submit">
</form>
<?php
end_frame();

stdfoot();

for quick test try

in invite.php

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

copy the line above this line
$body = <<<EOD

then replace line with new link
$site_config[SITEURL]/account-signup.php?invite=$id&code=$psecret

uncomment first line = this will be setting code or secret
//$site_config[SITEURL]/account-signup.php?invite=$id&secret=$psecret

so

//$site_config[SITEURL]/account-signup.php?invite=$id&secret=$psecret // need setting
$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
-------------------------------------------------------------------------------

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&code=$psecret

move these lines
$secret = mksecret();;

$psecret = md5($secret);

above
if ($_GET["take"]) {

find
<form method="post" action="invite.php?take=1">

under add
<input type="hidden" name="code" value="$psecret" />

above
<form method="post" action="invite.php?take=1">

add
echo $psecret;

in account-signup.php add at top (for test only)
if ($_GET["code"]) {
    echo 'code is here we just need to do signup ';
    die();
}


the code displayed on invite and in url should match - this is just for test
For clarification is this after admin confirm users - we just need to add mail here is admincp
      autolink("admincp.php?action=confirmreg", "Entries Confirmed");


Is this right and ill play with it  👍
seed time error — 2022-04-24 09:29:32 in v3 Support
Do you use this mod https://torrenttrader.uk/topic?topicid=9726

When do you get this issue,
Tracker Timeout — 2022-04-23 10:04:05 in v3 Support
upd is not supported by default - if you had a mod and it worked before it might be server setting
this line in app/config/config.php needs your username as a extra lay of protection  👍

define('_OWNERS', array('M-jay')); // Example & with more define('_OWNERS', array('mjay', 'mjay', 'mjay'));
upload images webp — 2022-04-19 16:07:01 in v2.08 Support
had a quick look at this - webp works fine - it makes image files smaller so I will make a function  to convert png, jpeg etc to webp - so thank you

now for the problem - gd is default in php 8 but for older you need to install gd extension   👍

Update
Just noticed first post is old but still useful  😀
Have you edited the the getip function in functions.php and announce.php
https://torrenttrader.uk/topic?topicid=10351
autopromote problem — 2022-04-11 17:21:29 in v3 Support
Under $maxdt put this then check admin log might just need to play with date
write_log("$maxdt");
autopromote problem — 2022-04-11 14:14:20 in v3 Support
Is Congratulations message sent, you can check in admincp/message-spy
Or search the admin log for promote

If no messages then it must be the query

Try this - see if we can narrow it down - on cleanup this will edit all so worth testing first before live site
$res = SQL_Query_exec("SELECT id, username FROM users WHERE class = 1 AND uploaded / downloaded > $minratio AND added < $maxdt");

If it doesn't work try without  AND added < $maxdt
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: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728