plugins/SpecialSearch.php
changeset 115 261f367623af
parent 114 47393c6619ea
child 116 77c75179bb95
equal deleted inserted replaced
114:47393c6619ea 115:261f367623af
    69       $not = explode(' ', $_GET['exclude_words']);
    69       $not = explode(' ', $_GET['exclude_words']);
    70       foreach ( $not as $i => $foo )
    70       foreach ( $not as $i => $foo )
    71       {
    71       {
    72         $not[$i] = '-' . $not[$i];
    72         $not[$i] = '-' . $not[$i];
    73       }
    73       }
    74       $q .= implode(' ', $not);
    74       $q .= implode(' ', $not) . ' ';
    75     }
    75     }
    76     if(!empty($_GET['require_words']))
    76     if(!empty($_GET['require_words']))
    77     {
    77     {
    78       $req = explode(' ', $_GET['require_words']);
    78       $req = explode(' ', $_GET['require_words']);
    79       foreach ( $req as $i => $foo )
    79       foreach ( $req as $i => $foo )
    80       {
    80       {
    81         $req[$i] = '+' . $req[$i];
    81         $req[$i] = '+' . $req[$i];
    82       }
    82       }
    83       $q .= implode(' ', $req);
    83       $q .= implode(' ', $req) . ' ';
    84     }
    84     }
    85   }
    85   }
    86   $q = trim($q);
    86   $q = trim($q);
    87   
    87   
    88   if ( !empty($q) && !isset($_GET['search']) )
    88   if ( !empty($q) && !isset($_GET['search']) )
   242     <form action="<?php echo makeUrl($paths->page); ?>" method="get">
   242     <form action="<?php echo makeUrl($paths->page); ?>" method="get">
   243       <p>
   243       <p>
   244         <?php if ( $session->sid_super ): ?>
   244         <?php if ( $session->sid_super ): ?>
   245           <input type="hidden" name="auth" value="<?php echo $session->sid_super; ?>" />
   245           <input type="hidden" name="auth" value="<?php echo $session->sid_super; ?>" />
   246         <?php endif; ?>
   246         <?php endif; ?>
       
   247         <?php if ( urlSeparator == '&' ): ?>
       
   248           <input type="hidden" name="title" value="<?php echo $paths->nslist['Special'] . 'Search'; ?>" />
       
   249         <?php endif; ?>
   247         <input type="text" name="q" size="40" value="<?php echo htmlspecialchars( $q ); ?>" /> <input type="submit" value="Go" style="font-weight: bold;" /> <input name="search" type="submit" value="Search" />  <small><a href="<?php echo makeUrlNS('Special', 'Search'); ?>">Advanced Search</a></small>
   250         <input type="text" name="q" size="40" value="<?php echo htmlspecialchars( $q ); ?>" /> <input type="submit" value="Go" style="font-weight: bold;" /> <input name="search" type="submit" value="Search" />  <small><a href="<?php echo makeUrlNS('Special', 'Search'); ?>">Advanced Search</a></small>
   248       </p>
   251       </p>
   249     </form>
   252     </form>
   250     <?php
   253     <?php
   251   }
   254   }
   252   else
   255   else
   253   {
   256   {
   254   ?>
   257   ?>
   255     <br />
   258     <br />
   256     <form action="<?php echo makeUrl($paths->page); ?>" method="get">
   259     <form action="<?php echo makeUrl($paths->page); ?>" method="get">
       
   260       <?php if ( urlSeparator == '&' ): ?>
       
   261         <input type="hidden" name="title" value="<?php echo $paths->nslist['Special'] . 'Search'; ?>" />
       
   262       <?php endif; ?>
   257       <div class="tblholder">
   263       <div class="tblholder">
   258         <table border="0" style="width: 100%;" cellspacing="1" cellpadding="4">
   264         <table border="0" style="width: 100%;" cellspacing="1" cellpadding="4">
   259           <tr><th colspan="2">Advanced Search</th></tr>
   265           <tr><th colspan="2">Advanced Search</th></tr>
   260           <tr>
   266           <tr>
   261             <td class="row1">Search for pages with <b>any of these words</b>:</td>
   267             <td class="row1">Search for pages with <b>any of these words</b>:</td>