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
[HACK] Donate Upload Credits [TTv3]
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Mods Completed

2019-07-12 12:25:39
Hi

~ Design: Credit goes to Arctic Wolf
~ Update: Spiritblue for the  TTV3
~ SQL: No


this hack is a complement of the modbonbonus mod of the ttv3

[color=rgb(184, 49, 47)]*Always make a backup before making the change.[/color]
[color=rgb(204, 204, 204)]
In [/color]
[color=rgb(251, 160, 38)]account.php[/color][color=rgb(204, 204, 204)] look for :
<?php print("<a href='account.php?action=mytorrents'><b>".T_("YOUR_TORRENTS")."</b></a>");?>


Add after :[/color]

<?php print("<a href='uptransfer.php'><b>".T_("DONATE_UPLOAD_CREDITS")."</b></a>");?>


Create a file named [color=rgb(251, 160, 38)]uptransfet.php[/color] :

#             Modified By Dalibor                #
#            Last Modified 28-6-2008             #
#         Modified to 2.08 By ArcticWolf         #
#     Update by spiritblue  12-07-2019 (TTV3)    #
##################################################

/* Connect To Database, And ONLY Allow Members */
require_once("backend/functions.php");
dbconn();
loggedinonly();
$action = $_REQUEST["action"];

if ($action == "taketransfer") {
   $username = $_POST["username"];

   if (!$username)
       show_error_msg("Error", "You are not connecting, or you are trying to transfer, but here we have secured .", 1);

   $credit = $_POST["credit"];

   if ($credit < 1 || (!$CURUSER))
       show_error_msg("Error", "You are not connecting, or your transfer is too small .", 1);

   $kb = 1024;
   $mb = 1024 * 1024;
   $gb = 1024 * 1024 * 1024;
   $tb = 1024 * 1024 * 1024 * 1024;

   if ($_POST["unit"] == 'mb')
       $credit = $credit * $mb;
   elseif ($_POST["unit"] == 'gb')
       $credit = $credit * $gb;
   elseif ($_POST["unit"] == 'tb')
       $credit = $credit * $tb;

   if ($CURUSER["uploaded"] < $credit)
       show_error_msg("Errorr", "You are trying to upload upload donations while you currently have. ", 1);

   $query = SQL_Query_exec("SELECT id,uploaded,modcomment FROM users WHERE username = '$username'");
   $res = mysqli_fetch_assoc($query);
   $receiver = $res["id"];
   $sender = $CURUSER["id"];
   $modcomment2 = $CURUSER["modcomment"];

   $modcomment1 = $res["modcomment"];

   $modcomment1 = gmdate("Y-m-d") . " - Credit upload: $username obtained " . mksize($credit) . " from $site_config[SITEURL]/account-details.php?id=$sender " . $CURUSER['username'] . ".\n" . $modcomment1;
   $modcomment2 = gmdate("Y-m-d") . " - Credit upload: $site_config[SITEURL]/account-details.php?id=$sender " . $CURUSER['username'] . " to give  " . mksize($credit) . " by $username.\n" . $modcomment2;



   SQL_Query_exec("UPDATE users SET uploaded = uploaded + $credit, modcomment = " . sqlesc($modcomment1) . " WHERE id = '$receiver'");
   SQL_Query_exec("UPDATE users SET uploaded = uploaded - $credit, modcomment = " . sqlesc($modcomment2) . " WHERE id = '$sender'");
   $subject = "Ajout de credit upload!";
   if ($_POST["anonym"] != 'anonym') {
       $msg = sqlesc("Your account has been credited with  " . mksize($credit) . " compliments of  " . $CURUSER['username'] . "");
       SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, poster, subject) VALUES($sender, $receiver, NOW(), $msg, 0," . sqlesc($subject) . ")");
   } else {
       $msg = sqlesc("Your account has been credited  " . mksize($credit) . " Compliments of an anonymous user .");
       SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, poster, subject) VALUES(0, $receiver, NOW(), $msg, 0, " . sqlesc($subject) . ")");
   }
   write_log("<font color=lime size=2>Credit Upload:</font><a href=account-details.php?id=$sender target=_blank>" . $CURUSER['username'] . "</a> has offered  " . mksize($credit) . " a <a href=account-details.php?id=$receiver target=_blank>$username</a>");

   autolink($site_config[SITEURL] . "/index.php", "you gave  " . mksize($credit) . " in credit upload a  " . $username);
   // header("Refresh: 0; url=index.php");  // I guess this would work under 2.08... No clue LOL
   die();
}

