Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
User Posts

Go to Profile

djlive There is still work to be done on it  has bugs in the code


$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);


///////////////////////////////////////////////////////////////////////////////
does not parked account
when I go into the log and refresh shows that it introduces it automatically
but it is not put in the user's account at all

seems to be the problem here

$updateQuery = "UPDATE users SET parked='yes', modcomment=? WHERE id=?";

and

mysqli_stmt_bind_param($stmt, "si", $modcom, $userId);


I replaced with the one in the initial post

ALTER TABLE users ADD parked enum ('yes','no') NOT NULL default 'no';

we corrected some codes here
//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



and here I've changed minor things

#======================================================================#
#   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
#======================================================================#


now everything works perfectly
thanks for code djlive
not works ....
is it possible to automatically parked for example 90 days etc.?
I would need if you can help me😐
Server Load help — 2023-06-07 21:29:32 in General Chat
ok  MicroMonkey thanks for the reply
Server Load help — 2023-06-04 22:06:14 in General Chat
it's too big PHP Load: 1.68 GB,  how can I solve it?
thanks
Server Load help — 2023-05-23 18:52:23 in General Chat
Thanks everyone problem solved but it doesn't show os  ex. debian 11 x86_x64 etc. the rest is fine

*******DjLive  thanks for the code******

Here was the problem
$server_check_version = '1.0.4';
$start_time = microtime(TRUE);

$operating_system = PHP_OS_FAMILY;

if ($operating_system === 'Windows') {
// Win CPU
$wmi = new COM('WinMgmts:\\\\.');
$cpus = $wmi->InstancesOf('Win32_Processor');
$cpuload = 0;
$cpu_count = 0;
foreach ($cpus as $key => $cpu) {
$cpuload += $cpu->LoadPercentage;
$cpu_count++;
}
// WIN MEM
$res = $wmi->ExecQuery('SELECT FreePhysicalMemory,FreeVirtualMemory,TotalSwapSpaceSize,TotalVirtualMemorySize,TotalVisibleMemorySize FROM Win32_OperatingSystem');
$mem = $res->ItemIndex(0);
$memtotal = round($mem->TotalVisibleMemorySize / 1000000,2);
$memavailable = round($mem->FreePhysicalMemory / 1000000,2);
$memused = round($memtotal-$memavailable,2);
// WIN CONNECTIONS
$connections = shell_exec('netstat -nt | findstr :80 | findstr ESTABLISHED | find /C /V ""');
$totalconnections = shell_exec('netstat -nt | findstr :80 | find /C /V ""');
} else {
// Linux CPU
$load = sys_getloadavg();
$cpuload = $load[0];
// Linux MEM
      // RAM usage
      $start_time = microtime(TRUE);

$free = shell_exec('free');
$free = (string)trim($free);
$free_arr = explode("\n", $free);
$mem = explode(" ", $free_arr[1]);
$mem = array_filter($mem, function($value) { return ($value !== null && $value !== false && $value !== ''); }); // removes nulls from array
$mem = array_merge($mem); // puts arrays back to [0],[1],[2] after filter removes nulls

//print_r($mem); echo '<hr>';
$memtotal = round($mem[1] / 1000000,2);
$memused = round($mem[2] / 1000000,2);
$memfree = round($mem[3] / 1000000,2);

$membuffer = round($mem[5] / 1000000,2);
$memcached = round($mem[6] / 1000000,2);

$memusage = round(($memused - $memcached - $membuffer)/$memtotal*100,2);

$connections = `netstat -ntu | grep :80 | grep ESTABLISHED | grep -v LISTEN | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -rn | grep -v 127.0.0.1 | wc -l`;
$totalconnections = `netstat -ntu | grep :80 | grep -v LISTEN | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -rn | grep -v 127.0.0.1 | wc -l`;

$load = sys_getloadavg();
$cpuload = $load[0];

$diskfree = round(disk_free_space(".") / 1000000000);
$disktotal = round(disk_total_space(".") / 1000000000);
$diskused = round($disktotal - $diskfree);

$diskusage = round($diskused/$disktotal*100);

if ($memusage > 85 || $cpuload > 2 || $diskusage > 95) {
$trafficlight = 'red';
} elseif ($memusage > 70 || $cpuload > 1 || $diskusage > 85) {
$trafficlight = 'orange';
} else {
$trafficlight = '#2F2';
}

$end_time = microtime(TRUE);
$time_taken = $end_time - $start_time;
$total_time = round($time_taken,4);
// Linux Connections
}

