<form name="commonpot" enctype="multipart/form-data" action="commonpot.php" method="post">
<input type="hidden" name="takebonus" value="yes" />
<table border="0" cellspacing="0" cellpadding="6" align="center">
<tr>
<td align='right'><b>How much you wasting on this?</b>: </td>
<td align='left'>
<input type="text" name="seedbonus" autocomplete="off" size="20" pattern="\d*" title="Only numbers are allowed.">
<br />
<font style='font-size: 10px;color:#d7bd2e'>
<i><b>*</b> Amount entered will be added to the pool with the other idiots points.</i>
</font>
</td>
</tr>
</table>
<br />
<center>
<input type="button" value="Go Back" onclick="history.back()" />
<input type="submit" value="Submit" />
<br />
</center>
</form> /*********************************************/
/* By OXYDE - torrenttrader.uk (2023) */
/* */
/* Torrent Trader v3 */
/*********************************************/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for commonpot
-- ----------------------------
DROP TABLE IF EXISTS `commonpot`;
CREATE TABLE `commonpot` (
`id` int(6) NOT NULL AUTO_INCREMENT,
`userid` int(6) NULL DEFAULT NULL,
`points` decimal(25, 0) NULL DEFAULT NULL,
`added` datetime NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of commonpot
-- ----------------------------
-- ----------------------------
-- Table structure for commonpot_status
-- ----------------------------
DROP TABLE IF EXISTS `commonpot_status`;
CREATE TABLE `commonpot_status` (
`status` enum('stopped','started') CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'stopped',
`start_date` datetime NULL DEFAULT NULL,
`stop_date` datetime NULL DEFAULT NULL
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of commonpot_status
-- ----------------------------
INSERT INTO `commonpot_status` VALUES ('stopped', NULL, NULL);
SET FOREIGN_KEY_CHECKS = 1;DROP TABLE IF EXISTS `commonpot`;
CREATE TABLE `commonpot` (
`id` int(6) NOT NULL AUTO_INCREMENT,
`userid` int(6) NULL DEFAULT NULL,
`points` decimal(25, 0) NULL DEFAULT NULL,
`added` datetime NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci;
DROP TABLE IF EXISTS `commonpot_status`;
CREATE TABLE `commonpot_status` (
`status` enum('stopped','started') CHARACTER SET utf8 NOT NULL DEFAULT 'stopped',
`start_date` datetime NULL DEFAULT NULL,
`stop_date` datetime NULL DEFAULT NULL
) ENGINE = MyISAM CHARACTER SET = utf8 COLLATE = utf8_General_ci;
column `forum_tg`.`commonpot`.`id` column `forum_tg`.`commonpot`.`id` //Common Pot (By OXYDE - torrenttrader.uk)
if ($site_config['COMMONPOT']){
begin_frame(T_("COMMONPOT"));
$res_commonpot = SQL_Query_exec("SELECT SUM(points) AS total FROM commonpot");
$pot = mysqli_fetch_array($res_commonpot);
$percent = (($pot["total"] / $site_config["COMMONPOT_SIZE"]) * 100);
$res_commonpot_status = SQL_Query_exec("SELECT * FROM commonpot_status");
$pot_status = mysqli_fetch_array($res_commonpot_status);
$now = get_date_time();
$delay = $site_config["FREELEECH_TIME"];
if ($delay >= 24) {
$delay = floor($delay / 24);
$unit = "days";
} else {
$unit = "hours";
}
$duration = date("M j, Y g:i a", strtotime(" + $delay $unit"));
$stop_date = date("M j, Y g:i a", strtotime("+ $delay $unit", strtotime($pot_status['start_date'])));
if ($pot_status["status"] == "stopped" && $pot["total"] == $site_config["COMMONPOT_SIZE"]) { $status_text = "<font color='#00FF00'>The pot is full and freeLeech will start in the next few minutes!</font>"; $participate = ""; }
elseif ($pot_status["status"] == "started" && $stop_date <= $now) { $status_text = "<font color='#00FF00'>FreeLeech is over and pot will be reset in the next few minutes.</font>"; $participate = ""; }
elseif ($pot_status["status"] == "started") { $status_text = "The pot is full and freeleech is <font color='#BFFF00'><b>ACTIVE</b></font> for <font color='#ffcd03'><b> $delay $unit</b></font> for everyone!<br>It will end on </b><font color='#FFA500'><b>" . date( "M j, Y g:i a", utc_to_tz_time( $pot_status['stop_date'] ) ) . "</b>"; $participate = ""; } else { $status_text = "$delay $unit of freeleech will be offered for everyone when the common pot is 100% full. Help increase the pot!"; $participate = "[ <a href='commonpot.php'>participate</a> ]"; }
if (empty($pot["total"])) { $pot_total = "0"; } else { $pot_total = $pot["total"]; }
?>
<table align='center'><tr><td style='padding: 0px; width: 500px; background-image: url(<?= $site_config["LOADBAR_IMG"] ?>loadbarbg.gif); background-repeat: repeat-x'>
<?php
if ($percent <= 50)
$pic = "loadbarred.gif";
elseif ($percent <= 70)
$pic = "loadbaryellow.gif";
else
$pic = "loadbargreen.gif";
$width = $percent * 5;
if ($percent >= .001) {
echo "<img src='" . $site_config["LOADBAR_IMG"] . $pic . "' height='15' width='$width' alt='$percent%'><div style='position:relative;top:-15px;margin:auto;width:50%;color:#000;text-align:center;font-weight:bold;'>" . $pot_total . " / " . $site_config["COMMONPOT_SIZE"] . " [" . rtrim(rtrim((string)number_format($percent, 3, ".", ""), "0"), ".") . "%]</div><div style='float:right;'><p align='right' style='font-size:13px;color:#FFF;font-weight:bold;'>" . $participate . "</p><p align='right' style='font-size:13px;color:#FFF;font-weight:bold;'>[ <a href='commonpot-history.php'>History</a> ]</p></div>" . $status_text;
} else {
echo "<img src='" . $site_config["LOADBAR_IMG"] . $pic . "' height='15' width='$width' alt='$percent%'><div style='position:relative;top:-15px;margin:auto;width:50%;color:#000;text-align:center;font-weight:bold;'>" . $pot_total . " / " . $site_config["COMMONPOT_SIZE"] . " [" . rtrim(rtrim((string)number_format($percent, 3, ".", ""), "0"), ".") . "%]</div><div style='float:right;'><p align='right' style='font-size:13px;color:#FFF;font-weight:bold;'>" . $participate . "</p></div>" . $status_text;
}
echo "</td></tr>";
echo "</table>";
end_frame();
}
//End Common Pot (By OXYDE - torrenttrader.uk) $expandrows = array_map("trim", $expandrows);
} //Common Pot (By OXYDE - torrenttrader.uk)
$res_pot = SQL_Query_exec("SELECT status FROM commonpot_status");
$pot = mysqli_fetch_assoc($res_pot);
//End Common Pot (By OXYDE - torrenttrader.uk) ///////////////// CLEAR COMMON POOL /////////////////////////////
if ($action == "clearpool") {
stdhead(T_("CLEAR_COMMON_POOL"));
error_reporting(E_ALL);
begin_frame("".T_("CLEAR_COMMON_POOL")."");
if ($do != "clearpoolforreal") {
?>
<br /><br />
<font size ='3'><center><?php echo T_("CLEAR_COMMON_POOL_MESSAGE"); ?></center></font>
<br /><br />
<form enctype="multipart/form-data" method="post" action="admincp.php">
<input type="hidden" name="action" value="clearpool" />
<input type="hidden" name="do" value="clearpoolforreal" />
<table class="f-border" cellspacing="0" cellpadding="5" width="100%" align="center">
<tr><td colspan="2" align="center"><input type="submit" value="<?php echo T_("CLEAR_COMMON_POOL");?>" /></td></tr>
</table></form>
<?php
}
if ($do == "clearpoolforreal") {
SQL_Query_exec("UPDATE commonpot_status SET status='stopped', start_date=NULL, stop_date=NULL");
SQL_Query_exec("TRUNCATE TABLE commonpot");
write_log("Common Pool cleared by $CURUSER[username]");
autolink ("admincp.php", "<b><font color='#ff0000'> Common Pool Cleared....</font></b>");
}
end_frame();
navmenu();
stdfoot();
}
///////////////END CLEAR COMMON POOL //////////////////////////////////////////////$LANG["CLEAR_COMMON_POOL"] = "Clear Common Pool";
$LANG["CLEAR_COMMON_POOL_MESSAGE"] = "Are you sure you want to reset the pool?";
$LANG["COMMON_POOL_CLEARED_MESSAGE"] = "Common Pot cleared and reset"; <td align="center"><a href="admincp.php?action=clearpool"><img src="images/admin/poolclear.png" border="0" width="118" height="80" alt="" /><br /><?php echo T_("CLEAR_COMMON_POOL"); ?><br /></a></td> function unesc($x) {
mysqli_real_escape_string($GLOBALS["DBconnector"],$x);
return $x;
} function timeAgo($time_ago) {
$time_ago = new DateTime($time_ago);
$now = new DateTime();
$interval = $now->diff($time_ago);
if ($interval->y > 0) {
$years = $interval->format("%y");
return $years . " year" . ($years > 1 ? "s" : "") . " ago";
} elseif ($interval->m > 0) {
$months = $interval->format("%m");
return $months . " month" . ($months > 1 ? "s" : "") . " ago";
} elseif ($interval->d > 0) {
$days = $interval->format("%d");
return $days . " day" . ($days > 1 ? "s" : "") . " ago";
} elseif ($interval->h > 0) {
$hours = $interval->format("%h");
return $hours . " hour" . ($hours > 1 ? "s" : "") . " ago";
} elseif ($interval->i > 0) {
$minutes = $interval->format("%i");
return $minutes . " minute" . ($minutes > 1 ? "s" : "") . " ago";
} else {
return "just now";
}
} function timeAgo($time_ago) {
$time_ago = new DateTime($time_ago);
$now = new DateTime();
$interval = $now->diff($time_ago);
if ($interval->y > 0) {
return $interval->format("%y years ago");
} elseif ($interval->m > 0) {
return $interval->format("%m months ago");
} elseif ($interval->d > 0) {
return $interval->format("%d days ago");
} elseif ($interval->h > 0) {
return $interval->format("%h hours ago");
} elseif ($interval->i > 0) {
return $interval->format("%i minutes ago");
} else {
return "just now";
}
} // Make torrent private
if ($external == "no") {
require_once("backend/BDecode.php");
require_once("backend/BEncode.php");
$dict = BDecode(file_get_contents("$torrent_dir/$fname"));
$dict["info"]["private"] = 1;
$fs = fopen("$torrent_dir/$fname", "w");
fwrite($fs, BEncode($dict));
fclose($fs);
$TorrentInfo = array();
$TorrentInfo = ParseTorrent("$torrent_dir/$fname");
$infohash = $TorrentInfo[1];
}
// End add make torrent private // Make torrent private
if ($external == "no") {
require_once("backend/BDecode.php");
require_once("backend/BEncode.php");
$dict = BDecode(file_get_contents("$torrent_dir/$fname"));
$dict["info"]["private"] = 1;
$fs = fopen("$torrent_dir/$fname", "w");
fwrite($fs, BEncode($dict));
fclose($fs);
$TorrentInfo = array();
$TorrentInfo = ParseTorrent("$torrent_dir/$fname");
$infohash = $TorrentInfo[1];
}
// End add make torrent private echo "<br /><br /><b>".T_("FILE_LIST").":</b> <img src='images/plus.gif' id='pic1' onclick='klappe_torrent(1)' alt='' /><div id='k1' style='display: none;'><table align='center' cellpadding='0' cellspacing='0' class='table_table' border='1' width='100%'><tr><th width='50' class='table_head'> ".T_("TYPE")."</th><th class='table_head' align='left'> ".T_("FILE")."</th><th width='50' class='table_head'> ".T_("SIZE")."</th></tr>";
$fres = SQL_Query_exec("SELECT * FROM `files` WHERE `torrent` = $id ORDER BY `path` ASC");
if (mysqli_num_rows($fres)) {
while ($frow = mysqli_fetch_assoc($fres)) {
$ext = pathinfo($frow['path'], PATHINFO_EXTENSION);
$filetype_icons = [
"mp3" => "/images/filetype-icons/mp3.png",
"iso" => "/images/filetype-icons/iso.png",
"mp4" => "/images/filetype-icons/mp4.png",
"png" => "/images/filetype-icons/png.png",
"jpg" => "/images/filetype-icons/jpg.png",
"mkv" => "/images/filetype-icons/mkv.png",
"rar" => "/images/filetype-icons/rar.png",
"avi" => "/images/filetype-icons/avi.png",
"nfo" => "/images/filetype-icons/nfo.png"
];
if(preg_match("/^r\d{2}$/", $ext)) {
$filetype_icon = "<img width=40 height=40 src='/images/filetype-icons/rar.png'>";
} elseif(isset($filetype_icons[$ext])) {
$filetype_icon = "<img width=40 height=40 src='" . $filetype_icons[$ext] . "'>";
} else {
$filetype_icon = "<img width=40 height=40 src='/images/filetype-icons/unknown.png'>";
}
echo "<tr><td class='table_col1'>".$filetype_icon."</td><td class='table_col1'>".htmlspecialchars($frow['path'])."</td><td class='table_col2'>".mksize($frow['filesize'])."</td></tr>";
} https://www.imdb.com/title/tt8593824/?ref_=nv_sr_srsg_3https://www.imdb.com/title/tt14642626///Get any IMDB link from descr and load it into the DB under imdb
$timdb = SQL_Query_exec("SELECT descr FROM torrents WHERE id = $id");
$bang = mysqli_fetch_assoc($timdb);
$bang2 = implode(" ",$bang);
preg_match_all('/\b(https?):\/\/(www).(imdb.com)[-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i', $bang2, $matches);
$urls = $matches[0];
function array_map_callback($url)
{
return mysqli_real_escape_string($GLOBALS["DBconnector"], $url);
}
array_map('array_map_callback', $urls);
foreach ($urls as $url) {
SQL_Query_exec("UPDATE `torrents` SET `imdb`= '".$url."' WHERE id = $id");
}//Get any IMDB link from descr and load it into the DB under imdb
$timdb = SQL_Query_exec("SELECT descr FROM torrents WHERE id = $id");
$bang = mysqli_fetch_assoc($timdb);
$bang2 = implode(" ",$bang);
preg_match_all('/\b(https?):\/\/(www).(imdb.com)[-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i', $bang2, $matches);
$urls = $matches[0];
function array_map_callback($url)
{
return mysql_real_escape_string($url);
}
array_map('array_map_callback', $urls);
foreach ($urls as $url) {
SQL_Query_exec("UPDATE `torrents` SET `imdb`= '".$url."' WHERE id = $id");
}