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
carroussel
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Support

2022-06-05 10:52:47
Hello everyone and can you tell me the code to add to have the last torrents uploaded on the index, thanks in advance  ðŸ˜´
here is the code below and the image is not displayed ?



index.php

// scroller mod
begin_frame(T_("LATEST_TORRENTS_SCROLLER"));
echo '<iframe  src="'.$site_config["SITEURL"].'/carroussel.php" frameborder="0" marginheight="0" marginwidth="0" width="99%" height="160"  scrolling="no" align="middle"></iframe>';
end_frame();






carroussel.php

<?php
require_once($_SERVER["DOCUMENT_ROOT"]."/backend/functions/functions.php");
dbconn(true);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Infinite Carousel</title>
<style type="text/css" media="screen">
<!--
body { font: 1em "Trebuchet MS", verdana, arial, sans-serif; font-size: 100%; }
input, textarea { font-family: Arial; font-size: 125%; padding: 7px; }
label { display: block; }
a:link {color: transparent; text-decoration: underline; border:0; }
a:active {color: transparent; text-decoration: underline; border:0; }
a:visited {color: transparent; text-decoration: underline; border:0; }
a:hover {color: transparent; text-decoration: none; border:0; }
.infiniteCarousel {height:130px;width:830px;overflow:hidden;}
.infiniteCarousel .wrapper {width: 90%;overflow:hidden;min-height: 10em;margin: 0 40px;position: absolute;top: 0;}
.infiniteCarousel ul a img {border: 0px solid #000;border-radius: 14px;margin-left: auto;margin-right: auto;-moz-border-radius:14px;-webkit-border-radius:14px;}
.infiniteCarousel .wrapper ul {width: 9999px;list-style-image:none;list-style-position:outside;list-style-type:none;margin:0;padding:0;position: absolute;top: 0;}
.infiniteCarousel ul li {display:block;float:left;padding: 10px;height: 85px;width: 85px;}
.infiniteCarousel ul li a img {display:block;}
.infiniteCarousel .arrow {height: 36px;width: 37px;background: url(images/arrow.png) no-repeat 0 0;text-indent: -999px;position: absolute;top: 37px;cursor: pointer;}
.infiniteCarousel .forward {background-position: 0 0;right: 0;}
.infiniteCarousel .back {background-position: 0 -72px;left: 0;}
.infiniteCarousel .forward:hover {background-position: 0 -36px;}
.infiniteCarousel .back:hover {background-position: 0 -108px;}
-->
</style>
<script src="backend/js/jquery-2.2.3.min.js"></script>
<script src="backend/js/overlib.js"></script>
<script type="text/javascript">

(function () {
   $.fn.infiniteCarousel = function () {
       function repeat(str, n) {
           return new Array( n + 1 ).join(str);
       }
       
       return this.each(function () {
           // magic!
           var $wrapper = $('> div', this).css('overflow', 'hidden'),
               $slider = $wrapper.find('> ul').width(9999),
               $items = $slider.find('> li'),
               $single = $items.filter(':first')
               
               singleWidth = $single.outerWidth(),
               visible = Math.ceil($wrapper.innerWidth() / singleWidth),
               currentPage = 1,
               pages = Math.ceil($items.length / visible);
               
           /* TASKS */
           
           // 1. pad the pages with empty element if required
           if ($items.length % visible != 0) {
               // pad
               $slider.append(repeat('<li class="empty" />', visible - ($items.length % visible)));
               $items = $slider.find('> li');
           }
           
           // 2. create the carousel padding on left and right (cloned)
           $items.filter(':first').before($items.slice(-visible).clone().addClass('cloned'));
           $items.filter(':last').after($items.slice(0, visible).clone().addClass('cloned'));
           $items = $slider.find('> li');
           
           // 3. reset scroll
           $wrapper.scrollLeft(singleWidth * visible);
           
           // 4. paging function
           function gotoPage(page) {
               var dir = page < currentPage ? -1 : 1,
                   n = Math.abs(currentPage - page),
                   left = singleWidth * dir * visible * n;
               
               $wrapper.filter(':not(:animated)').animate({
                   scrollLeft : '+=' + left
               }, 500, function () {
                   // if page == last page - then reset position
                   if (page > pages) {
                       $wrapper.scrollLeft(singleWidth * visible);
                       page = 1;
                   } else if (page == 0) {
                       page = pages;
                       $wrapper.scrollLeft(singleWidth * visible * pages);
                   }
                   
                   currentPage = page;
               });
           }
           
           // 5. insert the back and forward link
           $wrapper.after('<a href="#" class="arrow back" border=0><</a><a href="#" class="arrow forward" border=0>></a>');
           
           // 6. bind the back and forward links
           $('a.back', this).click(function () {
               gotoPage(currentPage - 1);
               return false;
           });
           
           $('a.forward', this).click(function () {
               gotoPage(currentPage + 1);
               return false;
           });
           
           $(this).bind('goto', function (event, page) {
               gotoPage(page);
           });
           
           // THIS IS NEW CODE FOR THE AUTOMATIC INFINITE CAROUSEL
           $(this).bind('next', function () {
               gotoPage(currentPage + 1);
           });
       });
   };
})(jQuery);

$(document).ready(function () {
   // THIS IS NEW CODE FOR THE AUTOMATIC INFINITE CAROUSEL
   var autoscrolling = true;
   
   $('.infiniteCarousel').infiniteCarousel().mouseover(function () {
       autoscrolling = false;
   }).mouseout(function () {
       autoscrolling = true;
   });
   
   setInterval(function () {
       if (autoscrolling) {
           $('.infiniteCarousel').trigger('next');
       }
   }, 5000);
});
</script>
</head>
<body>
<?php

if($CURUSER){
   $query="SELECT id, name, image1 , seeders,leechers, category, size FROM torrents WHERE  banned ='no' AND visible='yes' AND image1 <> '' ORDER BY added DESC limit 60";
   $result = SQL_Query_exec($query);
   $num = mysqli_num_rows($result);
{
?>
   <div class="infiniteCarousel">
   <div class="wrapper">
   <ul>
<?php
   while($row = mysqli_fetch_assoc($result)){
   $name  = substr(htmlspecialchars($row['name']), 0, 30)."...";
   $res = SQL_Query_exec("SELECT name FROM categories WHERE id=$row[category]");
   $arr = mysqli_fetch_assoc($res);
   $cat = $arr["name"];
?>
   <li>

<a href="/torrents-details.php?id=<?php echo $row['id']; ?>" target="_top" onmouseover=" return overlib('<table><tr><td><center><?=$name?><br /><?=$cat?><br /><font color=#00FF7F><?=$row['seeders']?></font>&nbsp;<font color=#FFFFFF>Seed\'s /</font>&nbsp;<font color=#FF0000><?=$row['leechers']?></font>&nbsp;<font color=#FFFFFF>Leech\'s</font></center></td></tr></table>',BORDER, 2, CAPTIONSIZE, '0.5ems', TEXTFONT, 'Times Roman' ,CAPCOLOR, '#000000',FGCOLOR, '#000000', VAUTO); " onmouseout="return nd();"><img src="uploads/images/<?=$row["image1"] ?>" height="150" width="100"></a>

</li>
<?php
}
?>
</ul>
</div>
</div>
<?php
}
}
?>
</body>
</html>
<?php
?>



Last edited by niki on 2022-06-05 12:27:31
2022-06-05 13:40:58
Hello niki

Voilà ! ...
Fichier carroussel:
<?php
require_once("backend/functions.php");
dbconn(true);

?>
<link rel="stylesheet" type="text/css" href="<?php echo $site_config["SITEURL"]; ?>/themes/NAME THEME/carroussel/carroussel.css?v=1" media="all" charset="utf-8"/>
<script src="<?php echo $site_config["SITEURL"]; ?>/js/jquery.min.js"></script>
<script type="text/javascript">
(function () {
   $.fn.infiniteCarousel = function () {
       function repeat(str, n) {
           return new Array( n + 1 ).join(str);
       }
       
       return this.each(function () {
           // magic!
           var $wrapper = $('> div', this).css('overflow', 'hidden'),
               $slider = $wrapper.find('> ul').width(9999),
               $items = $slider.find('> li'),
               $single = $items.filter(':first')
               
               singleWidth = $single.outerWidth(),
               visible = Math.ceil($wrapper.innerWidth() / singleWidth),
               currentPage = 1,
               pages = Math.ceil($items.length / visible);
               
           /* TASKS */
           
           // 1. pad the pages with empty element if required
           if ($items.length % visible != 0) {
               // pad
               $slider.append(repeat('<li class="empty" />', visible - ($items.length % visible)));
               $items = $slider.find('> li');
           }
           
           // 2. create the carousel padding on left and right (cloned)
           $items.filter(':first').before($items.slice(-visible).clone().addClass('cloned'));
           $items.filter(':last').after($items.slice(0, visible).clone().addClass('cloned'));
           $items = $slider.find('> li');
           
           // 3. reset scroll
           $wrapper.scrollLeft(singleWidth * visible);
           
           // 4. paging function
           function gotoPage(page) {
               var dir = page < currentPage ? -1 : 1,
                   n = Math.abs(currentPage - page),
                   left = singleWidth * dir * visible * n;
               
               $wrapper.filter(':not(:animated)').animate({
                   scrollLeft : '+=' + left
               }, 500, function () {
                   // if page == last page - then reset position
                   if (page > pages) {
                       $wrapper.scrollLeft(singleWidth * visible);
                       page = 1;
                   } else if (page == 0) {
                       page = pages;
                       $wrapper.scrollLeft(singleWidth * visible * pages);
                   }
                   
                   currentPage = page;
               });
           }
           
           // 5. insert the back and forward link
           $wrapper.after('<a href="#" class="arrow back" border=0><</a><a href="#" class="arrow forward" border=0>></a> ');
           
           // 6. bind the back and forward links
           $('a.back', this).click(function () {
               gotoPage(currentPage - 1);
               return false;
           });
           
           $('a.forward', this).click(function () {
               gotoPage(currentPage + 1);
               return false;
           });
           
           $(this).bind('goto', function (event, page) {
               gotoPage(page);
           });
           
           // THIS IS NEW CODE FOR THE AUTOMATIC INFINITE CAROUSEL
           $(this).bind('next', function () {
               gotoPage(currentPage + 1);
           });
       });
   };
})(jQuery);

$(document).ready(function () {
   // THIS IS NEW CODE FOR THE AUTOMATIC INFINITE CAROUSEL
   var autoscrolling = true;
   
   $('.infiniteCarousel').infiniteCarousel().mouseover(function () {
       autoscrolling = false;
   }).mouseout(function () {
       autoscrolling = true;
   });
   
   setInterval(function () {
       if (autoscrolling) {
           $('.infiniteCarousel').trigger('next');
       }
   }, 10000);
});

</script>

<?php
// TORRENT XXX MONTRER-CACHER BY GOLLUM
if( $CURUSER['xxx_filter'] == 'yes'){
$ressa = SQL_Query_exec("SELECT * FROM xxx_filter");
while($datas =  mysqli_fetch_array($ressa)){
$wherex .= "AND categories.id != '".$datas["cat"]."' ";
}
}
// END TORRENT XXX MONTRER-CACHER
if ($CURUSER["class"] >= "0") {
{
$query = "SELECT torrents.id, torrents.anon, torrents.recommended, torrents.exclusif, torrents.announce, torrents.category, torrents.sticky, torrents.tube, torrents.tube2, torrents.leechers, torrents.nfo, torrents.seeders, torrents.name, torrents.times_completed, torrents.image1, torrents.size, torrents.added, torrents.safe, torrents.comments, torrents.numfiles, torrents.filename, torrents.owner, torrents.external, torrents.freeleech, categories.name AS cat_name, categories.image AS cat_pic, categories.parent_cat AS cat_parent, users.username, users.privacy, IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) AS rating FROM torrents LEFT JOIN categories ON category = categories.id LEFT JOIN users ON torrents.owner = users.id WHERE image1 <> '' AND visible = 'yes' AND safe='yes' AND banned = 'no' $wherex ORDER BY sticky ASC, id DESC LIMIT 40";
   #$query="SELECT id, name, image1, seeders, leechers, category, size FROM torrents WHERE image1 <> '$wherex' ORDER BY added DESC limit 40";
   $result=SQL_Query_exec($query);
   $num = mysqli_num_rows($result);
   {
  ?>
   <div class="infiniteCarousel">
     <div class="wrapper">
       <ul>

       <?php
           while($row = mysqli_fetch_assoc($result))
   {    
   $t_name = substr(htmlspecialchars($row['name']), 0, 17)."...";
   $res = SQL_Query_exec("SELECT name FROM categories WHERE id=$row[category]");
   $arr = mysqli_fetch_assoc($res);
   $cat = $arr["name"];
   $name=$row["name"];
$images=$row["image1"];
$seed=$row["seeders"];
$leech=$row["leechers"];
 ?>
       <li>
<a href="torrents-details.php?id=<?php echo $row["id"]; ?>" target="_top" title="<?=$name?> | <?=$cat?>" onmouseover=" onmouseout="return nd();"><img src="uploads/images/<?=$row["image1"] ?>" height="150" width="110" class="cover_img"></a>
<br/>
<img src='images/arrow_up.png' height='12' title='Seeders' border='0'/><span style='color:#80FF00;'><?=$seed?></span>
<span class="colortexte"> | </span>
<img src='images/arrow_down.png' height='12' title='Leechers' border='0'/><span style='color:#FF0000;'><?=$leech?></span>
       <br/>
   <br/><span style="color:#F0F8FF;font-size:10pt;border:1px solid #D3D8D8;padding:3px;"><?=$cat?></span>
<br/>
<br/>
   </li>
   <?php
   }
 ?>
       </ul>        
     </div>
   </div>
<?php
   }
}
}
?>



Index:
echo '<table cellpadding=7 cellspacing=6 width=75% height="55px" border=0 align="center" style="top:-20px;"><iframe allowtransparency="true" src="'.$site_config["SITEURL"].'/carroussel.php" frameborder="0" marginheight="0" marginwidth="0" width="95%" height="240" scrolling="no" align="middle" style="background: none;"></iframe></table>';


@+ 😊
Last edited by spiritblue on 2022-06-05 13:43:44
2022-06-05 14:43:27
thanks spiritblue but I miss the jquery.min.js and the css code  ðŸ˜€
Last edited by niki on 2022-06-05 14:43:54
2022-06-05 16:15:20
do you need the jquery file? here are 2
jquery.min.zip
File missing

TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
2022-06-05 17:00:09
thank you but it doesn't work for me instead of the torrent covers I have the tracker header displayed in the block box  ðŸ™„
2022-06-05 19:24:55
hmm, my index.php is this
<?php
//torrent image scroller 5-21-15
begin_frame(T_("LATEST_TORRENTS_SCROLLER"));
?>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td align="center">
<?php
echo '<IFRAME src="'.$site_config["SITEURL"].'/carroussel.php" frameborder="0" marginheight="0" marginwidth="0" width="100%" height="160"  scrolling="no" align="middle"></IFRAME>';
?>
</td>
</tr>
</table>
<?php
end_frame();
//end torrent image scroller

and my carrousel.php file is this
<?php
require_once("backend/functions.php");


dbconn(true);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="//www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Infinite Carousel</title>
<style type="text/css" media="screen">
<!--
body { font: 1em "Trebuchet MS", verdana, arial, sans-serif; font-size: 100%; }
input, textarea { font-family: Arial; font-size: 125%; padding: 7px; }
label { display: block; }

a:link {color: transparent; text-decoration: underline; border:0; }
a:active {color: transparent; text-decoration: underline; border:0; }
a:visited {color: transparent; text-decoration: underline; border:0; }
a:hover {color: transparent; text-decoration: none; border:0; }

.infiniteCarousel {
width: 65px;
position: relative;
}

.infiniteCarousel .wrapper {
width: 1000px; /* .infiniteCarousel width - (.wrapper margin-left + .wrapper margin-right) */
overflow: auto;
min-height: 10em;
margin: 0 50px;
position: absolute;
top: -6px;
}

.infiniteCarousel ul a img {
 border: 0px solid #000;
 border-radius: 14px;/* taille coins en rond */
 margin-left: auto;
 margin-right: auto;
 -moz-border-radius:14px;/* taille coins en rond */
 -webkit-border-radius:14px;/* taille coins en rond */
}

.infiniteCarousel .wrapper ul {
width: 9999px;
list-style-image:none;
list-style-position:outside;
list-style-type:none;
margin:0;
padding:0;
position: absolute;
top: 0;
}

.infiniteCarousel ul li {
display:block;
float:left;
padding: 8px;
height: 120px;
width: 110px;
}

.infiniteCarousel ul li a img {
display:block;
}


.infiniteCarousel .arrow {
display: block;
height: 26px;
width: 37px;
 background: url(images/arrow.png) no-repeat 0 0;
  text-indent: -999px;
position: absolute;
top: 50px;
cursor: pointer;
}

.infiniteCarousel .forward {
background-position: 0 0;
right: 0;
}

.infiniteCarousel .back {
background-position: 0 -49.3px;
left: 0;
}

.infiniteCarousel .forward:hover {
background-position: 0 -26px;
}

.infiniteCarousel .back:hover {
background-position: 0 -74px;
}
-->
</style>

<script src="js/jquery-2.2.3.min.js"></script>
<script src="js/overlib.js"></script>

<script type="text/javascript">

(function () {
   $.fn.infiniteCarousel = function () {
       function repeat(str, n) {
           return new Array( n + 1 ).join(str);
       }
       
       return this.each(function () {
           // magic!
           var $wrapper = $('> div', this).css('overflow', 'hidden'),
               $slider = $wrapper.find('> ul').width(9999),
               $items = $slider.find('> li'),
               $single = $items.filter(':first')
               
               singleWidth = $single.outerWidth(),
               visible = Math.ceil($wrapper.innerWidth() / singleWidth),
               currentPage = 1,
               pages = Math.ceil($items.length / visible);
               
           /* TASKS */
           
           // 1. pad the pages with empty element if required
           if ($items.length % visible != 0) {
               // pad
               $slider.append(repeat('<li class="empty" />', visible - ($items.length % visible)));
               $items = $slider.find('> li');
           }
           
           // 2. create the carousel padding on left and right (cloned)
           $items.filter(':first').before($items.slice(-visible).clone().addClass('cloned'));
           $items.filter(':last').after($items.slice(0, visible).clone().addClass('cloned'));
           $items = $slider.find('> li');
           
           // 3. reset scroll
           $wrapper.scrollLeft(singleWidth * visible);
           
           // 4. paging function
           function gotoPage(page) {
               var dir = page < currentPage ? -1 : 1,
                   n = Math.abs(currentPage - page),
                   left = singleWidth * dir * visible * n;
               
               $wrapper.filter(':not(:animated)').animate({
                   scrollLeft : '+=' + left
               }, 500, function () {
                   // if page == last page - then reset position
                   if (page > pages) {
                       $wrapper.scrollLeft(singleWidth * visible);
                       page = 1;
                   } else if (page == 0) {
                       page = pages;
                       $wrapper.scrollLeft(singleWidth * visible * pages);
                   }
                   
                   currentPage = page;
               });
           }
           
           // 5. insert the back and forward link
           $wrapper.after('<a href="#" class="arrow back" border=0><</a><a href="#" class="arrow forward" border=0>></a>');
           
           // 6. bind the back and forward links
           $('a.back', this).click(function () {
               gotoPage(currentPage - 1);
               return false;
           });
           
           $('a.forward', this).click(function () {
               gotoPage(currentPage + 1);
               return false;
           });
           
           $(this).bind('goto', function (event, page) {
               gotoPage(page);
           });
           
           // THIS IS NEW CODE FOR THE AUTOMATIC INFINITE CAROUSEL
           $(this).bind('next', function () {
               gotoPage(currentPage + 1);
           });
       });
   };
})(jQuery);

$(document).ready(function () {
   // THIS IS NEW CODE FOR THE AUTOMATIC INFINITE CAROUSEL
   var autoscrolling = true;
   
   $('.infiniteCarousel').infiniteCarousel().mouseover(function () {
       autoscrolling = false;
   }).mouseout(function () {
       autoscrolling = true;
   });
   
   setInterval(function () {
       if (autoscrolling) {
           $('.infiniteCarousel').trigger('next');
       }
   }, 5000);
});
</script>

</head>
<body>
<?php

if($CURUSER)
{
   $query="SELECT id, name, image1 , seeders,leechers, category, size FROM torrents WHERE  banned ='no' AND visible='yes' AND image1 <> '' ORDER BY added DESC limit 60";
   $result=SQL_Query_exec($query);
   $num = mysqli_num_rows($result);
   {
  ?>
   
   <div class="infiniteCarousel">
     <div class="wrapper">
       <ul>
       <?php
           while($row = mysqli_fetch_assoc($result))
     {
      $t_name  = substr(htmlspecialchars($row['name']), 0, 30)."...";
      $res = SQL_Query_exec("SELECT name FROM categories WHERE id=$row[category]");
      $arr = mysqli_fetch_assoc($res);
      $cat = $arr["name"];
      $name=$row["name"];
 ?>

         <li> <a href="torrents-details.php?id=<?php echo $row["id"]; ?>" target="_top" onmouseover=" return overlib('<table width=150 border=1><tr><td class=tablea><center><?=$name?><br><?=$cat?><br><font color=green><?=$row['seeders']?></font><font color=white> Seed\'s /</font> <font color=red><?=$row['leechers']?></font><font color=white> Leech\'s</font></center></td></tr></table>',BORDER, 2, CAPTIONSIZE, '0.5ems', TEXTFONT, 'Times Roman' ,CAPCOLOR, '#000000',FGCOLOR, '#000000', VAUTO); " onmouseout="return nd();"><img src= uploads/images/<?=$row["image1"] ?> height="150" width="100"></a></li>
         <?php
    }
 ?>
       </ul>        
     </div>
   </div>
<?php
    }
   }
  ?>
</body>
</html>
<?php

?>

be mindful of the location of the jquery. Mine is located in a folder named js. Check the code
<script src="js/jquery-2.2.3.min.js"></script>
<script src="js/overlib.js"></script>

TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Last edited by MicroMonkey on 2022-06-05 19:29:02
2022-06-06 16:13:57
thank you both and it works well with the code below  ðŸ˜€


index.php add

// scroller mod
begin_frame(T_("LATEST_TORRENTS_SCROLLER"));
echo '<iframe  src="'.$site_config["SITEURL"].'/carroussel.php" frameborder="0" marginheight="0" marginwidth="0" width="99%" height="160"  scrolling="no" align="middle"></iframe>';
end_frame();
//////////////carroussel//////////



or if you want to add the code in a block add the code below in your block.php

<?php
if ( get_user_class() >= 1 ) {

begin_frame(T_("LATEST_TORRENTS_SCROLLER"));
echo '<iframe  src="'.$site_config["SITEURL"].'/carroussel.php" frameborder="0" marginheight="0" marginwidth="0" width="99%" height="160"  scrolling="no" align="middle"></iframe>';
end_frame();
}
?>




create a carroussel.php file and add the code below

<?php
require_once("backend/functions.php");


dbconn(true);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="//www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>Infinite Carousel</title>
<style type="text/css" media="screen">
<!--
body { font: 1em "Trebuchet MS", verdana, arial, sans-serif; font-size: 100%; }
input, textarea { font-family: Arial; font-size: 125%; padding: 7px; }
label { display: block; }

a:link {color: transparent; text-decoration: underline; border:0; }
a:active {color: transparent; text-decoration: underline; border:0; }
a:visited {color: transparent; text-decoration: underline; border:0; }
a:hover {color: transparent; text-decoration: none; border:0; }

.infiniteCarousel {
width: 65px;
position: relative;
}

.infiniteCarousel .wrapper {
width: 1000px; /* .infiniteCarousel width - (.wrapper margin-left + .wrapper margin-right) */
overflow: auto;
min-height: 10em;
margin: 0 50px;
position: absolute;
top: -6px;
}

.infiniteCarousel ul a img {
border: 0px solid #000;
border-radius: 14px;/* taille coins en rond */
margin-left: auto;
margin-right: auto;
-moz-border-radius:14px;/* taille coins en rond */
-webkit-border-radius:14px;/* taille coins en rond */
}

.infiniteCarousel .wrapper ul {
width: 9999px;
list-style-image:none;
list-style-position:outside;
list-style-type:none;
margin:0;
padding:0;
position: absolute;
top: 0;
}

.infiniteCarousel ul li {
display:block;
float:left;
padding: 8px;
height: 120px;
width: 110px;
}

.infiniteCarousel ul li a img {
display:block;
}


.infiniteCarousel .arrow {
display: block;
height: 26px;
width: 37px;
background: url(images/arrow.png) no-repeat 0 0;
 text-indent: -999px;
position: absolute;
top: 50px;
cursor: pointer;
}

.infiniteCarousel .forward {
background-position: 0 0;
right: 0;
}

.infiniteCarousel .back {
background-position: 0 -49.3px;
left: 0;
}

.infiniteCarousel .forward:hover {
background-position: 0 -26px;
}

.infiniteCarousel .back:hover {
background-position: 0 -74px;
}
-->
</style>

<script src="js/jquery-2.2.3.min.js"></script>
<script src="js/overlib.js"></script>

<script type="text/javascript">

(function () {
  $.fn.infiniteCarousel = function () {
      function repeat(str, n) {
          return new Array( n + 1 ).join(str);
      }
     
      return this.each(function () {
          // magic!
          var $wrapper = $('> div', this).css('overflow', 'hidden'),
              $slider = $wrapper.find('> ul').width(9999),
              $items = $slider.find('> li'),
              $single = $items.filter(':first')
             
              singleWidth = $single.outerWidth(),
              visible = Math.ceil($wrapper.innerWidth() / singleWidth),
              currentPage = 1,
              pages = Math.ceil($items.length / visible);
             
          /* TASKS */
         
          // 1. pad the pages with empty element if required
          if ($items.length % visible != 0) {
              // pad
              $slider.append(repeat('<li class="empty" />', visible - ($items.length % visible)));
              $items = $slider.find('> li');
          }
         
          // 2. create the carousel padding on left and right (cloned)
          $items.filter(':first').before($items.slice(-visible).clone().addClass('cloned'));
          $items.filter(':last').after($items.slice(0, visible).clone().addClass('cloned'));
          $items = $slider.find('> li');
         
          // 3. reset scroll
          $wrapper.scrollLeft(singleWidth * visible);
         
          // 4. paging function
          function gotoPage(page) {
              var dir = page < currentPage ? -1 : 1,
                  n = Math.abs(currentPage - page),
                  left = singleWidth * dir * visible * n;
             
              $wrapper.filter(':not(:animated)').animate({
                  scrollLeft : '+=' + left
              }, 500, function () {
                  // if page == last page - then reset position
                  if (page > pages) {
                      $wrapper.scrollLeft(singleWidth * visible);
                      page = 1;
                  } else if (page == 0) {
                      page = pages;
                      $wrapper.scrollLeft(singleWidth * visible * pages);
                  }
                 
                  currentPage = page;
              });
          }
         
          // 5. insert the back and forward link
          $wrapper.after('<a href="#" class="arrow back" border=0><</a><a href="#" class="arrow forward" border=0>></a>');
         
          // 6. bind the back and forward links
          $('a.back', this).click(function () {
              gotoPage(currentPage - 1);
              return false;
          });
         
          $('a.forward', this).click(function () {
              gotoPage(currentPage + 1);
              return false;
          });
         
          $(this).bind('goto', function (event, page) {
              gotoPage(page);
          });
         
          // THIS IS NEW CODE FOR THE AUTOMATIC INFINITE CAROUSEL
          $(this).bind('next', function () {
              gotoPage(currentPage + 1);
          });
      });
  };
})(jQuery);

$(document).ready(function () {
  // THIS IS NEW CODE FOR THE AUTOMATIC INFINITE CAROUSEL
  var autoscrolling = true;
 
  $('.infiniteCarousel').infiniteCarousel().mouseover(function () {
      autoscrolling = false;
  }).mouseout(function () {
      autoscrolling = true;
  });
 
  setInterval(function () {
      if (autoscrolling) {
          $('.infiniteCarousel').trigger('next');
      }
  }, 5000);
});
</script>

</head>
<body>
<?php

if($CURUSER)
{
  $query="SELECT id, name, image1 , seeders,leechers, category, size FROM torrents WHERE  banned ='no' AND visible='yes' AND image1 <> '' ORDER BY added DESC limit 40";
  $result=SQL_Query_exec($query);
  $num = mysqli_num_rows($result);
  {
 ?>
 
  <div class="infiniteCarousel">
    <div class="wrapper">
      <ul>
      <?php
          while($row = mysqli_fetch_assoc($result))
    {
     $t_name  = substr(htmlspecialchars($row['name']), 0, 30)."...";
     $res = SQL_Query_exec("SELECT name FROM categories WHERE id=$row[category]");
     $arr = mysqli_fetch_assoc($res);
     $cat = $arr["name"];
     $name=$row["name"];
?>

        <li> <a href="torrents-details.php?id=<?php echo $row["id"]; ?>" target="_top" onmouseover=" return overlib('<table width=150 border=1><tr><td class=tablea><center><?=$name?><br><?=$cat?><br><font color=green><?=$row['seeders']?></font><font color=white> Seed\'s /</font> <font color=red><?=$row['leechers']?></font><font color=white> Leech\'s</font></center></td></tr></table>',BORDER, 2, CAPTIONSIZE, '0.5ems', TEXTFONT, 'Times Roman' ,CAPCOLOR, '#000000',FGCOLOR, '#000000', VAUTO); " onmouseout="return nd();"><img src= uploads/images/<?=$row["image1"] ?> height="140" width="90"></a></li>
        <?php
   }
?>
      </ul>        
    </div>
  </div>
<?php
   }
  }
 ?>
</body>
</html>
<?php

?>
 
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: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728