$memusage = round(($memused/$memtotal)*100);



$phpload = round(memory_get_usage() / 1000000,2);

$diskfree = round(disk_free_space(".") / 1000000000);
$disktotal = round(disk_total_space(".") / 1000000000);
$diskused = round($disktotal - $diskfree);

$diskusage = round($diskused/$disktotal*100);

if ($memusage > 85 || $cpuload > 85 || $diskusage > 85) {
$trafficlight = 'red';
} elseif ($memusage > 50 || $cpuload > 50 || $diskusage > 50) {
$trafficlight = 'orange';
} else {
$trafficlight = '#2F2';
}

$end_time = microtime(TRUE);
$time_taken = $end_time - $start_time;
$total_time = round($time_taken,4);



$uptime = shell_exec("cut -d. -f1 /proc/uptime");
$days = floor($uptime/60/60/24);
$hours = $uptime/60/60%24;
$mins = $uptime/60%60;
$secs = $uptime%60;
   $time = $days."days:".$hours."hours:".$mins."minutes";

// Operating system
exec('lsb_release -a', $output);
$line = array_search('Description:', $output);
$distribution = trim(substr($output[$line], strpos($output[$line], ':') + 1));



php load why it is so big how can I make it smaller??

Server Load help — 2023-05-20 18:57:58 in General Chat
hy, I have a problem with script Server load  can anyone help me

I'm using debian 11
I use the script below  

<?php
begin_frame(T_("SERVER_LOAD"));
$server_check_version = '1.0.4';
$start_time = microtime(TRUE);

$operating_system = PHP_OS_FAMILY;

if ($operating_system === 'Windows') {
// Win CPU
$wmi = new COM('WinMgmts:\\\\.');
$cpus = $wmi->InstancesOf('Win32_Processor');
$cpuload = 0;
$cpu_count = 0;
foreach ($cpus as $key => $cpu) {
$cpuload += $cpu->LoadPercentage;
$cpu_count++;
}
// WIN MEM
$res = $wmi->ExecQuery('SELECT FreePhysicalMemory,FreeVirtualMemory,TotalSwapSpaceSize,TotalVirtualMemorySize,TotalVisibleMemorySize FROM Win32_OperatingSystem');
$mem = $res->ItemIndex(0);
$memtotal = round($mem->TotalVisibleMemorySize / 1000000,2);
$memavailable = round($mem->FreePhysicalMemory / 1000000,2);
$memused = round($memtotal-$memavailable,2);
// WIN CONNECTIONS
$connections = shell_exec('netstat -nt | findstr :80 | findstr ESTABLISHED | find /C /V ""');
$totalconnections = shell_exec('netstat -nt | findstr :80 | find /C /V ""');
} else {
// Linux CPU
$load = sys_getloadavg();
$cpuload = $load[0];
// Linux MEM
      // RAM usage
      $meminfo = @file_get_contents("/proc/meminfo");
      preg_match("!^MemTotal:\s*(.*) kB!m", $meminfo, $memtotal);
      $memtotal = $memtotal[1] * 1024;
      preg_match("!^MemFree:\s*(.*) kB!m", $meminfo, $memfree);
      $memfree = $memfree[1] * 1024;
      preg_match("!^Buffers:\s*(.*) kB!m", $meminfo, $buffers);
      $buffers = $buffers[1] * 1024;
      preg_match("!^Cached:\s*(.*) kB!m", $meminfo, $cached);
      $cached = $cached[1] * 1024;

      $memused = mksize($memtotal - $memfree - $buffers - $cached);
      $memtotal = mksize($memtotal);
// Linux Connections
}

