Parašė bruzgis·  2009 Lie. 10 02:07:28
<?php
/*---------------------------------------------------+
| 
PHP-Fusion 6 Content Management System
+----------------------------------------------------+
| Copyright © 2002 - 2006 Nick Jones
| 
http://www.php-fusion.co.uk/
+----------------------------------------------------+
| Released under the terms & conditions of v2 of the
| GNU General Public License. For details refer to
| the included gpl.txt file or visit 
http://gnu.org
+----------------------------------------------------*/
require_once "maincore.php";
require_once "subheader.php";
require_once "side_left.php";
include LOCALE.LOCALESET."search.php";
$news_per_page = 11; $posts_per_page = 20;
if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0;
$stype = "d";
if (isset($stext)) $stext = stripinput($stext);
if (!isset($stext)) $stext = isset($_POST['stext']) ? stripinput($_POST['stext']) : "";
opentable($locale['400']);
echo "<center>
<form name='searchform' method='post' action='".FUSION_SELF."'>
".$locale['401']." <input type='text' name='stext' value='$stext' class='textbox' style='width:200px'>
</form>
</center>\n";
closetable();
if ($stext != "" && strlen($stext) >= "3") {
   tablebreak();
   opentable($locale['409']);
   $result = dbquery(
         "SELECT td.*,tdc.* FROM ".$db_prefix."downloads td
         INNER JOIN ".$db_prefix."download_cats tdc ON td.download_cat=tdc.download_cat_id
         WHERE ".groupaccess('download_cat_access')." AND (download_title LIKE '%$stext%' || download_description LIKE '%$stext%')"
      );
      $rows = dbrows($result);
      if ($rows != 0) {
         echo $rows." ".($rows == 1 ? $locale['416'] : $locale['417']).$locale['422'].":<br><br>\n";
         $result = dbquery(
            "SELECT td.*,tdc.* FROM ".$db_prefix."downloads td
            INNER JOIN ".$db_prefix."download_cats tdc ON td.download_cat=tdc.download_cat_id
            WHERE ".groupaccess('download_cat_access')." AND (download_title LIKE '%$stext%' || download_description LIKE '%$stext%')
            ORDER BY download_title LIMIT $rowstart,10"
         );
         $i = 1;
         while ($data = dbarray($result)) {
            if ($data['download_datestamp']+604800 > time()+($settings['timeoffset']*3600)) {
               $new = " <span class='small'>".$locale['450']."</span>";
            } else {
               $new = "";
            }
            echo "<a href='downloads.php?cat_id=".$data['download_cat']."&download_id=".$data['download_id']."' target='_blank'>".$data['download_title']."</a> - ".$data['download_filesize']." $new<br>\n";
            if ($data['download_description'] != "") echo stripslashes($data['download_description'])."<br>\n";
            echo "<span class='small'><font class='alt'>".$locale['451']."</font> ".$data['download_license']." |
<font class='alt'>".$locale['452']."</font> ".$data['download_os']." |
<font class='alt'>".$locale['453']."</font> ".$data['download_version']."<br>
<font class='alt'>".$locale['454']."</font> ".showdate("%d.%m.%y", $data['download_datestamp'])." |
<font class='alt'>".$locale['455']."</font> ".$data['download_count']."</span>\n";
            if ($i != $numrows) { echo "<br><br>\n"; } else { echo "\n"; }
            $i++;
         }
      } else {
         echo "<center>0 ".$locale['417'].$locale['422'].".</center>\n";
      }
      closetable();
      if ($rows > 10) echo "<div align='center' style='margin-top:5px;'>\n".makePageNav($rowstart,10,$rows,3,FUSION_SELF."?stype=d&stext=$stext&")."\n</div>\n";
   }
 
require_once "side_right.php";
require_once "footer.php";
?>