Share Pastebin
Guest
Public paste!

Untitled

By: a guest | Mar 19th, 2010 | Syntax: PHP | Size: 4.23 KB | Hits: 115 | Expires: Never
Copy text to clipboard
  1. <?
  2. if ($CURUSER){
  3. begin_block("Latest Posters");
  4.         ?>
  5.         <style type="text/css">
  6.  
  7.         #marqueecontainer{
  8.         position: relative;
  9.         /*width: 200px; marquee width */
  10.         height: 200px; /*marquee height */
  11.         background-color: transparent;
  12.         overflow: hidden;
  13.         /*border: 3px solid orange;*/
  14.         padding: 2px;
  15.         padding-left: 4px;
  16.         }
  17.  
  18.         </style>
  19.  
  20.         <script type="text/javascript">
  21.  
  22.         /***********************************************
  23.         * Cross browser Marquee II- © Dynamic Drive (www.dynamicdrive.com)
  24.         * This notice MUST stay intact for legal use
  25.         * Visit http://www.dynamicdrive.com/ for this script and 100s more.
  26.         ***********************************************/
  27.  
  28.         var delayb4scroll=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
  29.         var marqueespeed=1 //Specify marquee scroll speed (larger is faster 1-10)
  30.         var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?
  31.  
  32.         ////NO NEED TO EDIT BELOW THIS LINE////////////
  33.  
  34.         var copyspeed=marqueespeed
  35.         var pausespeed=(pauseit==0)? copyspeed: 0
  36.         var actualheight=''
  37.  
  38.         function scrollmarquee(){
  39.         if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8))
  40.         cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
  41.         else
  42.         cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
  43.         }
  44.  
  45.         function initializemarquee(){
  46.         cross_marquee=document.getElementById("vmarquee")
  47.         cross_marquee.style.top=0
  48.         marqueeheight=document.getElementById("marqueecontainer").offsetHeight
  49.         actualheight=cross_marquee.offsetHeight
  50.         if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
  51.         cross_marquee.style.height=marqueeheight+"px"
  52.         cross_marquee.style.overflow="scroll"
  53.         return
  54.         }
  55.         setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll)
  56.         }
  57.  
  58.         if (window.addEventListener)
  59.         window.addEventListener("load", initializemarquee, false)
  60.         else if (window.attachEvent)
  61.         window.attachEvent("onload", initializemarquee)
  62.         else if (document.getElementById)
  63.         window.onload=initializemarquee
  64.  
  65.  
  66.         </script>
  67.  
  68.         <div id="marqueecontainer" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">
  69.         <div id="vmarquee" style="position: absolute; width: 100%;">
  70.  
  71.         <!--YOUR SCROLL CONTENT HERE-->
  72.         <?
  73.     //-----------------------------------FILTER PICTURES FROM USER SETTINGS----------------------------------------
  74.     $cur_user = $CURUSER[username];
  75.         $cat_query = "SELECT notifs from users where username = '$cur_user'";
  76.     $cat_result = mysql_query($cat_query);
  77.     $cats = mysql_fetch_assoc($cat_result);
  78.     $str = $cats['notifs'];
  79.     $str = str_replace('][cat',',',$str);
  80.     $str = str_replace(']','',$str);
  81.     $str = str_replace('[cat','',$str);
  82.     $str_arr = explode(",",$str);
  83.         $cat_filter = "";
  84.     foreach($str_arr as $cat){
  85.                 $cat_filter.=" AND category != '$cat'";
  86.         }
  87.         //----------------------------------------------------------------------------------------------------------
  88.         $news = mysql_query("SELECT id, name, added, image1, image2 FROM torrents WHERE banned = 'no' AND visible='yes' $cat_filter");
  89.  
  90.         if (mysql_num_rows($news) > 0) {
  91.  
  92.                 print("<table align=center cellpadding=0 cellspacing=0 width=100% border=0>");
  93.  
  94.                 while ($row2 = mysql_fetch_array($news, MYSQL_NUM)) {
  95.                         $tor = $row2['0'];
  96.                         $altname = $row2['1'];
  97.                         $date_time=get_date_time(time()-(3600*72)); // the 24 is the hours you want listed change by whatever you want
  98.                         $orderby = "ORDER BY torrents.id DESC"; //Order
  99.  
  100.                         $limit = "LIMIT 5"; //Limit
  101.  
  102.                         $where = "WHERE banned = 'no' AND visible='yes' AND torrents.id='$tor'";
  103.  
  104.                         $res = mysql_query("SELECT torrents.id, torrents.image1, torrents.image2, torrents.added, categories.name AS cat_name FROM torrents LEFT JOIN categories ON torrents.category = categories.id $where AND torrents.added >='$date_time' $orderby $limit");
  105.                         $row = mysql_fetch_array($res);
  106.                         $cat = $row['cat_name'];
  107.  
  108.                         $img1 = "<a href='$site_config[SITEURL]/torrents-details.php?id=$row[id]'><img border='0' src='uploads/images/$row[image1]' alt=\"$altname / $cat\" width='130'></a>";
  109.  
  110.                         if ($row["image1"] != ""){
  111.                                 print("<tr><td align=center>". $img1 ."<BR></td></tr>");
  112.                         }
  113.                 }
  114.  
  115.                 print("</table>");
  116.  
  117.         }
  118.                 ?>
  119.                 </div>
  120.                 </div>
  121.                 <?
  122.  
  123. end_block();
  124. }
  125. ?>