Quote:modifiedALTER TABLE users ADD(parked enum ('yes','no') NOT NULL default 'no');
Quote:ALTER TABLE users ADD parked enum ('yes','no') NOT NULL default 'no';
Quote:modifiedALTER TABLE users ADD(parked enum ('yes','no') NOT NULL default 'no');
Quote:ALTER TABLE users ADD parked enum ('yes','no') NOT NULL default 'no';
print ("<tr><td align=right class=table_col2><b>Account Parked:</b> </td><td class=table_col2><input type=radio name=parked" . ($CURUSER["parked"] == "yes" ? " checked" : "") . " value=yes><font color=#FF0000><b>Yes</b></font> <input type=radio name=parked" . ($CURUSER["parked"] == "no" ? " checked" : "") . " value=no><font color=#00FF00><b>No</b></font><br><i>You can park your account to prevent it from being deleted because of inactivity if you go away on for example a vacation. When the account has been parked limits are put on the account, for example you cannot use the tracker and browse some of the pages.</i></td></tr>");
$maxdt = sqlesc(get_date_time(gmtime() - 86400*60));
$res = SQL_Query_exec("SELECT id, username, modcomment FROM users WHERE parked='no' AND enabled ='yes' AND last_access < $maxdt ");
if (mysqli_num_rows($res) > 0)
{
$dt = sqlesc(get_date_time());
while ($arr = mysqli_fetch_assoc($res))
{
$modcomment = $row['modcomment'];
$modcomment3 = gmdate("Y-m-d") . " Account auto parked .";
$modcomment = $modcomment3 . "n" . $modcomment;
$modcom = sqlesc($modcomment);
SQL_Query_exec("UPDATE users SET parked = 'yes' , modcomment = $modcom WHERE id = $arr[id]");
write_log("<a href=account-details.php?id=$arr[id]><b>$arr[username]</b></a> Account auto parked.");
}$maxdt = sqlesc(get_date_time(gmtime() - 86400*60));
$res = SQL_Query_exec("SELECT id, username, modcomment FROM users WHERE parked='no' AND enabled ='yes' AND last_access != '0000-00-00 00:00:00' AND last_access < $maxdt ");
if (mysqli_num_rows($res) > 0)
{
$dt = sqlesc(get_date_time());
while ($arr = mysqli_fetch_assoc($res))
{
$modcomment = $row['modcomment'];
$modcomment3 = gmdate("Y-m-d") . " Account auto parked .";
$modcomment = $modcomment3 . "n" . $modcomment;
$modcom = sqlesc($modcomment);
SQL_Query_exec("UPDATE users SET parked = 'yes' , modcomment = $modcom WHERE id = $arr[id]");
write_log("<a href=account-details.php?id=$arr[id]><b>$arr[username]</b></a> Account auto parked.");
}
ALTER TABLE users ADD parked enum ('yes','no') NOT NULL default 'no';$userfields = "u.id, u.class, u.uploaded, u.downloaded, u.ip, u.passkey,parkedif (!$user)
err("Cannot locate a user with that passkey!");if ($user["parked"] == "yes")
err("Error, your account is parked! Please read the FAQ!");print ("<TR><TD align=right class=table_col2><B>Account Parked:</B> </td><td class=table_col2><input type=radio name=parked" . ($CURUSER["parked"] == "yes" ? " checked" : "") . " value=yes><B>Yes</B> <input type=radio name=parked" . ($CURUSER["parked"] == "no" ? " checked" : "") . " value=no><B>No</B><br><i>You can park your account to prevent it from being deleted because of inactivity if you go away on for example a vacation. When the account has been parked limits are put on the account, for example you cannot use the tracker and browse some of the pages.</i></td></tr>");
$acceptpms = $_POST["acceptpms"];$parked = $_POST["parked"];$updateset[] = "title = ".sqlesc($title);$updateset[] = "parked = " . sqlesc($parked);<td align=center><a href=admincp.php?action=parked><img src=images/admin/confirmaccounts.gif border=0 width=32 height=32><br><center><b>Parked<BR>Users</center></b></a><BR></td> #======================================================================#
# Parked users
#======================================================================#
if ($action == "parked") {
if ($CURUSER["class"] < "9"){
show_error_msg("Error","Sorry you do not have the rights to view this page!",1);
}
stdhead("Parked Users Management");
navmenu();
$res2 = SQL_Query_exec("SELECT COUNT(*) FROM users WHERE parked='yes'");
$row = mysqli_fetch_array($res2);
$count = $row[0];
$perpage = 50;
list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, "admincp.php?action=parked&");
begin_frame("Parked Users Management");
echo $pagertop;
?>
<CENTER><table align=center cellpadding="0" cellspacing="0" class="table_table" width="100%" border="1">
<tr>
<td class=table_head align=center>Username</td>
<td class=table_head align=center>Added</td>
<td class=table_head align=center>Last Visit</td>
<td class=table_head align=center>Uploaded</td>
<td class=table_head align=center>Downloaded</td>
<td class=table_head align=center>Edit?</td>
</tr>
<?
$rqq = "SELECT id, username, last_access, added, uploaded, downloaded FROM users WHERE parked='yes' ORDER BY username $limit ";
$resqq = SQL_Query_exec($rqq);
while ($row = mysqli_fetch_array($resqq)){
extract ($row);
echo "<tr><td class=table_col1><a href=account-details.php?id=$row[id]>$row[username]</a></td><td class=table_col2>".utc_to_tz($row['added'])."</td><td class=table_col1>$row[last_access]</td><td class=table_col2>".mksize($row["uploaded"])."</td><td class=table_col1>".mksize($row["downloaded"])."</td><td class=table_col2><a href=account-details.php?id=$row[id]>EDIT</a></td></tr>\n";
}
echo "</table></CENTER>\n";
print($pagerbottom);
end_frame();
stdfoot();
}
#======================================================================#
# End Parked users
#======================================================================#
function parked() {
global $CURUSER;
if ($CURUSER["parked"] == "yes")
show_error_msg("Error", "your account is parked.", 1);
}parked();AND parked = 'no'//start parked
$parked1 = sqlesc(get_date_time(gmtime() - 86400*364)); // 364 - 52 weeks
$res = SQL_Query_exec("SELECT id, username, modcomment FROM users WHERE parked='no' AND enabled ='yes' AND last_access < $parked1 ");
if (mysqli_num_rows($res) > 0)
$dt = sqlesc(get_date_time());
{
while ($arr = mysqli_fetch_assoc($res))
{
$modcomment = $arr['modcomment'];
$modcomment3 = gmdate("Y-m-d") . " Account auto parked .";
$modcomment = $modcomment3 . "n" . $modcomment;
$modcom = sqlesc($modcomment);
SQL_Query_exec("UPDATE users SET parked = 'yes' , modcomment = $modcom WHERE id = $arr[id]");
write_log("<b><font color=red>Inactive account:</font> <a href=account-details.php?id=$arr[id]><font color=green><b>$arr[username]</b></font></a> Account auto parked.</b>");
}
}
//end parked#======================================================================#
# Parked users
#======================================================================#
if ($action == "parked") {
if ($CURUSER["class"] < "9"){
show_error_msg("Error","Sorry you do not have the rights to view this page!",1);
}
stdhead("Parked Users Management");
$res2 = SQL_Query_exec("SELECT COUNT(*) FROM users WHERE parked='yes'");
$row = mysqli_fetch_array($res2);
$count = $row[0];
$perpage = 50;
list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, "staffpanel.php?action=parked&");
begin_frame("Parked Users Management");
echo $pagertop;
?>
<center><table align=center cellpadding="0" cellspacing="0" class="table_table" width="100%" border="1">
<tr>
<td class=table_head align=center>Username</td>
<td class=table_head align=center>Joined</td>
<td class=table_head align=center>Last Visit</td>
<td class=table_head align=center>Uploaded</td>
<td class=table_head align=center>Downloaded</td>
<td class=table_head align=center>Edit?</td>
</tr>
<?
$rqq = "SELECT id, username, last_access, added, uploaded, downloaded FROM users WHERE parked='yes' ORDER BY username $limit ";
$resqq = SQL_Query_exec($rqq);
while ($row = mysqli_fetch_array($resqq)){
extract ($row);
echo "<tr><td class=table_col1><center><b><a href=account-details.php?id=$row[id]>$row[username]</b></a> <img src=pic/parked.png></center></td><td class=table_col2><center><font color=lime>".utc_to_tz($row['added'])."</font></center></td><td class=table_col1><center><font color=red>$row[last_access]</font> </center></td><td class=table_col2><center><font color=lime>".mksize($row["uploaded"])."</center></td><td class=table_col1><center><font color=red>".mksize($row["downloaded"])."</center></font></td><td class=table_col2><a href=account-details.php?id=$row[id]><center><img src=images/edit.png></center></a></td></tr>\n";
}
echo "</table></center>\n";
print($pagerbottom);
end_frame();
navmenu();
stdfoot();
}
#======================================================================#
# End Parked users
#======================================================================#
// Start parked
$parked1 = get_date_time(gmtime() - 86400 * 364); // 364 - 52 weeks
$parked1 = sqlesc($parked1);
$res = SQL_Query_exec("SELECT id, username, modcomment FROM users WHERE parked='no' AND enabled='yes' AND last_access < $parked1");
if (mysqli_num_rows($res) > 0) {
while ($arr = mysqli_fetch_assoc($res)) {
$modcomment = $arr['modcomment'];
$modcomment3 = gmdate("Y-m-d") . " Account auto parked .";
$modcomment = $modcomment3 . "\n" . $modcomment; // Use "\n" for a new line
$modcom = sqlesc($modcomment);
$userId = (int)$arr['id']; // Cast to integer for safety
$updateQuery = "UPDATE users SET parked='yes', modcomment=? WHERE id=?";
$stmt = mysqli_prepare($dbconn, $updateQuery);
mysqli_stmt_bind_param($stmt, "si", $modcom, $userId);
mysqli_stmt_execute($stmt);
$username = $arr['username'];
write_log("<b><font color=red>Inactive account:</font> <a href=account-details.php?id=$userId><font color=green><b>$username</b></font></a> Account auto parked.</b>");
}
}
// End parked
$userId = (int)$arr['id']; // Cast to integer for safety
$updateQuery = "UPDATE users SET parked='yes', modcomment=? WHERE id=?";
$stmt = mysqli_prepare($dbconn, $updateQuery);
mysqli_stmt_bind_param($stmt, "si", $modcom, $userId);
mysqli_stmt_execute($stmt);
$updateQuery = "UPDATE users SET parked='yes', modcomment=? WHERE id=?";
mysqli_stmt_bind_param($stmt, "si", $modcom, $userId);
modcomment=? WHERE id=? it is not a bug. let me try to explain why is like this$parked1 = sqlesc(get_date_time(gmtime() - 86400*92)); //start parked
$parked1 = sqlesc(get_date_time(gmtime() - 86400*92));
$res = SQL_Query_exec("SELECT id, username, modcomment FROM users WHERE parked='no' AND enabled ='yes' AND last_access < $parked1 ");
if (mysqli_num_rows($res) > 0) {
$dt = sqlesc(get_date_time()); // Corrected placement of the curly brace
while ($arr = mysqli_fetch_assoc($res)) {
$modcomment = $arr['modcomment'];
$modcomment3 = gmdate("Y-m-d") . " Account auto parked .";
$modcomment = $modcomment3 . "\n" . $modcomment; // Changed "n" to "\n" for a new line
$modcom = sqlesc($modcomment);
SQL_Query_exec("UPDATE users SET parked = 'yes' , modcomment = $modcom WHERE id = $arr[id]");
write_log("<b><font color=red>Inactive account:</font> <a href=account-details.php?id=$arr[id]><font color=green><b>$arr[username]</b></font></a> Account auto parked.</b>");
}
}
//end parked
No users online
Torrents
Members
Online