Hi Thib,
This is to inform you that everything works fine on v2.06.
Thanx. Regards.
This is to inform you that everything works fine on v2.06.
Thanx. Regards.
Quote:And the account don't update2012-05-06 - Admin has given 0.00 B to this user.
#======================================================================#
# Add Gigs To Users
#======================================================================#
if($action == "addgigs")
{
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
if ($_POST['doit'] == 'yes') {
mysql_query("UPDATE users SET uploaded = uploaded + 2147483648 WHERE status='confirmed'");
stderr("Upload", "2GB upload is sent to everyone...");
die;
}
if ($_POST["username"] == "" || $_POST["gigs"] == "" || $_POST["gigs"] == "")
show_error_msg("Error", "Missing form data.");
$username = sqlesc($_POST["username"]);
$uploaded = sqlesc($_POST["uploaded"]);
$userid = $CURUSER["id"];
$mb_basic=1024*1024;
if(isset($_POST['unit'])){
if ($_POST["unit"] =='1')
$nobits = $gigs*$mb_basic;
if ($_POST["unit"] =='2')
$nobits = $gigs*$mb_basic*1024;
}
$modcom = mysql_fetch_row(SQL_Query_exec("SELECT modcomment FROM users WHERE username=$username LIMIT 1"));
$modcomment = sqlesc(gmdate("Y-m-d") . " - ".$CURUSER['username']." has given ".mksize($nobits)." to this user.n " .$modcom[0]);
mysql_query("UPDATE users SET modcomment = $modcomment, uploaded=uploaded + $nobits WHERE username=$username") or sqlerr(__FILE__, __LINE__);
write_log("$CURUSER[username] has given ".mksize($nobits)." to ".$username."");
$res = SQL_Query_exec("SELECT id FROM users WHERE username=$username");
$arr = mysql_fetch_row($res);
if (!$arr) {
show_error_msg("Error", "Unable to update account.");
}else{
$msg ="$CURUSER[username] has given ".mksize($nobits)." to you";
mysql_query("INSERT INTO messages (sender, receiver, added, subject, msg) VALUES ('0', $arr[0], '" . get_date_time() . "','Add gigs', " . sqlesc($msg) .")");
}
header("Location: $site_config[sITEURL]/account-details.php?id=$arr[0]");
die;
}
stdhead("Update Users Upload Amounts");
navmenu();
begin_frame("Update Users Uploaded Amounts",false,10,false);
echo "<form method="post" action="admincp.php?action=addgigs">";
?>
<center><font color=red size=2><b>To add gigs put in the user's name and amount then choose MB for megabytes or GB for gigabytes.</b></font></center>
<p align=center><table border=0 width=100% cellspacing=0 cellpadding=0>
<?php
$res = SQL_Query_exec("SELECT username FROM users ORDER BY username");
$pseudo = "<select name="username">n";
while ($arr = mysql_fetch_assoc($res))
$pseudo .= "<option value="$arr[username]">$arr[username]</option>n";
$pseudo .= "</select>n";
?>
<tr>
<td class="rowhead"><b>User name</b></td>
<td class="row1"><?php echo $pseudo;?></td>
</tr>
<tr><td class="rowhead"><b>Amount</b></td><td class="row1"><input type="text" name="gigs" size="5"/><select name=unit><option value=1>MB</option><option value=2>GB</option></td></tr>
<tr><td colspan="2" class="row1" align="center"><input type="submit" value="Okay" class="btn"/></td></tr>
</table>
</form>
<?
end_frame();
stdfoot();
}
#======================================================================#
# End Add Gigs To Users
#======================================================================#
//======================================================================#
// Add Gigs To Users
//======================================================================#
if ($action == "addgigs") {
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if ($_POST['doit'] == 'yes') {
SQL_Query_exec("UPDATE users SET uploaded = uploaded + 2147483648 WHERE status='confirmed'");
show_error_msg("Upload", "2GB upload is sent to everyone...", 1);
die;
} //$_POST['doit'] == 'yes'
if ($_POST["username"] == "" || $_POST["gigs"] == "" || $_POST["gigs"] == "")
show_error_msg("Error", "Missing form data.", 1);
$username = sqlesc($_POST["username"]);
$gigs = $_POST["gigs"];
$uploaded = $_POST["uploaded"];
$userid = $CURUSER["id"];
$mb_basic = 1024 * 1024;
if (isset($_POST['unit'])) {
if ($_POST["unit"] == '1')
$nobits = $gigs * $mb_basic;
if ($_POST["unit"] == '2')
$nobits = $gigs * $mb_basic * 1024;
} //isset($_POST['unit'])
$res = SQL_Query_exec("SELECT id,modcomment FROM users WHERE username=$username");
$arr = mysql_fetch_row($res);
if (!$arr)
show_error_msg(T_("ERROR"), "Unable to update account.", 1);
$modcomment = $arr[1];
$modcomment = gmdate("Y-m-d") . " - " . $CURUSER['username'] . " has given " . mksize($nobits) . " to this user.n " . $modcomment;
SQL_Query_exec("UPDATE users SET modcomment = " . sqlesc($modcomment) . ", uploaded=uploaded + $nobits WHERE username=$username");
autolink("$site_config[sITEURL]/account-details.php?id=$arr[0]", "You gave " . mksize($nobits) . " To " . $username);
die;
} //$_SERVER['REQUEST_METHOD'] == 'POST'
stdhead("Update Users Upload Amounts");
navmenu();
begin_frame("Update Users Uploaded Amounts", false, 10, false);
echo "<form method="post" action="admincp.php?action=addgigs">";
?>
<center><font color=red size=2><b>To add gigs put in the user's name and amount then choose MB for megabytes or GB for gigabytes.</b></font></center>
<p align=center><table border=0 width=100% cellspacing=0 cellpadding=0>
<tr><td class="rowhead"><b>User name</b></td><td class="row1"><input type="text" name="username" size="40"/></td></tr>
<tr><td class="rowhead"><b>Amount</b></td><td class="row1"><input type="text" name="gigs" size="5"/><select name=unit><option value=1>MB</option><option value=2>GB</option></td></tr>
<tr><td colspan="2" class="row1" align="center"><input type="submit" value="Okay" class="btn"/></td></tr>
</table>
</form>
<?
end_frame();
stdfoot();
} //$action == "addgigs"
//======================================================================#
// End Add Gigs To Users
//======================================================================#
"phoenix75, post: 90558":yo" :)
hello interresting this mod,do not work TT2.08 blank page apply admincp
<?php
"phoenix75, post: 90603":
Here the image of the admincp
I don't have this screen this screen Walker1977

No users online
Torrents
Members
Online