/*  Start Page Output  */
stdhead("Donate Uploads");
begin_frame(T_('INFO_DONATE_UPLOAD_CREDITS'));
?>
<b><?php echo T_("WHY_SHOULD_DONATE"); ?></b><br />
<?php echo T_("CREDIT_UP_TEXT1"); ?>
<br /><br />
<b><?php echo T_("WHY_SHOULD_DONATE_UP"); ?></b><br />
<?php echo T_("CREDIT_UP_TEXT2"); ?>
<?php
end_frame();
begin_frame(T_('TRANSFER_UPLOAD'));
?>
<center>
<form name="transfer" method="post" action="uptransfer.php?action=taketransfer">
<table class="table_table table_col1" width="50%" cellpadding="5" border="0" align="center"><tr><td align="right"><b><?php echo T_("DONATE_TO"); ?>: </b></td><td align="left"><input type="text" name="username" size="20"> <input type="checkbox" name="anonym" value="anonym"> <?php echo T_("ANONYMOUS_TRANSFER"); ?></td></tr>&nbsp;
<tr><td align="right"><?php echo T_("AMOUNT_CREDIT"); ?>:</b></td><td align="left"><input type="text" name="credit" size="20" value="1">
<select name="unit"><br />
<option value="false">Selection</option>
<option value="mb">KB</option>
<option value="mb">MB</option>
<option value="gb">GB</option>
<option value="tb">TB</option>
</select></table><br/><center><input name="submit" type="submit" value="Transfer!"></center></td>
</tr></form></center>
<?php
end_frame();
stdfoot();
?>



Add to your language file :
// Up-transfer and Mods
$LANG["INFO_DONATE_UPLOAD_CREDITS"] = " Info for an Upload Credit ";
$LANG["DONATE_UPLOAD_CREDITS"] = "Donate Upload Credits";
$LANG["WHY_SHOULD_DONATE"] = "Why Should I Donate?";
$LANG["CREDIT_UP_TEXT1"] = "Donating upload credit allows you to assist users that are either on lesser bandwith connections, or picking torrents with low seeder to leecher ratio.";
$LANG["WHY_SHOULD_DONATE_UP"] = "If I Donate Uploads Does It Assist The Site?";
$LANG["CREDIT_UP_TEXT2"] = "No, Donating Money and Donating Uploads are two seperate donations, Donating uploads will help the users to keep their ratio's where they should be.";
$LANG["Q&A"] = "Q&A";
$LANG["TRANSFER_UPLOAD"] = "Transfer Upload";
$LANG["DONATE_TO"] = "Donate To";
$LANG["ANONYMOUS_TRANSFER"] = "Anonymous Transfer";
$LANG["AMOUNT_CREDIT"] = "Amount Credit";

2022-11-01 17:12:06
Thank you for this mod, however your uptransfer.php didn't work without modifications, here is my working one

<?
#             Modified By Dalibor                #
#            Last Modified 28-6-2008             #
#         Modified to 2.08 By ArcticWolf         #
#     Update by spiritblue  12-07-2019 (TTV3)    #
##################################################

/* Connect To Database, And ONLY Allow Members */
require_once("backend/functions.php");
dbconn();
loggedinonly();
$action = $_REQUEST["action"];