$memusage = round(($memused/$memtotal)*100);



$phpload = round(memory_get_usage() / 1000000,2);

$diskfree = round(disk_free_space(".") / 1000000000);
$disktotal = round(disk_total_space(".") / 1000000000);
$diskused = round($disktotal - $diskfree);

$diskusage = round($diskused/$disktotal*100);

if ($memusage > 85 || $cpuload > 85 || $diskusage > 85) {
$trafficlight = 'red';
} elseif ($memusage > 50 || $cpuload > 50 || $diskusage > 50) {
$trafficlight = 'orange';
} else {
$trafficlight = '#2F2';
}

$end_time = microtime(TRUE);
$time_taken = $end_time - $start_time;
$total_time = round($time_taken,4);

// use servercheck.php?json=1
//if (isset($_GET['json'])) {
// echo '{"ram":'.$memusage.',"cpu":'.$cpuload.',"disk":'.$diskusage.',"uptime":'.$uptime.'}';
// exit;
//}

 //$uptime = @file_get_contents( "/proc/uptime");
  $uptime = strtok( exec( "cat /proc/uptime" ), "." );
  $uptime = explode(" ",$uptime);
   $uptime = $uptime[0];
   $days = explode(".",(($uptime % 31556926) / 86400));
   $hours = explode(".",((($uptime % 31556926) % 86400) / 3600));
   $minutes = explode(".",(((($uptime % 31556926) % 86400) % 3600) / 60));
   $seconds = explode(".",((((($uptime % 31556926) % 86400) % 3600) / 60) / 60));

   $time = $days[0]."days:".$hours[0]."hours:".$minutes[0]."minutes";

// Operating system
      $temp = file_get_contents("/proc/version");
      if ($temp) {
          $osarray = explode(" ", $temp);
          $distros = [
              "Gentoo", "/etc/gentoo-release",
              "Fedora Core", "/etc/fedora-release",
              "Slackware", "/etc/slackware-version",
              "Cobalt", "/etc/cobalt-release",
              "Debian", "/etc/debian_version",
              "Mandrake", "/etc/mandrake-release",
              "Mandrake", "/etc/mandrakelinux-release",
              "Yellow Dog", "/etc/yellowdog-release",
              "Red Hat", "cat /etc/redhat-release", //Red Hat centos
              "Arch Linux", "/etc/arch-release",
          ];

          $distro = "";
          if (file_exists("cat /etc/*-release")) {
              $lsb = file_get_contents("cat /etc/*-release");
              preg_match('!DISTRIB_DESCRIPTION="(.*)"!', $lsb, $distro);
              $distro = $distro[1];
          } else {
              do {
                  if (file_exists($distros[1])) {
                      $distro = file_get_contents($distros[1]);
                      $distro = "$distros[0] " . preg_replace("/[^0-9]*([0-9.]+)[^0-9.]{0,1}.*/", "\\1", $distro);
                      break;
                  }
                  array_shift($distros);
                  array_shift($distros);
              } while (count($distros));
          }

          if (!$distro) {
              $distro = "Unknown Distro";
          }

          $operatingsystem = "$distro ($osarray[0] $osarray[2])";
      } else {
          $operatingsystem = "(N/A)";
      }

 



?>

<body>
<div id="container"  align="center">
<div id="trafficlight" class="nodark"></div>

