DB::run("SELECT inactive.value_s AS userid, inactive.value_i AS last_mail, inactive.value_u AS mails, users.username FROM inactive LEFT JOIN users ON inactive.value_s=users.id WHERE inactive.arg='inactivemail' LIMIT 1"); DB::run("update inactive set value_i='$date', value_u='$count', value_s='$userid' WHERE arg='inactivemail' "); $row['descr'] $orderby = "ORDER BY torrents.added DESC, torrents.id DESC"; CREATE TABLE `tmdbfilm` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`id_tmdb` int(10) NOT NULL DEFAULT 0,
`title` varchar(255) DEFAULT NULL,
`duration` varchar(100) DEFAULT NULL,
`producer` varchar(255) DEFAULT NULL,
`genre` varchar(255) DEFAULT NULL,
`plot` text DEFAULT NULL,
`actor` longtext DEFAULT NULL,
`trailer` varchar(100) DEFAULT NULL,
`date` datetime DEFAULT NULL,
`image` varchar(50) DEFAULT NULL,
UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM;
-- --------------------------------------------------------
--
-- Table structure for table `tmdbshow`
--
CREATE TABLE `tmdbshow` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`id_tmdb` int(10) NOT NULL DEFAULT 0,
`title` varchar(255) DEFAULT NULL,
`image` varchar(50) DEFAULT NULL,
`season` int(10) DEFAULT NULL,
`episodes` int(10) DEFAULT NULL,
`status` varchar(100) DEFAULT NULL,
`date` datetime DEFAULT NULL,
`creator` varchar(255) DEFAULT NULL,
`genre` varchar(255) DEFAULT NULL,
`plot` text DEFAULT NULL,
`actor` longtext DEFAULT NULL,
UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM;
ALTER TABLE torrents ADD `tmdb` varchar(125) DEFAULT NULL; if (!empty($_POST["name"]))
$name = $_POST["name"];if (!empty($_POST['tmdb']))
$imdb = unesc($_POST['tmdb']);$ret = SQL_Query_exec("INSERT INTO torrents (filename, owner, name, descr, image1, image2, category, added, info_hash, size, numfiles, save_as, announce, external, nfo, torrentlang, anon, last_action) VALUES (".sqlesc($fname).", '".$CURUSER['id']."', ".sqlesc($name).", ".sqlesc($descr).", '".$inames[0]."', '".$inames[1]."', '".$catid."', '" . get_date_time() . "', '".$infohash."', '".$torrentsize."', '".$filecount."', ".sqlesc($fname).", '".$announce."', '".$external."', '".$nfo."', '".$langid."','$anon', '".get_date_time()."')");
$ret = SQL_Query_exec("INSERT INTO torrents (filename, owner, name, descr, image1, image2, category, added, info_hash, size, numfiles, save_as, announce, external, nfo, torrentlang, anon, last_action, tmdb) VALUES (".sqlesc($fname).", '".$CURUSER['id']."', ".sqlesc($name).", ".sqlesc($descr).", '".$inames[0]."', '".$inames[1]."', '".$catid."', '" . get_date_time() . "', '".$infohash."', '".$torrentsize."', '".$filecount."', ".sqlesc($fname).", '".$announce."', '".$external."', '".$nfo."', '".$langid."','$anon', '".get_date_time().", '".$tmdb."'')");
print ("<tr><td align='right'>" . T_("TORRENT_NAME") . ": </td><td align='left'><input type='text' name='name' size='60' value='" . $_POST['name'] . "' /><br />".T_("THIS_WILL_BE_TAKEN_TORRENT")." \n</td></tr>");print ("<tr><td align='right'>" . T_("TMDB") . ": </td><td align='left'> <input type='text' name='tmdb' size='60' value='" . $_POST['tmdb'] . "' /><br />(Link from TMDB. <b>Only for movie.</b>)<br />\n</td></tr>");
<?php
if (!$CURUSER) {
begin_block(T_("LOGIN"));
?>
<form method="post" action="account-login.php">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr><td>
<table border="0" cellpadding="1" align="center">
<tr>
<td align="center"><font face="verdana" size="1"><b><?php echo T_("USERNAME"); ?>:</b></font></td>
</tr><tr>
<td align="center"><input type="text" size="12" name="username" /></td>
</tr><tr>
<td align="center"><font face="verdana" size="1"><b><?php echo T_("PASSWORD"); ?>:</b></font></td>
</tr><tr>
<td align="center"><input type="password" size="12" name="password" /></td>
</tr><tr>
<td align="center"><input type="submit" value="<?php echo T_("LOGIN"); ?>" /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="center">[<a href="account-signup.php"><?php echo T_("SIGNUP");?></a>]<br />[<a href="account-recover.php"><?php echo T_("RECOVER_ACCOUNT");?></a>]</td> </tr>
</table>
</form>
<?php
end_block();
} else {
begin_block($CURUSER["username"]);
$avatar = htmlspecialchars($CURUSER["avatar"]);
if (!$avatar)
$avatar = $site_config["SITEURL"]."/images/default_avatar.png";
$userdownloaded = mksize($CURUSER["downloaded"]);
$useruploaded = mksize($CURUSER["uploaded"]);
$privacylevel = T_($CURUSER["privacy"]);
$bonus = $CURUSER['seedbonus'];
if ($CURUSER["uploaded"] > 0 && $CURUSER["downloaded"] == 0)
$userratio = "Inf.";
elseif ($CURUSER["downloaded"] > 0)
$userratio = number_format($CURUSER["uploaded"] / $CURUSER["downloaded"], 2);
else
$userratio = "---";
print ("<center><img width='80' height='80' src='$avatar' alt='' /></center><br />" . T_("DOWNLOADED") . ": $userdownloaded<br />" . T_("UPLOADED") . ": $useruploaded<br />".T_("CLASS").": ".T_($CURUSER["level"])."<br />" . T_("ACCOUNT_PRIVACY_LVL") . ": $privacylevel<br />". T_("RATIO") .": $userratio<br>Seedbonus : <b><a href=mybonus.php>".$bonus."</a></b>");
?>
<center><a href="account.php"><?php echo T_("ACCOUNT"); ?></a> <br />
<?php if ($CURUSER["control_panel"]=="yes") {print("<a href=\"admincp.php\">".T_("STAFFCP")."</a>");}?>
</center>
<?php
end_block();
}
?> <?php
require_once("backend/functions.php");
require_once("backend/bbcode.php");
dbconn();
if ($site_config["MEMBERSONLY"]) {
loggedinonly();
}
$id = (int)$_GET["id"];
$type = $_GET["type"];
$edit = (int)$_GET["edit"];
$delete = (int)$_GET["delete"];
$dossier = $CURUSER['bbcode'];
if ($edit == 1 || $delete == 1 || $_GET["takecomment"] == 'yes') loggedinonly();
if (!isset($id) || !$id || ($type != "torrent" && $type != "news"))
show_error_msg(T_("ERROR"), T_("ERROR"), 1);
if ($edit=='1'){
$row = mysqli_fetch_assoc(SQL_Query_exec("SELECT user, torrent, news FROM comments WHERE id=$id"));
// here
if($row['torrent'] == 0) {
$tid = $row['news'];
} else {
$tid = $row['torrent'];
}
//
if (($type == "torrent" && $CURUSER["edit_torrents"] == "no" || $type == "news" && $CURUSER["edit_news"] == "no") && $CURUSER['id'] != $row['user'])
show_error_msg(T_("ERROR"),T_("ERR_YOU_CANT_DO_THIS"),1);
$save = (int)$_GET["save"];
if($save){
$text = sqlesc($_POST['text']);
$query="UPDATE comments SET text=$text WHERE id=$id";
$result=SQL_Query_exec($query);
write_log("<a href=account-details.php?id=".$CURUSER['id']."><b>".$CURUSER['username']."</a></b> ID a été édité pour se commentaire: <b>$id</b> du torrent: [<a href=torrents-details.php?id=$id><b>$id</b></a>]");
// here
if ($type == 'torrent') {
autolink("torrents-details.php?id=$tid", 'success');
die();
} else {
autolink("comments.php?type=news&id=$tid", 'success');
die();
} autolink("torrents-details.php?id=$id", "Commentaire a été modifiée avec succès.");
//
#write_log($CURUSER['username']." a modifié le commentaire: ID:$id");
#show_error_msg(T_("COMPLETE"), "Commentaire Modifié !",1);
}
stdhead("Edit Comment");
$res = SQL_Query_exec("SELECT * FROM comments WHERE id=$id");
$arr = mysqli_fetch_array($res);
begin_frame(T_("EDITCOMMENT"));
print("<center><b>".T_("EDITCOMMENT")." </b><p>\n");
print("<form method=\"post\" name=\"comment\" action=\"comments.php?type=$type&edit=1&save=1&id=$id\">\n");
print textbbcode("comment","text",$dossier, htmlspecialchars($arr["text"]));
print("<center><p><input type=\"submit\" value=\"Soumettre les modifications\" /></p></center></form></center>\n");
end_frame();
stdfoot();
die();
#begin_frame(T_("EDITCOMMENT"));
#print("<center><b> ".T_("EDITCOMMENT")." </b><p>\n");
#print("<form method=\"post\" name=\"comment\" action=\"comments.php?type=$type&edit=1&save=1&id=$id\">\n");
#print textbbcode("comment","text", htmlspecialchars($arr["text"]));
#print("<p><input type=\"submit\" value=\"Submit Changes\" /></p></form></center>\n");
#end_frame();
#stdfoot();
#die();
}
if ($delete=='1'){
if ($CURUSER["delete_news"] == "no" && $type == "news" || $CURUSER["delete_torrents"] == "no" && $type == "torrent")
show_error_msg(T_("ERROR"),T_("ERR_YOU_CANT_DO_THIS"),1);
// here
$res = SQL_Query_exec("SELECT torrent, news FROM comments WHERE id=$id");
$row = mysqli_fetch_assoc($res);
if ($row["torrent"] == 0) {
$news_id = $row['news'];
SQL_Query_exec("DELETE FROM comments WHERE id = $id");
write_log($CURUSER['username']." has deleted comment: ID: $id");
autolink("comments.php?type=news&id=$news_id", 'Commentaire a été supprimé avec succès.');
die();
} else {
$tid = $row['torrent'];
SQL_Query_exec("UPDATE torrents SET comments = comments - 1 WHERE id = $row[torrent]");
SQL_Query_exec("DELETE FROM comments WHERE id = $id");
write_log($CURUSER['username']." has deleted comment: ID: $id");
autolink("torrents-details.php?id=$tid", 'Commentaire a été supprimé avec succès.');
die();
}
//
}
stdhead(T_("COMMENTS"));
//take comment add
if ($_GET["takecomment"] == 'yes'){
$body = $_POST['body'];
if (!$body)
show_error_msg(T_("ERROR"), T_("YOU_DID_NOT_ENTER_ANYTHING"), 1);
if ($type =="torrent"){
SQL_Query_exec("UPDATE torrents SET comments = comments + 1 WHERE id = $id");
}
SQL_Query_exec("INSERT INTO comments (user, ".$type.", added, text) VALUES (".$CURUSER["id"].", ".$id.", '" .get_date_time(). "', " . sqlesc($body).")");
if (mysqli_affected_rows($GLOBALS["DBconnector"]) == 1)
show_error_msg(T_("COMPLETED"), "Votre commentaire a été ajouté avec succès.", 0);
else
show_error_msg(T_("ERROR"), T_("UNABLE_TO_ADD_COMMENT"), 0);
}//end insert comment
//NEWS
if ($type =="news"){
$res = SQL_Query_exec("SELECT * FROM news WHERE id = $id");
$row = mysqli_fetch_array($res);
if (!$row){
show_error_msg(T_("ERROR"), "Nouvelles Id invalide", 0);
stdfoot();
}
begin_frame(T_("NEWS"));
echo htmlspecialchars($row['title']) . "<br /><br />".format_comment($row['body'])."<br />";
end_frame();
}
//TORRENT
if ($type =="torrent"){
$res = SQL_Query_exec("SELECT id, name FROM torrents WHERE id = $id");
$row = mysqli_fetch_array($res);
if (!$row){
show_error_msg(T_("ERROR"), "Nouveau Id invalide", 0);
stdfoot();
}
echo "<center><table><tr><td width=50% height=50% class=ttable_head colspan=2 align=center style=line-height:100px;padding-top:14px;vertical-align:middle;font-size:20px;><b>".T_("COMMENTSFOR").":</b> <a href='torrents-details.php?id=".$row['id']."'>".htmlspecialchars($row['name'])."</a></td></tr></table></center><br />";
#echo "<center><b>".T_("COMMENTSFOR")."</b> <a href='torrents-details.php?id=".$row['id']."'>".htmlspecialchars($row['name'])."</a></center><br />";
}
begin_frame(T_("COMMENTS"));
$subres = SQL_Query_exec("SELECT COUNT(*) FROM comments WHERE $type = $id");
$subrow = mysqli_fetch_array($subres);
$commcount = $subrow[0];
if ($commcount) {
list($pagertop, $pagerbottom, $limit) = pager(10, $commcount, "comments.php?id=$id&type=$type&");
$commquery = "SELECT comments.id, text, user, comments.added, avatar, signature, username, title, class, uploaded, downloaded, privacy, donated FROM comments LEFT JOIN users ON comments.user = users.id WHERE $type = $id ORDER BY comments.id $limit";
$commres = SQL_Query_exec($commquery);
}else{
unset($commres);
}
if ($commcount) {
print($pagertop);
commenttable($commres, $type);
print($pagerbottom);
}else {
print("<br /><b>" .T_("NOCOMMENTS"). "</b><br />\n");
}
echo "<center>";
echo "<form name=\"comment\" method=\"post\" action=\"comments.php?type=$type&id=$id&takecomment=yes\">";
#echo textbbcode("comment","body")."<br />";
echo textbbcode("comment","body","$dossier")."<br />";
echo "<input type=\"submit\" value=\"".T_("ADDCOMMENT")."\" />";
echo "</form></center>";
end_frame();
stdfoot();
?> ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
if ($edit=='1'){
/////
$row = mysqli_fetch_assoc(SQL_Query_exec("SELECT user, torrent, news FROM comments WHERE id=$id"));
if($row['torrent'] == 0) {
$tid = $row['news'];
} else {
$tid = $row['torrent'];
}
//////
if (($type == "torrent" && $CURUSER["edit_torrents"] == "no" || $type == "news" && $CURUSER["edit_news"] == "no") && $CURUSER['id'] != $row['user'])
show_error_msg(T_("ERROR"),T_("ERR_YOU_CANT_DO_THIS"),1);
$save = (int)$_GET["save"];
if($save){
$text = sqlesc($_POST['text']);
$query="UPDATE comments SET text=$text WHERE id=$id";
$result=SQL_Query_exec($query);
write_log($CURUSER['username']." has edited comment: ID:$id");
/////
if ($type == 'torrent') {
autolink("torrents-details.php?id=$tid", 'success');
die();
} else {
autolink("comments.php?type=news&id=$tid", 'success');
die();
}
///////
}
stdhead("Edit Comment");
$res = SQL_Query_exec("SELECT * FROM comments WHERE id=$id");
$arr = mysqli_fetch_array($res);
begin_frame(T_("EDITCOMMENT"));
print("<center><b> ".T_("EDITCOMMENT")." </b><p>\n");
print("<form method=\"post\" name=\"comment\" action=\"comments.php?type=$type&edit=1&save=1&id=$id\">\n");
print textbbcode("comment","text", htmlspecialchars($arr["text"]));
print("<p><input type=\"submit\" value=\"Submit Changes\" /></p></form></center>\n");
end_frame();
stdfoot();
die();
}
if ($delete=='1'){
if ($CURUSER["delete_news"] == "no" && $type == "news" || $CURUSER["delete_torrents"] == "no" && $type == "torrent")
show_error_msg(T_("ERROR"),T_("ERR_YOU_CANT_DO_THIS"),1);
/////////
$res = SQL_Query_exec("SELECT torrent, news FROM comments WHERE id=$id");
$row = mysqli_fetch_assoc($res);
if ($type == "torrent") {
if ($row["torrent"] > 0) {
SQL_Query_exec("UPDATE torrents SET comments = comments - 1 WHERE id = $row[torrent]");
$tid = $row['torrent'];
SQL_Query_exec("DELETE FROM comments WHERE id = $id");
write_log($CURUSER['username']." has deleted comment: ID: $id");
autolink("torrents-details.php?id=$tid", 'Comment deleted OK');
die();
}
} else {
$tid = $row['news'];
SQL_Query_exec("DELETE FROM comments WHERE id = $id");
write_log($CURUSER['username']." has deleted comment: ID: $id");
autolink("comments.php?type=news&id=$tid", 'Comment deleted OK');
die();
}
///////
}
stdhead(T_("COMMENTS")); $row = mysqli_fetch_assoc(SQL_Query_exec("SELECT user, torrent FROM comments WHERE id=$id"));
$tid = $row['torrent'];if ($edit=='1'){
$row = mysqli_fetch_assoc(SQL_Query_exec("SELECT user, torrent FROM comments WHERE id=$id"));
$tid = $row['torrent'];
if (($type == "torrent" && $CURUSER["edit_torrents"] == "no" || $type == "news" && $CURUSER["edit_news"] == "no") && $CURUSER['id'] != $row['user'])
show_error_msg(T_("ERROR"),T_("ERR_YOU_CANT_DO_THIS"),1);
$save = (int)$_GET["save"];
if($save){
$text = sqlesc($_POST['text']);
$query="UPDATE comments SET text=$text WHERE id=$id";
$result=SQL_Query_exec($query);
write_log($CURUSER['username']." has edited comment: ID:$id");
autolink("torrents-details.php?id=$tid", 'success');
die(); print("<form method=\"post\" name=\"comment\" action=\"comments.php?type=$type&edit=1&save=1&id=$id\">\n");print("<form method=\"post\" name=\"comment\" action=\"comments.php?tid=$tid&type=$type&edit=1&save=1&id=$id\">\n");$id = (int)$_GET["id"];$tid = (int)$_GET["tid"];autolink("torrents-details.php?id=$id", "Commentaire a été modifiée avec succès.");autolink("torrents-details.php?id=$tid", "Commentaire a été modifiée avec succès.");commenttable($commres, 'torrent');commenttable($commres, 'torrent', $id);function commenttable($res, $type = null) {function commenttable($res, $type = null, $tid = 0) { if ($type == "torrent" && $CURUSER["edit_torrents"] == "yes" || $type == "news" && $CURUSER["edit_news"] == "yes" || $CURUSER['id'] == $row['user'])
$edit = '[<a href="comments.php?id='.$row["id"].'&type='.$type.'&edit=1">Edit</a>] '; if ($type == "torrent" && $CURUSER["edit_torrents"] == "yes" || $type == "news" && $CURUSER["edit_news"] == "yes" || $CURUSER['id'] == $row['user'])
$edit = '[<a href="comments.php?tid=$tid&id='.$row["id"].'&type='.$type.'&edit=1">Edit</a>] '; class TTtmdb
{ public static function getId($url)
{
$parts = explode('/', $url);
$id_tmdb = strtok($parts[4], '-');
return $id_tmdb;
}$id_tmdb = $row["tmdb"];$id_tmdb = TTtmdb::getId($row["tmdb"]); autolink("torrents-details.php?id=$id", "Commentaire a été modifiée avec succès.");
die(); //DELETE PENDING USER ACCOUNTS OVER TIMOUT AGE
$deadtime = gmtime() - $site_config["signup_timeout"];
SQL_Query_exec("DELETE FROM users WHERE status = 'pending' AND added < FROM_UNIXTIME($deadtime)");
$site_config['signup_timeout'] = '259200';
dbconn();require_once("backend/TTtmdb.php");
define('MovieCats', array('Movies')); // movie cats eg array('Movies','MoviesHD')
define('SerieCats', array('Anime')); // serie cat eg array('Anime','tv')
$res = SQL_Query_exec("SELECT torrents.anon, torrents.seeders, torrents.banned, torrents.leechers, torrents.info_hash, torrents.filename, torrents.nfo, torrents.last_action, torrents.numratings, torrents.name, torrents.owner, torrents.save_as, torrents.descr, torrents.visible, torrents.size, torrents.added, torrents.views, torrents.hits, torrents.times_completed, torrents.id, torrents.type, torrents.external, torrents.image1, torrents.image2, torrents.announce, torrents.numfiles, torrents.freeleech, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating, torrents.numratings, categories.name AS cat_name, torrentlang.name AS lang_name, torrentlang.image AS lang_image, categories.parent_cat as cat_parent, users.username, users.privacy FROM torrents LEFT JOIN categories ON torrents.category = categories.id LEFT JOIN torrentlang ON torrents.torrentlang = torrentlang.id LEFT JOIN users ON torrents.owner = users.id WHERE torrents.id = $id");torrents.tmdbif (!$row || ($row["banned"] == "yes" && $CURUSER["edit_torrents"] == "no"))
show_error_msg(T_("ERROR"), T_("TORRENT_NOT_FOUND"), 1); if(!empty($row["tmdb"]) && in_array($row["cat_parent"], SerieCats)) {
$id_tmdb = $row["tmdb"];
$total = get_row_count("seriethequemdb"," WHERE id_tmdb = ".$id_tmdb."");
if($total == 0) {
TTtmdb::createSerie($id_tmdb, $id);
}
} elseif(!empty($row["tmdb"]) && in_array($row["cat_parent"], MovieCats)) {
$id_tmdb = $row["tmdb"];
$total = get_row_count("filmothequemdb"," WHERE id_tmdb = ".$id_tmdb."");
if($total == 0) {
TTtmdb::createFilm($id_tmdb, $id);
}
}//end download boxecho "<fieldset class='download'>";
echo "<table cellpadding='3' border='0' width='100%'>";
if(!empty($row["tmdb"]) && in_array($row["cat_parent"], SerieCats)) {
$id_tmdb = $row["tmdb"];
$total = get_row_count("seriethequemdb"," WHERE id_tmdb = ".$id_tmdb."");
if($total > 0) {
TTtmdb::getSerie($id_tmdb);
}
} elseif(!empty($row["tmdb"]) && in_array($row["cat_parent"], MovieCats)) {
$id_tmdb = $row["tmdb"];
$total = get_row_count("filmothequemdb"," WHERE id_tmdb = ".$id_tmdb."");
if($total > 0) {
TTtmdb::getFilm($id_tmdb);
}
}
echo "</tr></table></fieldset><br /></div>"; if (strtoupper(substr(PHP_OS, 0, 3)) == "WIN") {
// Get total physical memory (this is in bytes)
$cmd = "wmic ComputerSystem get TotalPhysicalMemory";
@exec($cmd, $outputTotalPhysicalMemory);
// Get free physical memory (this is in kibibytes!)
$cmd = "wmic OS get FreePhysicalMemory";
@exec($cmd, $outputFreePhysicalMemory);
if ($outputTotalPhysicalMemory && $outputFreePhysicalMemory) {
// Find total value
foreach ($outputTotalPhysicalMemory as $line) {
if ($line && preg_match("/^[0-9]+\$/", $line)) {
$memoryTotal = $line;
break;
}
}
// Find free value
foreach ($outputFreePhysicalMemory as $line) {
if ($line && preg_match("/^[0-9]+\$/", $line)) {
$memoryFree = $line;
$memoryFree *= 1024; // convert from kibibytes to bytes
break;
}
}
}
$memtotal = mksize($memoryFree);
$memused = mksize($memoryTotal);
$users = ["none"];
$loadnow = "";
$load5 = "";
$load15 = "";
$operatingsystem = "";
$up = "";
} else {
// Users and load information
$reguptime = exec("uptime");
if ($reguptime) {
if (preg_match("/up (.*), *(\d) (users?), .*: (.*), (.*), (.*)/", $reguptime, $uptime)) {
$up = preg_replace("!(\d\d):(\d\d)!", '\1h\2m', $uptime[1]);
$users[0] = $uptime[2];
$users[1] = $uptime[3];
$loadnow = $uptime[4];
$load5 = $uptime[5];
$load15 = $uptime[6];
}
} else {
$up = "--";
$users[0] = "NA";
$users[1] = "--";
$loadnow = "NA";
$load5 = "--";
$load15 = "--";
}
// 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", "/etc/redhat-release",
"Arch Linux", "/etc/arch-release",
];
$distro = "";
if (file_exists("/etc/lsb-release")) {
$lsb = file_get_contents("/etc/lsb-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)";
}
// 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);
}ini_set('display_errors', 0);
ini_set('display_startup_errors', 0);
error_reporting(0);while (list($code, $url) = thisEach($smilies))
$s = str_replace($code, '<img border="0" src="'.$site_config["SITEURL"].'/images/smilies/'.$url.'" alt="'.$code.'" title="'.$code.'" />', $s); foreach($smilies as $code => $url) {
$s = str_replace($code, '<img border="0" src="'.$site_config["SITEURL"].'/images/smilies/'.$url.'" alt="'.$code.'" title="'.$code.'" />', $s);
}