Bonjour, la fonction seed bonus est installé depuis un moment et les membres me disent que la mise à jour de leur compte en seedbonus est incorrecte quand il on plusieurs torrent en seed la fonction du seed bonus ne fonctionne pas correctement car il ne reçoivent pas la totalité de leur point par heure et qu'il faut plusieurs heures pour que la mise à jour s'effectue et ma configuration est de 2 points par heure ??
Hello, the seed bonus function has been installed for a while and members tell me that updating their seedbonus account is incorrect when they have several seed torrents the seed bonus function does not work correctly because they do not receive the their entire point per hour and it takes several hours for the update to take place and my configuration is 2 points per hour ??
voici ma configuration ci-dessous et je joint le fichier mybonus.php
here is my configuration below and I attach the mybonus.php file
config.php
// Seed Bonus
$site_config["bonuspertime"] = 2.0; // Set this to what ever you want to give people per torrent.
$site_config['autoclean_interval'] = '3600'; // Temps entre chaque nettoyage automatique (secondes).
$site_config["bonusmax"] = 50000; // Definissez la valeur maximale possible de votre bonus de démarrage.
$site_config['SEEDBONUS'] = true; // On or Off ? - true / false.
cleanup.php
// Seedbonus upadate 2019 by spiritblue / if() statemement edited by MicroMonkey and beer
if ($site_config["SEEDBONUS"]) {
$qry = "SELECT DISTINCT userid as peer, (
SELECT DISTINCT COUNT( torrent )
FROM peers
WHERE seeder = 'yes' AND userid = peer) AS count
FROM peers WHERE seeder = 'yes'";
$res = SQL_Query_exec($qry);
while ( $row = mysqli_fetch_object($res) )
{
SQL_Query_exec("UPDATE users SET seedbonus = seedbonus + '" . ($site_config["bonuspertime"] * $row->count) . "' WHERE id = '" . $row->peer . "' AND seedbonus < ".$site_config["bonusmax"]."");
}
}
// End Seedbonus
account.php
<?php print("<a href='mybonus.php'><b>Mon Seed bonus</b></a>");?>
admincp.php
#======================================================================#
# Seedbonus Manager
#======================================================================#
if ($action == "seedbonus" && $do != "change")
{
if (get_user_class() < 3)
show_error_msg("STOP", "Area reserved for people entitled! and you do not have permission !!!");
if ($do == "del")
{
if (!@count($_POST["ids"])) show_error_msg("Error", "select nothing.", 1);
$ids = array_map("intval", $_POST["ids"]);
$ids = implode(", ", $ids);
SQL_Query_exec("DELETE FROM `bonus` WHERE `id` IN ($ids)");
autolink("admincp.php?action=seedbonus", "deleted entries");
}
$count = get_row_count("bonus");
list($pagertop, $pagerbottom, $limit) = pager(25, $count, 'admincp.php?action=seedbonus&');
$res = SQL_Query_exec("SELECT id, title, cost, value, descr, type FROM `bonus` ORDER BY `type` $limit");
stdhead("Seedbonus Manager");
navmenu();
begin_frame("Management of Seed Bonus");
?>
<center>
This page displays all available options trade which users can exchange for seedbonus.<?php echo number_format($count); ?> ; <br><br><a href="admincp.php?action=seedbonus&do=change&id=null">Add</a> a new option?
</center>
<?php if ($count > 0): ?>
<br />
<form id="seedbonus" method="post" action="admincp.php?action=seedbonus">
<input type="hidden" name="do" value="del" />
<table border="0" cellpadding="3" cellspacing="0" width="100%" align="center" class="table_table">
<tr>
<th class="table_head">Title</th>
<th class="table_head">Description</th>
<th class="table_head">Points</th>
<th class="table_head">Valeur</th>
<th class="table_head">Type</th>
<th class="table_head">Edit</th>
<th class="table_head"><input type="checkbox" name="checkall" onclick="checkAll(this.form.id);" /></th>
</tr>
<?php while ($row = mysqli_fetch_object($res)):
$row->value = ( $row->type == "traffic" ) ? mksize( $row->value ) : ( int ) $row->value;
?>
<tr>
<td class="table_col1" align="center"><?php echo htmlspecialchars($row->title); ?></td>
<td class="table_col2"><?php echo htmlspecialchars($row->descr); ?></td>
<td class="table_col1" align="center"><?php echo $row->cost; ?></td>
<td class="table_col2" align="center"><?php echo $row->value; ?></td>
<td class="table_col1" align="center"><?php echo $row->type; ?></td>
<td class="table_col2" align="center"><a href="admincp.php?action=seedbonus&do=change&id=<?php echo $row->id; ?>">Edit</a></td>
<td class="table_col1" align="center"><input type="checkbox" name="ids[]" value="<?php echo $row->id; ?>" /></td>
</tr>
<?php endwhile; ?>
<tr>
<td colspan="7" align="right">
<input type="submit" value="Remove Selected" />
</td>
</tr>
</table>
</form>
<?php
endif;
if ($count > 25) echo $pagerbottom;
end_frame();
stdfoot();
}
if ($action == "seedbonus" && $do == "change")
{
$row = null;
if ( is_valid_id($_REQUEST['id']) )
{
$res = SQL_Query_exec("SELECT id, title, cost, value, descr, type FROM `bonus` WHERE `id` = '$_REQUEST[id]'");
$row = mysqli_fetch_object($res);
}
if ( $_SERVER['REQUEST_METHOD'] == 'POST' )
{
if ( empty($_POST['title']) or empty($_POST['descr']) or empty($_POST['type']) or !is_numeric($_POST['cost']) )
{
autolink($_SERVER['HTTP_REFERER'], "missing information.");
}
$_POST["value"] = ( $_POST["type"] == "traffic" ) ? strtobytes( $_POST["value"] ) : ( int ) $_POST["value"];
$var = array_map('sqlesc', $_POST);
extract( $var );
if ( $row == null )
{
SQL_Query_exec("INSERT INTO `bonus` (`title`, `descr`, `cost`, `value`, `type`) VALUES ($title, $descr, $cost, $value, $type)");
}
else
{
SQL_Query_exec("UPDATE `bonus` SET `title` = $title, `descr` = $descr, `cost` = $cost, `value` = $value, `type` = $type WHERE `id` = $id");
}
autolink("admincp.php?action=seedbonus", "Updating the bonus seed.");
}
stdhead("Seedbonus Management");
navmenu();
begin_frame("Seedbonus Management");
?>
<form method="post" action="admincp.php?action=seedbonus&do=change">
<?php if ($row != null): ?>
<input type="hidden" name="id" value="<?php echo $row->id; ?>" />
<?php endif; ?>
<table border="0" class="table_table" width="90%" cellpadding="3" align="center">
<tr>
<th class="table_head" colspan="2">Seedbonus Management</th>
</tr>
<tr>
<td class="table_col1"><b>Title:</b></td>
<td class="table_col2"><input type="text" name="title" value="<?php echo ( $row != null ? $row->title : null ); ?>" size="50" /></td>
</tr>
<tr>
<td class="table_col1"><b>Points:</b></td>
<td class="table_col2"><input type="text" name="cost" value="<?php echo ( $row != null ? $row->cost : null ); ?>" size="5" /></td>
</tr>
<tr>
<td class="table_col1"><b>Type:</b></td>
<td class="table_col2">
<select name="type">
<?php foreach (array('invite', 'traffic','VIP', 'other') as $type): ?>
<option value="<?php echo $type; ?>" <?php echo ( $row != null && $row->type == $type ? 'selected="selected"' : null ); ?>><?php echo $type; ?></option>
<?php endforeach; ?>
</select>
</td>
</tr>
<tr>
<td class="table_col1"><b>Value:</b></td>
<td class="table_col2"><input type="text" name="value" value="<?php echo ( $row != null ? $row->value : null ); ?>" size="10" /></td>
</tr>
<tr>
<td class="table_col1" valign="top"><b>Description:</b></td>
<td class="table_col2"><textarea name="descr" rows="5" cols="38"><?php echo ( $row != null ? $row->descr : null ); ?></textarea></td>
</tr>
<tr>
<td colspan="2" align="right">
<input type="reset" value="Cancel" />
<input type="submit" value="To send" />
</td>
</tr>
</table>
</form>
<?php
end_frame();
stdfoot();
}