<p><span class="description big">🌡️ RAM Usage:</span> <span class="result big"><?php echo $memusage; ?>%</span></p>
<p><span class="description big">🖥️ CPU Usage: </span> <span class="result big"><?php echo $cpuload; ?>%</span></p>
<p><span class="description">💽 Hard Disk Usage: </span> <span class="result"><?php echo $diskusage; ?>%</span></p>
<center><img src=images/pic_tbv/sageata.png></center>
<p><span class="description">🖧 <b><font color=lime><font color=red>Uptime</font>: </span> <span class="result"><?php echo $time; ?></font></b></span></p>
<p><span class="description">🖧 OS: </span> <span class="result"><?php echo $operatingsystem; ?></span></p>
<center><img src=images/pic_tbv/sageata.png></center>
<p><span class="description">🌡️ RAM Total:</span> <span class="result"><?php echo $memtotal; ?> GB</span></p>
<p><span class="description">🌡️ RAM Used:</span> <span class="result"><?php echo $memused; ?> GB</span></p>
<p><span class="description">🌡️ RAM Available:</span> <span class="result"><?php echo $memtotal; ?> GB</span></p>
<center><img src=images/pic_tbv/sageata.png></center>
<p><span class="description">💽 Hard Disk Free:</span> <span class="result"><?php echo $diskfree; ?> GB</span></p>
<p><span class="description">💽 Hard Disk Used:</span> <span class="result"><?php echo $diskused; ?> GB</span></p>
<p><span class="description">💽 Hard Disk Total:</span> <span class="result"><?php echo $disktotal; ?> GB</span></p>
<center><img src=images/pic_tbv/sageata.png></center>
<div id="details">

<p><span class="description">🌀 PHP Version: </span> <span class="result"><?php echo phpversion(); ?></span></p>
<p><span class="description">🏋️ PHP Load: </span> <span class="result"><?php echo $phpload; ?> GB</span></p>

<p><span class="description">⏱️ Load Time: </span> <span class="result"><?php echo $total_time; ?> sec</span></p>
</div>
</div>


</body>

<?
end_frame();
?>
it can be done an update for tt 3.0??? please kindly
Snatched — 2022-10-04 14:04:12 in General Chat
solved
Snatched — 2022-10-03 23:30:57 in General Chat
can it be from functions.php?
Snatched — 2022-10-03 21:24:25 in General Chat
hy guys,  I also have a problem why it doesn't work (seedtime days ecc) at Snatched  which may be the problem   any idea?? plis help my

did I do something wrong  the sql table??
Daily Login Bonus — 2022-08-10 21:00:17 in v3 Mods Completed
error no longer gives
but nothing happens when I get pm that I received in chat
Daily Login Bonus — 2022-08-06 13:46:33 in v3 Mods Completed
it doesn't work it gives me a time error

SQL_Query_exec("INSERT INTO shoutbox (userid, date, user, message) VALUES(".$userid.", NOW(), ".$CURUSER["username"]." ,".$msg_shout.")");


(userid, ///date,///// user, message)
Daily Login Bonus — 2022-07-28 14:02:37 in v3 Mods Completed
to appear in the chat who received it can be done??  thank you 👍
update logout function v3 — 2022-04-10 10:43:46 in v3 Support
is for to save the cookie  or delete them after logout
very cool  thanks
Say Thanks & Force — 2022-01-25 20:46:08 in v3 Mods Completed
thanks 😉  😉 |   I really needed   |



for who wants to put points bonus for a thanks


find this code  in thanks.php
SQL_Query_exec(sprintf("UPDATE `torrents` SET thanks = CONCAT_WS(',', `thanks`, %s) WHERE `id`=%d", sqlesc($CURUSER['username']), $id));


Add after
SQL_Query_exec("UPDATE users SET seedbonus = seedbonus+10.0 WHERE id = ".$CURUSER["id"]."") ; 

thank you  works very very cool🥰
Top 10 — 2022-01-07 17:27:19 in v3 Mods Completed
thanks is very nice
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 3
  • Members: 0
  • Guests online: 3
  • Comments: 3
  • Messages: 1,728