if ($action == "taketransfer") {
  $username = $_POST["username"];

  if (!$username)
      show_error_msg("Error", "You are not connecting, or you are trying to transfer, but here we have secured .", 1);

  $credit = $_POST["credit"];

  if ($credit < 1 || (!$CURUSER))
      show_error_msg("Error", "You are not connecting, or your transfer is too small .", 1);

  $kb = 1024;
  $mb = 1024 * 1024;
  $gb = 1024 * 1024 * 1024;
  $tb = 1024 * 1024 * 1024 * 1024;

  if ($_POST["unit"] == 'mb')
      $credit = $credit * $mb;
  elseif ($_POST["unit"] == 'gb')
      $credit = $credit * $gb;
  elseif ($_POST["unit"] == 'tb')
      $credit = $credit * $tb;

  if ($CURUSER["uploaded"] < $credit)
      show_error_msg("Errorr", "You are trying to upload upload donations while you currently have. ", 1);

  $query = SQL_Query_exec("SELECT id,uploaded,modcomment FROM users WHERE username = '$username'");
  $res = mysqli_fetch_assoc($query);
  $receiver = $res["id"];
  $sender = $CURUSER["id"];
  $modcomment2 = $CURUSER["modcomment"];

  $modcomment1 = $res["modcomment"];

  $modcomment1 = gmdate("Y-m-d") . " - Credit upload: $username obtained " . mksize($credit) . " from $site_config[SITEURL]/account-details.php?id=$sender " . $CURUSER['username'] . ".\n" . $modcomment1;
  $modcomment2 = gmdate("Y-m-d") . " - Credit upload: $site_config[SITEURL]/account-details.php?id=$sender " . $CURUSER['username'] . " to give  " . mksize($credit) . " by $username.\n" . $modcomment2;



  SQL_Query_exec("UPDATE users SET uploaded = uploaded + $credit, modcomment = " . sqlesc($modcomment1) . " WHERE id = '$receiver'");
  SQL_Query_exec("UPDATE users SET uploaded = uploaded - $credit, modcomment = " . sqlesc($modcomment2) . " WHERE id = '$sender'");
  $subject = "Ajout de credit upload!";
  if ($_POST["anonym"] != 'anonym') {
      $msg = sqlesc("Your account has been credited with  " . mksize($credit) . " compliments of  " . $CURUSER['username'] . "");
      SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, poster, subject) VALUES($sender, $receiver, NOW(), $msg, 0," . sqlesc($subject) . ")");
  } else {
      $msg = sqlesc("Your account has been credited  " . mksize($credit) . " Compliments of an anonymous user .");
      SQL_Query_exec("INSERT INTO messages (sender, receiver, added, msg, poster, subject) VALUES(0, $receiver, NOW(), $msg, 0, " . sqlesc($subject) . ")");
  }
  write_log("<font color=lime size=2>Credit Upload:</font><a href=account-details.php?id=$sender target=_blank>" . $CURUSER['username'] . "</a> has offered  " . mksize($credit) . " a <a href=account-details.php?id=$receiver target=_blank>$username</a>");

  autolink($site_config[SITEURL] . "/index.php", "you gave  " . mksize($credit) . " in credit upload a  " . $username);
  // header("Refresh: 0; url=index.php");  // I guess this would work under 2.08... No clue LOL
  die();
}
/*  Start Page Output  */
stdhead("Donate Uploads");
begin_frame(T_('INFO_DONATE_UPLOAD_CREDITS'));
?>
<b><?php echo T_("WHY_SHOULD_DONATE"); ?></b><br />
<?php echo T_("CREDIT_UP_TEXT1"); ?>
<br /><br />
<b><?php echo T_("WHY_SHOULD_DONATE_UP"); ?></b><br />
<?php echo T_("CREDIT_UP_TEXT2"); ?>
<?php
end_frame();
begin_frame(T_('TRANSFER_UPLOAD'));
?>
<center>
<form name="transfer" method="post" action="uptransfer.php?action=taketransfer">
<table class="table_table table_col1" width="50%" cellpadding="5" border="0" align="center"><tr><td align="right"><b><?php echo T_("DONATE_TO"); ?>: </b></td><td align="left"><input type="text" name="username" size="20"> <input type="checkbox" name="anonym" value="anonym"> <?php echo T_("ANONYMOUS_TRANSFER"); ?></td></tr>&nbsp;
<tr><td align="right"><?php echo T_("AMOUNT_CREDIT"); ?>:</b></td><td align="left"><input type="text" name="credit" size="20" value="1">
<select name="unit"><br />
<option value="false">Selection</option>
<option value="mb">KB</option>
<option value="mb">MB</option>
<option value="gb">GB</option>
<option value="tb">TB</option>
</select></table><br/><center><input name="submit" type="submit" value="Transfer!"></center></td>
</tr></form></center>
<?php
end_frame();
stdfoot();
?>
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: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728