document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. <!DOCTYPE html>
  2. <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
  3. <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
  4. <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
  5. <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
  6. <head>
  7. <meta charset="utf-8" />
  8. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
  9.     <title>Sphinx Search</title>
  10.     <link rel="stylesheet" type="text/css" media="screen" href="style.css" />
  11.     <script language="javascript" type="text/javascript" src="jquery-1.7.1.min.js"></script>
  12.     <script type="text/javascript">
  13.         jQuery(document).ready(function(){
  14.             var x = "<?php echo ( isset( $_POST[\'q\'] ) && $_POST[\'q\'] != \'\') ? $_POST[\'q\'] : \'\';?>";
  15.             if(x) {
  16.                 jQuery(\'#submit\').click();
  17.             }
  18.         });
  19.     </script>
  20. <body>
  21. <section>
  22.     <div class="top">
  23.         <a href="index.php" class="logo"><img src="images/findit.png" /></a>
  24.         <form method="get" action="">
  25.             <input type="text" name="q" size="70" id="search" value="<?php if(isset($_POST[\'q\'])){ echo $_POST[\'q\']; }elseif(isset($_GET[\'q\'])){ echo $_GET[\'q\']; }?>"/>
  26.             <input type="submit" name="op" value="search" id="submit"/></p>
  27.         </form>
  28.     </div>
  29.     <div class="result">
  30.  <?php
  31. if(isset($_GET[\'q\'])){
  32.     require ( "sphinxapi.php" );
  33.     $cl = new SphinxClient();
  34.     $cl->SetArrayResult(TRUE);
  35.      $cl->SetMatchMode(SPH_MATCH_EXTENDED);
  36.      $cl->SetRankingMode (SPH_RANK_BM25);
  37.      $res = $cl->Query($_GET[\'q\']);
  38.      if ( $res===false ){
  39.         print "Query failed: " . $cl->GetLastError() .".\\n";
  40.      }else{
  41.          echo \'<p>\'.$cl->GetLastWarning().\'</p>\';
  42.          echo \'<p class="total">About \'.$res[\'total\'].\' result for <em><b>\'.$_GET[\'q\'].\'</em></b> (\'.$res[\'time\'].\' detik)</p><ol style=font-family:arial,sans-serif;color:black;text-align:left>\';
  43.          if($res[\'total\']!=0){
  44.                  foreach($res[\'matches\'] as $data){    
  45.                     //print_r($data);
  46.                     //echo "<pre>";
  47.                  echo "<li><h1>";
  48.                  $katasubject = explode(" ",$data[\'attrs\'][\'title\']);
  49.                  for($z=0;$z<=$res[\'total\'];$z++){
  50.                     if(strtolower($katasubject[$z]) == $_GET[\'q\'] || strtoupper($katasubject[$z]) == $_GET[\'q\'] || $katasubject[$z] == $_GET[\'q\']){
  51.                        echo "<strong style=\'background:yellow;\'>".$katasubject[$z]."</strong>";
  52.                      }else{ echo $katasubject[$z]." "; }
  53.                  }
  54.                  echo "...</h1><p>";
  55.                  $katacontent = explode(" ",$data[\'attrs\'][\'content\']);
  56.                  for($z=0;$z<=50;$z++)
  57.                 {
  58.                     if(strtolower($katacontent[$z]) == $_GET[\'q\'] || strtoupper($katacontent[$z]) == $_GET[\'q\'] ||$katacontent[$z] == $_GET[\'q\']) {
  59.                        echo "<strong style=\'background:yellow;\'>".$katacontent[$z]." </strong>";
  60.                      }else{ echo $katacontent[$z]." "; }
  61.                  }
  62.                  echo "...</p>";
  63.                  echo "</li>";
  64.              }
  65.          }
  66.      }
  67.  }else{ echo \'data tidak ditemukan.\'; }
  68. ?>
  69. </div>
  70. </section>
  71. </html>
');