------------------------------------- ENGLISH ----------------------------------------
I have made a Common Pool MOD with a GLOBAL FreeLeech.
This MOD work with Seed Bonus Points. Make sure you have the SeedBonus MOD. Members participate in raising bonus points in a common pool. When the total points are reached, the freeleech is activated for all members for 48 hours.
The total number of points required can be edited in the "config.php" file as well as the duration of the FreeLeech.
-------------------------------------- FRENCH -----------------------------------------
J'ai fait un MOD Pot Commun avec un FreeLeech GLOBAL.
Ce MOD fonctionne avec les Points Bonus. Assurez-vous d'avoir le MOD SeedBonus. Les membres participent à faire monter les points bonus dans un pot commun. Lorsque le total de points est atteint, le freeleech est activé pour tous les membres durant 48 heures.
Le total de points nécessaires est éditable dans le fichiers "config.php" ainsi que la durée du FreeLeech.
IN "index.php"
FIND
ADD BELOW
IN "backend/functions/cleanup.php" or "backend/cleanup.php"
AT THE END OF FILE BEFORE
ADD
IN "backend/functions/torrents.php" or "backend/torrents.php"
FIND
ADD AFTER
FIND
REPLACE BY
IN "torrents-details.php"
FIND
ADD AFTER
FIND
REPLACE BY
IN "languages/english.php" or "languages/french.php"
AT THE END OF FILE BEFORE
ADD
IN "backend/system/config.php" or "backend/config.php"
AT THE END OF FILE BEFORE
ADD
AND FINALLY EXTRACT THE RAR ARCHIVE AT THE ROOT OF YOUR WEBSITE AND EXECUTE THE SQL FILE "commonpot.sql" TO YOUR DATABASE INCLUDED IN THE "SQL" FOLDER OF THE RAR.
NOTE:
------------------------------------- ENGLISH ----------------------------------------
I didn't have time to translate everything and integrate it into the english.php or french.php file because I don't need it on my site. But if someone is brave enough to do it, go!
-------------------------------------- FRENCH -----------------------------------------
Je n'ai pas eu le temps de traduire le tout et de l'intégrer dans le fichier english.php ou french.php car je j'en ai pas de besoin sur mon site. Mais si quelqu'un est assez brave pour le faire, go!
I have made a Common Pool MOD with a GLOBAL FreeLeech.
This MOD work with Seed Bonus Points. Make sure you have the SeedBonus MOD. Members participate in raising bonus points in a common pool. When the total points are reached, the freeleech is activated for all members for 48 hours.
The total number of points required can be edited in the "config.php" file as well as the duration of the FreeLeech.
-------------------------------------- FRENCH -----------------------------------------
J'ai fait un MOD Pot Commun avec un FreeLeech GLOBAL.
Ce MOD fonctionne avec les Points Bonus. Assurez-vous d'avoir le MOD SeedBonus. Les membres participent à faire monter les points bonus dans un pot commun. Lorsque le total de points est atteint, le freeleech est activé pour tous les membres durant 48 heures.
Le total de points nécessaires est éditable dans le fichiers "config.php" ainsi que la durée du FreeLeech.
IN "index.php"
FIND
//check
if (file_exists("check.php") && $CURUSER["class"] == 8){
show_error_msg("WARNING", "Check.php still exists, please delete or rename the file as it could pose a security risk<br /><br /><a href='check.php'>View Check.php</a> - Use to check your config!<br /><br />",0);
}ADD BELOW
//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"];
$duration = date('Y-m-d H:i:s', strtotime(" + $delay hours"));
$stop_date = date("Y-m-d H:i:s", strtotime("+ $delay hours", strtotime($pot_status['start_date'])));
if ($pot_status["status"] == "stopped" && $pot["total"] == $site_config["COMMONPOT_SIZE"]) { $status_text = "<font color='#00FF00'>Le pot est plein et le FreeLeech commencera dans les prochaines minutes!</font>"; $participate = ""; }
elseif ($pot_status["status"] == "started" && $stop_date <= $now) { $status_text = "<font color='#00FF00'>Le FreeLeech est terminé et pot sera réinitialisé dans les prochaines minutes.</font>"; $participate = ""; }
elseif ($pot_status["status"] == "started") { $status_text = "Le pot est plein et le <font color='#ffcd03'><b>FreeLeech de ".$site_config["FREELEECH_TIME"]." heures</b></font> est <font color='#BFFF00'><b>ACTIVÉ</b></font> pour tous!<br>Il se terminera le </b><font color='#FFA500'><b>" . date( "M d, Y H:i:s", utc_to_tz_time( $pot_status['stop_date'] ) ) . "</b>"; $participate = ""; } else { $status_text = "Un FreeLeech de 48 heures sera offert pour tous lorsque le pot commun sera rempli à 100%. Aide tes amis à tomber en FreeLeech et tu feras des heureux!"; $participate = "[ <a href='commonpot.php'>Je participe</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 <= 70)
$pic = "loadbargreen.gif";
elseif ($percent <= 90)
$pic = "loadbaryellow.gif";
else
$pic = "loadbarred.gif";
$width = $percent * 5;
print("<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'>Historique</a> ]</p></div>$status_text");
echo "</td></tr>";
echo "</table>";
end_frame();
}
//End Common Pot (By OXYDE - torrenttrader.uk)IN "backend/functions/cleanup.php" or "backend/cleanup.php"
AT THE END OF FILE BEFORE
}
?>ADD
// COMMON POT (By OXYDE - torrenttrader.uk)
$res_commonpot = SQL_Query_exec("SELECT SUM(points) AS total FROM commonpot");
$pot = mysqli_fetch_array($res_commonpot);
$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"];
$duration = date('Y-m-d H:i:s', strtotime(" + $delay hours"));
$stop_date = date("Y-m-d H:i:s", strtotime("+ $delay hours", strtotime($pot_status['start_date'])));
if ($pot_status["status"] == "stopped" && $now >= $pot_status["stop_date"] && $pot["total"] == $site_config["COMMONPOT_SIZE"]) {
SQL_Query_exec("UPDATE commonpot_status SET status='started', start_date='$now', stop_date='$duration'");
}elseif ($pot_status["status"] == "started" && $now >= $stop_date && $pot["total"] == $site_config["COMMONPOT_SIZE"] ) {
SQL_Query_exec("UPDATE commonpot_status SET status='stopped', start_date=NULL, stop_date=NULL");
SQL_Query_exec("TRUNCATE TABLE commonpot");
}
// END COMMON POT (By OXYDE - torrenttrader.uk)IN "backend/functions/torrents.php" or "backend/torrents.php"
FIND
$expandrows = array_map("trim", $expandrows);
}
// EndADD AFTER
//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)FIND
if ($row["freeleech"] == 1)REPLACE BY
if ($row["freeleech"] == "1" || $pot["status"] == "started")IN "torrents-details.php"
FIND
$tag5 = '';ADD AFTER
//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)FIND
if ($row["external"]!='yes' && $row["freeleech"]=='1'){REPLACE BY
if ($row["external"]!='yes' && $row["freeleech"]=='1' || $row["external"]!='yes' && $pot["status"] == "started"){IN "languages/english.php" or "languages/french.php"
AT THE END OF FILE BEFORE
?>ADD
// Common Pot
$LANG["COMMONPOT"] = "POT COMMUN";IN "backend/system/config.php" or "backend/config.php"
AT THE END OF FILE BEFORE
?>ADD
// Common Pot
$site_config["LOADBAR_IMG"] = "images/loadbar/"; // Loadbar images location
$site_config["COMMONPOT"] = true; // Common Pot STATUS
$site_config["COMMONPOT_SIZE"] = "100000"; // Number of seed bonus points needed in common pot to start the GLOBAL FRELEECH FOR ALL.
$site_config["FREELEECH_TIME"] = "48"; // Duration of the GLOBAL FREELEECH when he started in hours (Default: 48).AND FINALLY EXTRACT THE RAR ARCHIVE AT THE ROOT OF YOUR WEBSITE AND EXECUTE THE SQL FILE "commonpot.sql" TO YOUR DATABASE INCLUDED IN THE "SQL" FOLDER OF THE RAR.
NOTE:
------------------------------------- ENGLISH ----------------------------------------
I didn't have time to translate everything and integrate it into the english.php or french.php file because I don't need it on my site. But if someone is brave enough to do it, go!
-------------------------------------- FRENCH -----------------------------------------
Je n'ai pas eu le temps de traduire le tout et de l'intégrer dans le fichier english.php ou french.php car je j'en ai pas de besoin sur mon site. Mais si quelqu'un est assez brave pour le faire, go!
Last edited by OXYDE on 2023-02-02 04:56:05

