Quote:
Originally Posted by clocktower
u got a link or more info
|
Here this code to alter under TS v 5.1
We choose most the most swung for last week
And in the form of creeping pictures (we creep upwards) we show clients.
As a result the most popular becomes even more popular
PHP Code:
$res = mysql_query("SELECT id,category,seeders, torrents.image1, leechers, name, times_completed from torrents WHERE added > DATE_SUB(NOW(), INTERVAL 6 DAY) ORDER BY times_completed DESC LIMIT 6") or sqlerr(__FILE__, __LINE__);
$num = mysql_num_rows($res);
if ($num > 0) {
$content .= "<table border=1 cellspacing=0 cellpadding=5 width=100%><tr>";
$content .= "<table border=1 cellspacing=0 cellpadding=5 width=100%><tr><td class=block>";
$content .= "<MARQUEE behavior= \"scroll\" align=\"left\" direction= \"up\" height=\"220\" scrollamount= \"2\" scrolldelay= \"80\" >";
//$content .= "<MARQUEE behavior= \"scroll\" align=\"left\" direction= \"up\" height=\"220\" scrollamount= \"2\" scrolldelay= \"90\" onmouseover= \"this.stop()\" onmouseout='this.start()'>";
for ($i = 0; $i < $num; ++$i)
{
while ($row = mysql_fetch_assoc($res)) {
$cros = mysql_query("SELECT name, image FROM categories WHERE id=$row[category]");
if (mysql_num_rows($cros) == 1)
{
$corr = mysql_fetch_assoc($cros);
$cat_img = "<img src=$BASEURL/pic/cats/" . $corr[image] . " border=0 alt='$corr[name]'>";
}
$content .= "<center><a href=details.php?id=$row[id]><b>$row[name]</b></a></center>";
$content .= "<center><a href=details.php?id=$row[id]><img border='0' src='thumb2.php?w=147&q=60&file=$row[image1]' border=\"0\" /></a> <align=center><font color=red><span title=\"Раздают\">" .number_format($row['seeders'])."</span><font color=green><span title=\"Качают\">"." ".number_format($row['leechers'])."<font color=aqua><span title=\"Всего скачано раз\">"." ".number_format($row['times_completed'])."</font></center>";
$content .= "<p>";
}
}
}
$content .= "</marquee></tr></td></table>";
In a fashion it is used resaizer pictures better standard (allows to reduce the size of a picture in kilobytes)
The given file to call thumb2.php and to put in a root tracker
PHP Code:
<?
$image = "torrents/images/".$_GET['file'];
// не забудьте поменять каталог если у вас картинки хранятся в другом месте
if ( is_file($image) )
{
list($image_width, $image_height, $image_type) = getimagesize($image);
switch ($image_type) {
case "1" : $image_src = imagecreatefromgif ($image); break;
case "2" : $image_src = imagecreatefromjpeg($image); break;
case "3" : $image_src = imagecreatefrompng ($image); break;
};
if ( !isset($_GET['q']) ) { $q = 80; } else { $q = $_GET['q']; };
if ( $_GET['w'] == 0 || $_GET['w'] > $image_width ) { $w = $image_width; } else { $w = $_GET['w']; };
$height = ($image_height * $w) / $image_width;
if ( isset($_GET['h']) && $height > $_GET['h'] ) { $w = ($image_width * $_GET['h']) / $image_height; $h = $_GET['h']; } else { $h = $height; };
$im = imagecreatetruecolor($w, $h);
imagecopyresampled($im, $image_src, 0, 0, 0, 0, $w, $h, $image_width, $image_height);
}
else
{
$im = imagecreatetruecolor(1, 1);
};
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Content-type: image/jpeg");
imagejpeg($im, NULL, $q);
?>
================================================== ======================
Or for ts alters this code who can please
Code:
<?php
if (!defined('BLOCK_FILE')) {
header("Location: ../index.php");
exit;
}
$res = mysql_query("SELECT id, category, seeders, torrents.image1, leechers, name, times_completed from torrents WHERE category <> 17 AND torrents.image1 <> 0 AND added > DATE_SUB(NOW(), INTERVAL 6 DAY) ORDER BY times_completed DESC LIMIT 6") or sqlerr(__FILE__, __LINE__);
$num = mysql_num_rows($res);
if ($num > 0) {
$content .= "<table border=1 cellspacing=0 cellpadding=5 width=100%><tr>";
$content .= "<table border=1 cellspacing=0 cellpadding=5 width=100%><tr><td class=block>";
//$content .= "<MARQUEE behavior= \"scroll\" align=\"left\" direction= \"up\" height=\"220\" scrollamount= \"2\" scrolldelay= \"55\" >";
$content .= "<MARQUEE behavior= \"scroll\" align=\"left\" direction= \"up\" height=\"220\" scrollamount= \"2\" scrolldelay= \"65\" onmouseover= \"this.stop()\" onmouseout='this.start()'>";
for ($i = 0; $i < $num; ++$i)
{
while ($row = mysql_fetch_assoc($res)) {
$cros = mysql_query("SELECT name, image FROM categories WHERE id=$row[category]");
if (mysql_num_rows($cros) == 1)
{
$corr = mysql_fetch_assoc($cros);
$cat_img = "<img src=$BASEURL/pic/cats/" . $corr[image] . " border=0 alt='$corr[name]'>";
}
$content .= "<center><a href=details.php?id=$row[id]><b>$row[name]</b></a></center>";
$content .= "<center><a href=details.php?id=$row[id]><img alt='$row[name]' border='0' src='thumb2.php?w=147&q=60&file=$row[image1]' border=\"0\" /></a><br> <align=center><font color=red><span title=\"Раздают\">" .number_format($row['seeders'])."</span><font color=green><span title=\"Качают\">"." ".number_format($row['leechers'])."<font color=blue><span title=\"Всего скачано раз\">"." ".number_format($row['times_completed'])."</font></center>";
$content .= "<p>";
}
}
}
$content .= "</marquee></tr></td></table>";
================================================== =========
Or for ts alters this code who can please
Code:
<?php
if (!defined('BLOCK_FILE')) {
header("Location: ../index.php");
exit;
}
$res = mysql_query("SELECT id,category,seeders, torrents.poster, leechers, name, times_completed from torrents WHERE added > DATE_SUB(NOW(), INTERVAL 6 DAY) ORDER BY times_completed DESC LIMIT 6") or sqlerr(__FILE__, __LINE__);
$num = mysql_num_rows($res);
if ($num > 0) {
$content .= "<table border=1 cellspacing=0 cellpadding=5 width=100%><tr>";
$content .= "<table border=1 cellspacing=0 cellpadding=5 width=100%><tr><td class=block>";
$content .= "<MARQUEE behavior= \"scroll\" align=\"left\" direction= \"up\" height=\"220\" scrollamount= \"2\" scrolldelay= \"80\" >";
//$content .= "<MARQUEE behavior= \"scroll\" align=\"left\" direction= \"up\" height=\"220\" scrollamount= \"2\" scrolldelay= \"90\" onmouseover= \"this.stop()\" onmouseout='this.start()'>";
for ($i = 0; $i < $num; ++$i)
{
while ($row = mysql_fetch_assoc($res)) {
$cros = mysql_query("SELECT name, image FROM categories WHERE id=$row[category]");
if (mysql_num_rows($cros) == 1)
{
$corr = mysql_fetch_assoc($cros);
$cat_img = "<img src=$BASEURL/pic/cats/" . $corr[image] . " border=0 alt='$corr[name]'>";
}
$content .= "<center><a href=details.php?id=$row[id]><b>$row[name]</b></a></center>";
$content .= "<center><a href=details.php?id=$row[id]><img border='0' src='thumb2.php?w=147&q=60&file=$row[poster]' border=\"0\" /></a> <align=center><font color=red><span title=\"Раздают\">" .number_format($row['seeders'])."</span><font color=green><span title=\"Качают\">"." ".number_format($row['leechers'])."<font color=aqua><span title=\"Всего скачано раз\">"." ".number_format($row['times_completed'])."</font></center>";
$content .= "<p>";
}
}
}
$content .= "</marquee></tr></td></table>";
================================================== ============
Who will make such plugin for TS v 5.1 I shall be very grateful