Wyciokazz

komedijos.php

Dec 11th, 2011
421
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.54 KB | None | 0 0
  1. <?php
  2. require_once "maincore.php";
  3. require_once THEMES."templates/header.php";
  4. echo"<script type='text/javascript' src='".INCLUDES."title.js'></script>";
  5. ?>
  6. <style type="text/css">
  7.  
  8. tooltip {
  9.     font-family: Verdana, Arial, Helvetica, sans-serif;
  10.     font-size: 10px;
  11.        border-radius:5px
  12.     color: #ffffff;
  13.     position: absolute;
  14.     z-index: 3000;
  15.     /*border: 1px solid #111;*/
  16.     background-color: #000;
  17.     padding: 5px;
  18.    
  19. }
  20.  
  21. tooltip h3, #tooltip div { margin: 0;  }
  22.  
  23. div#qTip {
  24.  padding: 5px;
  25.  border: 2px solid #999999;
  26.  display: none;
  27.  background: #000;
  28.  color: #FFFFFF;
  29. font-family: Verdana, Arial, Helvetica, sans-serif;
  30. font-size: 10px;
  31.  text-align: left;
  32.  position: absolute;
  33.  z-index: 900;
  34.  
  35. </style>
  36. <?php
  37.  
  38.  
  39.  $items_per_page = 16;
  40.  $cat = "18";
  41.  
  42.   if (!isset($_GET['rowstart']) || !isnum($_GET['rowstart'])) {
  43.   $_GET['rowstart'] = 0;
  44. }
  45.  
  46.  $rows = dbcount("(*)", DB_NEWS, "news_draft='0' AND news_cat = '".$cat."'");  
  47. //opentable("");
  48.        
  49.      //$result = dbquery("SELECT * FROM ".$db_prefix."news ORDER BY news_datestamp DESC LIMIT 0,4");
  50. $result = dbquery(
  51.     "SELECT * FROM ".DB_NEWS."
  52.     WHERE news_draft='0' AND news_cat = '".$cat."' ORDER BY news_datestamp DESC
  53.     LIMIT ".$_GET['rowstart'].",$items_per_page"
  54.  );
  55.        
  56.        
  57. if (dbrows($result) != 0) {
  58.         $counter = 0; $columns = 4;
  59.         echo"<table cellpadding='0' cellspacing='0' width='100%' style='padding:5px;'>\n<tr>\n";
  60.                while($data = dbarray($result)) {
  61.  
  62. //$kat = dbresult(dbquery("SELECT download_cat_name FROM ".$db_prefix."download_cats WHERE download_cat_id='$id'"), 0);
  63. if ($counter != 0 && ($counter % $columns == 0)) { echo "</tr>\n<tr>\n"; }
  64.  
  65.           $wynik = dbquery("SELECT SUM(rating_vote) FROM ".DB_RATINGS." WHERE rating_type='N' AND rating_item_id='".$data['news_id']."'");
  66.                 $info2 = dbresult($wynik,0);
  67.                 $num_rating = dbcount("(rating_vote)", DB_RATINGS, "rating_type='N' AND rating_item_id='".$data['news_id']."'");
  68.                 $wyn_rating = ($num_rating ? $info2 / $num_rating : 0);
  69. $komentarai = dbcount("(comment_id)", DB_COMMENTS, "comment_type='N' AND comment_item_id='".$data['news_id']."' AND comment_hidden='0'");
  70.     // $tas = trimlink($data['news_news'], 600);
  71.      $tas = $data['news_breaks'] == "y" ? nl2br(stripslashes($data['news_news'])) : stripslashes($data['news_news']);
  72.            
  73. echo"<td  style='padding:5px;'>";
  74.  
  75.     echo "<table cellpadding='0' cellspacing='0' width='150' class='borderis' onmouseover=\"className='borderis2'\" onmouseout=\"className='borderis'\">\n<tr>\n";
  76.    
  77.     echo"<td colspan='2' align='center'><a href='/news.php?readmore=".$data['news_id']."' tit='<table width=260px><tr><td class=c>
  78. <b><span style=color:#ff9933;font-size:12px;>".$data['news_subject']."  </span></b><br>$tas<br>
  79. <b>&#381;i&#363;r&#279;jo: ".$data['news_reads']."</b>
  80.  
  81. </td></tr>
  82. </table>'><img src='".IMAGES_N.$data['news_image']."' width='150' height='245' /></a></td>";
  83.    
  84.     echo"</tr>
  85.     <td width='105' style='padding:2px;'><img src='".THEME."images/retitingai/".ceil($wyn_rating).".png' width='80' height='13' alt='".ceil($wyn_rating)."' style='vertical-align:middle;' title='".ceil($wyn_rating)."' /></td>
  86.     <td class='c' align='right'><a href='/news.php?readmore=".$data['news_id']."'>&#381;i&#363;r&#279;ti</a></td>
  87.     </tr>";
  88.  
  89.     echo"</table>";
  90.  
  91.  
  92.  
  93. echo "</td>\n" ;
  94. $counter++;
  95. }
  96. echo "</tr>\n</table>\n";
  97.  
  98. }
  99.  
  100.  
  101. //closetable();
  102. echo"<div align='center'>";
  103. if ($rows > $items_per_page) {
  104.     echo makepagenav($_GET['rowstart'], $items_per_page, $rows, 3);
  105. }
  106.  
  107. require_once THEMES."templates/footer.php";
  108.  
  109. ?>
  110.  
Advertisement
Add Comment
Please, Sign In to add comment