Page 1 of 2 12 LastLast
Results 1 to 15 of 22

Thread: Hi, suggestion to improve the search feature

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    pirate heartbreaker The Man's Avatar
    Join Date
    Mar 2002
    Location
    Sarasota, FL
    Posts
    10,946

    Default Hi, suggestion to improve the search feature

    Add this:

    Code:
    // aaron's uber-1337 search enhancement hax //
    
          if (($bbuserinfo[maxposts] != -1) and ($bbuserinfo[maxposts] != 0)) {
    				$maxposts = $bbuserinfo[maxposts];
    			}
          if (($searchresult[replycount]+1)>$maxposts and $linktopages) {
    
            $totalpages=($searchresult[replycount]+1)/$maxposts;
            if ($totalpages!=intval($totalpages)) {
              $totalpages=intval($totalpages)+1;
            }
    
            $acurpage=0;
            $pagenumbers='';
            while ($acurpage++<$totalpages) {
              if ($acurpage==$maxmultipage) {
                eval("\$pagenumbers .= \"".gettemplate('forumdisplay_multipagenav_more')."\";");
                break;
              } else {
                eval("\$pagenumbers .= \"".gettemplate('forumdisplay_multipagenav_pagenumber')."\";");
              }
            }
            eval("\$searchresult[pagenav] = \"".gettemplate('forumdisplay_multipagenav')."\";");
          } else {
            $searchresult[pagenav]='';
          }
    
    // aaron's uber-1337 search enhancement hax //
    into search.php above this:

    Code:
    	  $frmjmpsel[search] = " selected class=\"fjsel\"";
    	  makeforumjump();
          eval ("\$searchresultbits .= \"".gettemplate("$searchtemplatebit")."\";");
        }
    Then, you will need to edit the searchresultbit_threadonly template and change this line:

    <td bgcolor="{firstaltcolor}" align="left"><normalfont>$searchresult[gotonew] $searchresult[typeprefix] $paperclip<a href="showthread.php?s=$session[sessionhash]&threadid=$searchresult[threadid]$highlightwords">$searchresult[threadtitle]</a></normalfont></td>
    to this:

    <td bgcolor="{firstaltcolor}" align="left"><normalfont>$searchresult[gotonew] $searchresult[typeprefix] $paperclip<a href="showthread.php?s=$session[sessionhash]&threadid=$searchresult[threadid]$highlightwords">$searchresult[threadtitle]</a> </normalfont><smallfont>$searchresult[pagenav]</smallfont></td>
    This will cause thread-only search results to return page numbers, which is really quite useful for any message board that gets an appreciable amount of traffic. Check http://216.97.98.128/forum/search.php?action=getdaily for an example of this nifty feature in action. It's not really much of a complicated hack, and I think the benefits it returns are bloody well worth it. :P

    Note: I just wrote this hack myself. ;)
    Last edited by The Man; 10-02-2003 at 12:18 AM.
    Don't delay, add The Pimp today! Don't delay, add The Pimp today!
    Fool’s Gold tlsfflast.fm (warning: album artwork may sometimes be nsfw)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •