Source for file search.html.php

Documentation is available at search.html.php

  1. <?php
  2. /**
  3. @package Mambo
  4. @subpackage Search
  5. @copyright  Refer to copyright.php
  6. @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
  7. @author Mambo Foundation Inc see README.php
  8. */ 
  9.  
  10. /** ensure this file is being included by a parent file */
  11. defined'_VALID_MOS' or die'Direct Access to this location is not allowed.' );
  12.  
  13. class search_html {
  14.     
  15.     function openhtml$params {
  16.         if $params->get'page_title' ) ) {
  17.             ?>
  18.             <div class="componentheading<?php echo $params->get'pageclass_sfx' )?>">
  19.             <?php echo $params->get'header' )?>
  20.             </div> 
  21.             <?php 
  22.         }
  23.     }
  24.  
  25.     function searchbox$searchword&$lists$params {
  26.         global $Itemid;
  27.         ?>
  28.         <form action="index.php" method="post">
  29.         <table class="contentpaneopen<?php echo $params->get'pageclass_sfx' )?>">
  30.             <tr align="center">
  31.               <td colspan="3"><?php echo T_('Search Keyword')?>:&nbsp;
  32.                 <input type="text" name="searchword"size="30" value="<?php echo stripslashes($searchword);?>" class="inputbox" />
  33.                 &nbsp;<input type="submit" name="submit" value="<?php echo T_('Search');?>" class="button" /></td>
  34.           </tr>
  35.             <tr align="center">
  36.                 <td colspan="3">
  37.                 <?php echo $lists['searchphrase']?>
  38.                 </td>
  39.             </tr>
  40.             <tr align="center">
  41.                 <td colspan="3"><?php echo T_('Ordering');?><?php echo $lists['ordering'];?></td>
  42.             </tr>
  43.         </table>
  44.         
  45.         <input type="hidden" name="option" value="com_search" />
  46.         <input type="hidden" name="Itemid" value="<?php echo $Itemid?>" />
  47.         </form>
  48.         <?php
  49.     }
  50.  
  51.     function searchintro$searchword$params {
  52.         ?>
  53.         <table class="searchintro<?php echo $params->get'pageclass_sfx' )?>">
  54.         <tr>
  55.             <td colspan="3" align="left">
  56.             <?php echo T_('Search Keyword'' <b>' stripslashes($searchword'</b>'?>    
  57.         <?php
  58.     }
  59.  
  60.     function message$message$params {
  61.         ?>
  62.         <table class="searchintro<?php echo $params->get'pageclass_sfx' )?>">
  63.         <tr>
  64.             <td colspan="3" align="left">
  65.             <?php eval ('echo "'.$message.'";');    ?>
  66.             </td>
  67.         </tr>
  68.         </table>
  69.         <?php
  70.     }
  71.  
  72.     function displaynoresult({
  73.         ?>
  74.             </td>
  75.         </tr>
  76.         <?php
  77.     }
  78.  
  79.     function display&$rows$params {
  80.         global $mosConfig_offset;
  81.         
  82.         $c             count ($rows);
  83.         $tabclass     array("sectiontableentry1""sectiontableentry2");
  84.         $k             0;
  85.                 
  86.         // number of matches found
  87.         printfTn_('returned %d match''returned %d matches',$c)$c );
  88.         ?>
  89.             </td>
  90.         </tr>
  91.         </table>
  92.         <br />
  93.         <table class="contentpaneopen<?php echo $params->get'pageclass_sfx' )?>">
  94.         <?php
  95.         foreach ($rows as $row{
  96.             if ($row->created{
  97.                 $created mosFormatDate ($row->created'd F, Y');
  98.             else {
  99.                 $created '';
  100.             }
  101.             ?>
  102.             <tr class="<?php echo $tabclass[$k$params->get'pageclass_sfx' )?>">
  103.                 <td>
  104.                 <?php
  105.                 if ($row->browsernav == 1{
  106.                     ?>
  107.                     <a href="<?php echo sefRelToAbs($row->href)?>" target="_blank">
  108.                     <?php
  109.                 else {
  110.                     ?>
  111.                     <a href="<?php echo sefRelToAbs($row->href)?>">
  112.                     <?php
  113.                 }
  114.                 echo $row->title;
  115.                 ?>
  116.                 </a>
  117.                 <span class="small<?php echo $params->get'pageclass_sfx' )?>">
  118.                 (<?php echo $row->section?>)
  119.                 </span>
  120.                 </td>
  121.             </tr>
  122.             <tr class="<?php echo $tabclass[$k$params->get'pageclass_sfx' )?>">
  123.                 <td>
  124.                 <?php echo $row->text;?> &#133;
  125.                 </td>
  126.             </tr>
  127.             <tr>
  128.                 <td class="small<?php echo $params->get'pageclass_sfx' )?>">
  129.                 <?php echo $created?>
  130.                 </td>
  131.             </tr>
  132.             <tr>
  133.                 <td>&nbsp;
  134.                 
  135.                 </td>
  136.             </tr>
  137.             <?php
  138.             $k $k;
  139.         }
  140.     }
  141.  
  142.     function conclusion$totalRows$searchword {
  143.         global $mosConfig_live_site;
  144.         ?>
  145.         <tr>
  146.             <td colspan="3">&nbsp;
  147.             
  148.             </td>
  149.         </tr>
  150.         <tr>
  151.             <td colspan="3">
  152.             <?php
  153.             printf('Total %d results found.  Search for %s with'$totalRows"<b>$searchword</b>");
  154.             ?>
  155.             <a href="http://www.google.com/search?q=<?php echo stripslashes($searchword);?>" target="_blank">
  156.             <img src="<?php echo $mosConfig_live_site;?>/images/M_images/google.png" border="0" align="texttop" />
  157.             </a>
  158.             </td>
  159.         </tr>
  160.         </table>    
  161.         <?php
  162.     }
  163. }
  164. ?>

Documentation generated on Mon, 05 May 2008 16:22:45 +0400 by phpDocumentor 1.4.0