/*
Project : T-Xore version 0.0.4 released on 06/2006 By Bogaa
This piece of software is free to use by anyone and may be redistributed
and modified by anyone in any way. We can't be held liable for damage
or copyright infringement claims. Read the documentation!
Bogaa's Homepage : http://www.meganova.org
Project Homepage : http://www.devnova.org
*/
require_once "config.php";
connect ($dbhost, $dbuser, $dbpass, $database);
// Check if a comment was posted
if ($_POST['submitted'] == '')
{
// The details query
$res = mysql_query("SELECT poster FROM torrents WHERE torrents.id ='".strip_tags(trim($_GET['id']))."'")
or sqlerr();
$row = mysql_fetch_array($res);
$result = mysql_query("SELECT * FROM torrents LEFT JOIN categories ON torrents.subcat = categories.subid WHERE torrents.id ='".strip_tags(trim($_GET['id']))."'") or die (mysql_error());
$count = mysql_num_rows($result);
if ($count == 0)
{
stheader('Torrent Not Found');
echo '
Torrent not found!
';
footer();
die;
}
// extract data from sql
while ($row = mysql_fetch_array($result))
{
extract($row);
stheader('Torrent Details for: '.htmlentities($torrentname));
?>
$tracker = parse_url($tracker);
// Display upload description
if ($description == 1)
{
$result_desc = mysql_query("SELECT descr FROM description where id = '".strip_tags(trim($_GET['id']))."' LIMIT 1");
while ($row = mysql_fetch_array($result_desc))
{
extract($row);
$description = '
Description'.nl2br(str_replace(' ',' ',$descr)).'
|
';
}
}
else
{
$description = '';
}
$result_desc1 = mysql_query("SELECT poster FROM torrents WHERE torrents.id ='".strip_tags(trim($_GET['id']))."'");
$row1 = mysql_fetch_array($result_desc1);
echo '';
// Display torrent details
echo '
'.htmlentities($torrentname).'
';
echo '';
echo 'Download | '.htmlentities($torrentname).' » (Magnet Link) |
';
echo 'wget Command | wget '.$base_uri.'download.php?id='.htmlentities($hash).' |
';
if($row1['poster']) {
echo ("Poster | |
");
}
else
{
echo ("Poster | |
");
}
echo 'Category | '.$name.' » '.$subname.' |
';
echo 'Size | '.torsize($size).' |
';
echo 'Seeds | '.getpeer($seeds).' |
';
echo 'Peers | '.getpeer($peers).' |
';
echo 'Downloaded | '.$downloads.' |
';
echo 'Tracker | http://'.htmlentities($tracker['host']).' ('.detreg($registration).') |
';
echo 'Added | '.$added.' |
';
echo 'Updated | '.$updated.' |
';
echo 'Hash | '.htmlentities($hash).' |
';
echo '';
echo ''.$description;
echo '
';
// Display toggle files link
echo '
';
// Display internal files
echo '
Internal files
';
echo '';
// Fetch comments from sql
$result = mysql_query("SELECT * FROM comments WHERE id ='".strip_tags(trim($_GET['id']))."'");
$comment_count = mysql_num_rows($result);
// div colors
$color1 = 'class="light"';
$color2 = 'class="dark"';
$row_count = 0;
echo '
Comments ('.$comment_count.')
';
if (!$comment_count == 0)
{
echo '';
}
footer();
}
// Handle posted comment
else
{
$result = mysql_query("SELECT * FROM ban WHERE ip = '$REMOTE_ADDR'");
if (mysql_num_rows($result) == 1)
{
stheader('You have been banned from this section!');
echo '
Banned!
You have been banned from this section of the site for a very very very good reason, if you think a mistake has been made feel free to contact one of the admins';
footer();
die;
}
$commentid = strip_tags(trim($_GET['id']));
$name = trim($_POST['user']);
$comment = trim($_POST['comment']);
$ip= $REMOTE_ADDR;
$date = date('YmdHis');
if ($comment == '' || $name == '')
{
stheader('Comment failed!');
echo '
Please fill out the entire form!
';
footer();
die;
}
stheader('Comment submitted');
mysql_query("INSERT INTO comments (id,ip,date,name,post) VALUES ('$commentid','$ip','$date','$name','$comment')");
echo '';
footer();
}
?>
'.nl2br(htmlentities($post)).'
'; $row_count++; } } $result = mysql_query("SELECT * FROM ban WHERE ip = '$REMOTE_ADDR'"); if (mysql_num_rows($result) == 1) { echo '
You cant add any comments!
You cant add any comments because you where banned for some reason.'; footer(); die; } echo '