$ss_r = SQL_Query_exec("SELECT * from stylesheets");
$ss_sa = array();
while ($ss_a = mysqli_fetch_assoc($ss_r)){
$ss_id = $ss_a["id"];
$ss_name = $ss_a["name"];
$ss_sa[$ss_name] = $ss_id;
}
ksort($ss_sa);
reset($ss_sa);
while (list($ss_name, $ss_id) = thisEach($ss_sa)){
if ($ss_id == $CURUSER["stylesheet"]) $ss = " selected='selected'"; else $ss = "";
$stylesheets .= "<option value='$ss_id'$ss>$ss_name</option>\n";
}
?>
<form method="post" action="take-theme.php">
<select name="stylesheet" onchange="this.form.submit();"><?=$stylesheets?></select><input type="hidden" name="Submit" value="ok">
</form>
case 'name':
$char1 = 35; //cut name length Quote:"error: expected value (list, dict, int or string) in bencoded string"
<?php
if (!$site_config["MEMBERSONLY"] || $CURUSER) {
begin_block(T_("SEARCH"));
?>
<center>
<form method="get" action="torrents-search.php"><br />
<img src="images/blocks/headersearch.png">
<input type="text" name="search" size="30" value="<?php echo htmlspecialchars($_GET["search"]); ?>" />
<img src="images/blocks/in.png"> <select name="cat">
<option value="0">(<?php echo T_("ALL_TYPES"); ?>)</option>
<?php
$cats = genrelist();
$catdropdown = "";
foreach ($cats as $cat) {
$catdropdown .= "<option value=\"" . $cat["id"] . "\"";
if ($cat["id"] == $_GET["cat"])
$catdropdown .= " selected=\"selected\"";
$catdropdown .= ">" . htmlspecialchars($cat["parent_cat"]) . ": " . htmlspecialchars($cat["name"]) . "</option>\n";
}
?>
<?php echo $catdropdown; ?>
</select>
<img src="images/blocks/&.png"> <select name="incldead">
<option value="1"><?php echo T_("INCLUDE_DEAD"); ?></option>
<option value="0"><?php echo T_("ACTIVE"); ?></option>
<option value="2"><?php echo T_("ONLY_DEAD"); ?></option>
</select>
<?php if ($site_config["ALLOWEXTERNAL"]){?>
<select name="inclexternal">
<option value="0"><?php echo T_("LOCAL"); ?>/<?php echo T_("EXTERNAL"); ?></option>
<option value="1"><?php echo T_("LOCAL_ONLY"); ?></option>
<option value="2"><?php echo T_("EXTERNAL_ONLY"); ?></option>
</select>
<?php } ?>
<input type="submit" value="<?php echo T_("SEARCH"); ?>" />
</form>
</center>
<?php
end_block();
}
?>///DISPLAY NFO BLOCK
begin_frame("NFO");
if ($row["nfo"] == "yes") {
echo('<img src="nfoview.php?id=' . $id . '">');
}
else {
print(T_("NFO_NOT_FOUND"));
}
end_frame();
/// END NFO
// Unwarned
$timenow = gmtime();
SQL_Query_exec("UPDATE warnings SET active = 'no' WHERE active = 'yes' AND expiry < '".get_date_time()."'");
$res = SQL_Query_exec("SELECT users.id, users.username, warnings.expiry FROM users INNER JOIN warnings ON users.id = warnings.userid WHERE warned = 'yes' AND enabled = 'yes' AND warnings.active = 'yes' AND warnings.type = 'Poor Ratio'");
while ($arr1 = mysqli_fetch_assoc($res)) {
$user = $arr1["id"];
$subject = "Your poor ratio warning has been removed";
$msg = "Congratulations! Your poor ratio warning has been removed. You can now download again.";
// Get the user's current ratio
$query = "SELECT users.uploaded, users.downloaded
FROM users
WHERE users.id = $user";
$result = SQL_Query_exec($query);
$data = mysqli_fetch_assoc($result);
$uploaded = $data['uploaded'];
$downloaded = $data['downloaded'];
if ($downloaded > 0) {
$userRatio = $uploaded / $downloaded;
} else {
$userRatio = 0;
}
$minRatio = $site_config['ratiowarn_minratio'];
if ($userRatio >= $minRatio) {
SQL_Query_exec("UPDATE users SET warned = 'no' WHERE id = $user");
if ($site_config["ratiowarn_enable"] && $site_config["ratiowarn_daystowarn"] > 0) {
SQL_Query_exec("UPDATE users SET downloadbanned = 'no' WHERE id = $user");
}
// Insert a message to notify the user
SQL_Query_exec("INSERT INTO messages (sender, receiver, added, subject, msg, poster) VALUES (0, $user, '".get_date_time()."', ".sqlesc($subject).", ".sqlesc($msg).", 1)");
}
}
//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 modcomment=? WHERE id=? it is not a bug. let me try to explain why is like this
// 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 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'$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.");
} $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.");
}$uid = mysqli_real_escape_string($GLOBALS["DBconnector"], $CURUSER["id"]);
$jquery = SQL_Query_exec("SELECT COUNT(`hnr`) FROM `snatched` WHERE `uid` = '$uid' AND `hnr` = 'yes'");