home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 May / INTERNET103.ISO / pc / software / windows / building / php_nuke / html / modules / search / index.php
Encoding:
PHP Script  |  2002-09-16  |  23.7 KB  |  492 lines

  1. <?php
  2.  
  3. /************************************************************************/
  4. /* PHP-NUKE: Web Portal System                                          */
  5. /* ===========================                                          */
  6. /*                                                                      */
  7. /* Copyright (c) 2002 by Francisco Burzi                                */
  8. /* http://phpnuke.org                                                   */
  9. /*                                                                      */
  10. /* This program is free software. You can redistribute it and/or modify */
  11. /* it under the terms of the GNU General Public License as published by */
  12. /* the Free Software Foundation; either version 2 of the License.       */
  13. /************************************************************************/
  14.  
  15. if (!eregi("modules.php", $PHP_SELF)) {
  16.     die ("You can't access this file directly...");
  17. }
  18.  
  19. require_once("mainfile.php");
  20. $module_name = basename(dirname(__FILE__));
  21. get_lang($module_name);
  22.  
  23. if ($multilingual == 1) {
  24.     $queryalang = "AND (s.alanguage='$currentlang' OR s.alanguage='')"; /* stories */
  25.     $queryrlang = "AND rlanguage='$currentlang' "; /* reviews */
  26.     $queryslang = "AND slanguage='$currentlang' "; /* sections */
  27. } else {
  28.     $queryalang = "";
  29.     $queryrlang = "";
  30.     $queryslang = "";
  31. }
  32.  
  33. switch($op) {
  34.  
  35.         case "comments":
  36.                 break;
  37.  
  38.         default:
  39.         $ThemeSel = get_theme();
  40.                 $offset=10;
  41.                 if (!isset($min)) $min=0;
  42.                 if (!isset($max)) $max=$min+$offset;
  43.                 $query = stripslashes($query);
  44.         $pagetitle = "- "._SEARCH."";
  45.                 include("header.php");
  46.         if ($topic>0) {
  47.             $result = sql_query("select topicimage, topictext from ".$prefix."_topics where topicid=$topic", $dbi);
  48.             list($topicimage, $topictext) = sql_fetch_row($result, $dbi);
  49.             if (file_exists("themes/$ThemeSel/images/topics/$topicimage")) {
  50.             $topicimage = "themes/$ThemeSel/images/topics/$topicimage";
  51.             } else {
  52.             $topicimage = "$tipath/$topicimage";
  53.             }
  54.         } else {
  55.             $topictext = ""._ALLTOPICS."";
  56.             if (file_exists("themes/$ThemeSel/images/topics/AllTopics.gif")) {
  57.             $topicimage = "themes/$ThemeSel/images/topics/AllTopics.gif";
  58.             } else {
  59.             $topicimage = "$tipath/AllTopics.gif";
  60.             }
  61.         }
  62.         if (file_exists("themes/$ThemeSel/images/topics/AllTopics.gif")) {
  63.             $alltop = "themes/$ThemeSel/images/topics/AllTopics.gif";
  64.         } else {
  65.             $alltop = "$tipath/AllTopics.gif";
  66.         }
  67.         OpenTable();
  68.         if ($type == "users") {
  69.             echo "<center><font class=\"title\"><b>"._SEARCHUSERS."</b></font></center><br>";
  70.         } elseif ($type == "sections") {
  71.             echo "<center><font class=\"title\"><b>"._SEARCHSECTIONS."</b></font></center><br>";
  72.         } elseif ($type == "reviews") {
  73.             echo "<center><font class=\"title\"><b>"._SEARCHREVIEWS."</b></font></center><br>";
  74.         } elseif ($type == "comments" AND isset($sid)) {
  75.             $res = sql_query("select title from ".$prefix."_stories where sid='$sid'", $dbi);
  76.             list($st_title) = sql_fetch_row($res, $dbi);
  77.                 $instory = "AND sid='$sid'";
  78.             echo "<center><font class=\"title\"><b>"._SEARCHINSTORY." $st_title</b></font></center><br>";
  79.         } else {
  80.             echo "<center><font class=\"title\"><b>"._SEARCHIN." $topictext</b></font></center><br>";
  81.         }
  82.         
  83.         echo "<table width=\"100%\" border=\"0\"><TR><TD>";
  84.         if (($type == "users") OR ($type == "sections") OR ($type == "reviews")) {
  85.             echo "<img src=\"$alltop\" align=\"right\" border=\"0\" alt=\"\">";
  86.                 } else {
  87.             echo "<img src=\"$topicimage\" align=\"right\" border=\"0\" alt=\"$topictext\">";
  88.         }
  89.         echo "<form action=\"modules.php?name=$module_name\" method=\"POST\">"
  90.                     ."<input size=\"25\" type=\"text\" name=\"query\" value=\"$query\">  "
  91.             ."<input type=\"submit\" value=\""._SEARCH."\"><br><br>";
  92.         if (isset($sid)) {
  93.             echo "<input type='hidden' name='sid' value='$sid'>";
  94.         }
  95.                 echo "<!-- Topic Selection -->";
  96.         $toplist = sql_query("select topicid, topictext from ".$prefix."_topics order by topictext", $dbi);
  97.         echo "<select name=\"topic\">";
  98.                 echo "<option value=\"\">"._ALLTOPICS."</option>\n";
  99.                 while(list($topicid, $topics) = sql_fetch_row($toplist, $dbi)) {
  100.                         if ($topicid==$topic) { $sel = "selected "; }
  101.                         echo "<option $sel value=\"$topicid\">$topics</option>\n";
  102.             $sel = "";
  103.                 }
  104.         echo "</select>";
  105.         /* Category Selection */
  106.         echo " <select name=\"category\">";
  107.                 echo "<option value=\"0\">"._ARTICLES."</option>\n";
  108.         $catlist = sql_query("select catid, title from ".$prefix."_stories_cat order by title", $dbi);
  109.                 while(list($catid, $title) = sql_fetch_row($catlist, $dbi)) {
  110.                         if ($catid==$category) { $sel = "selected "; }
  111.                         echo "<option $sel value=\"$catid\">$title</option>\n";
  112.             $sel = "";
  113.                 }
  114.         echo "</select>";
  115.         /* Authors Selection */
  116.                 $thing = sql_query("select aid from ".$prefix."_authors order by aid", $dbi);
  117.         echo " <select name=\"author\">";
  118.                 echo "<option value=\"\">"._ALLAUTHORS."</option>\n";
  119.                 while(list($authors) = sql_fetch_row($thing, $dbi)) {
  120.                         if ($authors==$author) { $sel = "selected "; }
  121.             echo "<option value=\"$authors\">$authors</option>\n";
  122.             $sel = "";
  123.                 }
  124.                 echo "</select>";
  125.                 /* Date Selection */
  126.                 ?>
  127.          <select name="days">
  128.                         <option <?php echo $days == 0 ? "selected " : ""; ?> value="0"><?php echo _ALL ?></option>
  129.                         <option <?php echo $days == 7 ? "selected " : ""; ?> value="7">1 <?php echo _WEEK ?></option>
  130.                         <option <?php echo $days == 14 ? "selected " : ""; ?> value="14">2 <?php echo _WEEKS ?></option>
  131.                         <option <?php echo $days == 30 ? "selected " : ""; ?> value="30">1 <?php echo _MONTH ?></option>
  132.             <option <?php echo $days == 60 ? "selected " : ""; ?> value="60">2 <?php echo _MONTHS ?></option>
  133.                         <option <?php echo $days == 90 ? "selected " : ""; ?> value="90">3 <?php echo _MONTHS ?></option>
  134.                 </select><br>
  135.         <?php
  136.         if (($type == "stories") OR ($type == "")) {
  137.             $sel1 = "checked";
  138.         } elseif ($type == "comments") {
  139.             $sel2 = "checked";
  140.         } elseif ($type == "sections") {
  141.             $sel3 = "checked";
  142.         } elseif ($type == "users") {
  143.             $sel4 = "checked";
  144.         } elseif ($type == "reviews") {
  145.             $sel5 = "checked";
  146.         }
  147.  
  148.         $num_sec = sql_num_rows(sql_query("select * from ".$prefix."_sections", $dbi), $dbi);
  149.         $num_rev = sql_num_rows(sql_query("select * from ".$prefix."_reviews", $dbi), $dbi);
  150.  
  151.         echo ""._SEARCHON."";
  152.         echo "<input type=\"radio\" name=\"type\" value=\"stories\" $sel1> "._SSTORIES."";
  153.         echo "<input type=\"radio\" name=\"type\" value=\"comments\" $sel2> "._SCOMMENTS."";
  154.         if ($num_sec > 0) {
  155.             echo "<input type=\"radio\" name=\"type\" value=\"sections\" $sel3> "._SSECTIONS."";
  156.         }
  157.         echo "<input type=\"radio\" name=\"type\" value=\"users\" $sel4> "._SUSERS."";
  158.         if ($num_rev > 0) {
  159.             echo "<input type=\"radio\" name=\"type\" value=\"reviews\" $sel5> "._REVIEWS."";
  160.                 }
  161.         echo "</form></td></tr></table>";
  162.     $query = addslashes($query);
  163.     if ($type=="stories" OR !$type) {
  164.  
  165.         if ($category > 0) {
  166.             $categ = "AND catid=$category ";
  167.         } elseif ($category == 0) {
  168.             $categ = "";
  169.         }
  170.                 $q = "select s.sid, s.aid, s.informant, s.title, s.time, s.hometext, s.bodytext, a.url, s.comments, s.topic from ".$prefix."_stories s, ".$prefix."_authors a where s.aid=a.aid $queryalang $categ";
  171.                 if (isset($query)) $q .= "AND (s.title LIKE '%$query%' OR s.hometext LIKE '%$query%' OR s.bodytext LIKE '%$query%' OR s.notes LIKE '%$query%') ";
  172.                 if ($author != "") $q .= "AND s.aid='$author' ";
  173.                 if ($topic != "") $q .= "AND s.topic='$topic' ";
  174.                 if ($days != "" && $days!=0) $q .= "AND TO_DAYS(NOW()) - TO_DAYS(time) <= $days ";
  175.                 $q .= " ORDER BY s.time DESC LIMIT $min,$offset";
  176.         $t = $topic;
  177.                 $result = sql_query($q, $dbi);
  178.                 $nrows  = sql_num_rows($result, $dbi);
  179.                 $x=0;
  180.         if ($query != "") {
  181.         echo "<br><hr noshade size=\"1\"><center><b>"._SEARCHRESULTS."</b></center><br><br>";
  182.                 echo "<table width=\"99%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n";
  183.         if ($nrows>0) {
  184.                         while(list($sid, $aid, $informant, $title, $time, $hometext, $bodytext, $url, $comments, $topic) = sql_fetch_row($result, $dbi)) {
  185.  
  186.             $result2 = sql_query("select topictext from ".$prefix."_topics where topicid=$topic", $dbi);
  187.             list($topictext) = sql_fetch_row($result2, $dbi);
  188.  
  189.                     $furl = "modules.php?name=News&file=article&sid=$sid";
  190.                                 $datetime = formatTimestamp($time);
  191.                 $query = stripslashes($query);
  192.                 if ($informant == "") {
  193.                     $informant = $anonymous;
  194.                 } else {
  195.                     $informant = "<a href=\"modules.php?name=Your_Account&op=userinfo&uname=$informant\">$informant</a>";
  196.                 }
  197.                 if ($query != "") {
  198.                     if (eregi("$query",$title)) {
  199.                     $a = 1;
  200.                     }
  201.                     $text = "$hometext$bodytext";
  202.                     if (eregi("$query",$text)) {
  203.                     $a = 2;
  204.                     }
  205.                     if (eregi("$query",$text) AND eregi("$query",$title)) {
  206.                     $a = 3;
  207.                     }
  208.                     if ($a == 1) {
  209.                     $match = _MATCHTITLE;
  210.                     } elseif ($a == 2) {
  211.                     $match = _MATCHTEXT;
  212.                     } elseif ($a == 3) {
  213.                     $match = _MATCHBOTH;
  214.                     }
  215.                     if (!isset($a)) {
  216.                     $match = "";
  217.                     } else {
  218.                     $match = "$match<br>";
  219.                     }
  220.                 }
  221.                                 printf("<tr><td><img src=\"images/folders.gif\" border=\"0\" alt=\"\"> <font class=\"option\"><a href=\"%s\"><b>%s</b></a></font><br><font class=\"content\">"._CONTRIBUTEDBY." $informant<br>"._POSTEDBY." <a href=\"%s\">%s</a>",$furl,$title,$url,$aid,$informant);
  222.                                 echo " "._ON." $datetime<br>"
  223.                     ."$match"
  224.                     .""._TOPIC.": <a href=\"modules.php?name=$module_name&query=&topic=$topic\">$topictext</a> ";
  225.                 if ($comments == 0) {
  226.                     echo "("._NOCOMMENTS.")";
  227.                 } elseif ($comments == 1) {
  228.                     echo "($comments "._UCOMMENT.")";
  229.                                 } elseif ($comments >1) {
  230.                     echo "($comments "._UCOMMENTS.")";
  231.                 }
  232.                 if (is_admin($admin)) {
  233.                     echo " [ <a href=\"admin.php?op=EditStory&sid=$sid\">"._EDIT."</a> | <a href=\"admin.php?op=RemoveStory&sid=$sid\">"._DELETE."</a> ]";
  234.                 }
  235.                 echo "</font><br><br><br></td></tr>\n";
  236.                 $x++;
  237.                         }
  238.  
  239.         echo "</table>";
  240.         } else {
  241.                         echo "<tr><td><center><font class=\"option\"><b>"._NOMATCHES."</b></font></center><br><br>";
  242.             echo "</td></tr></table>";
  243.                 }
  244.  
  245.                 $prev=$min-$offset;
  246.                 if ($prev>=0) {
  247.                         print "<br><br><center><a href=\"modules.php?name=$module_name&author=$author&topic=$t&min=$prev&query=$query&type=$type&category=$category\">";
  248.                         print "<b>$min "._PREVMATCHES."</b></a></center>";
  249.                 }
  250.  
  251.                 $next=$min+$offset;
  252.         if ($x>=9) {
  253.                         print "<br><br><center><a href=\"modules.php?name=$module_name&author=$author&topic=$t&min=$max&query=$query&type=$type&category=$category\">";
  254.                         print "<b>"._NEXTMATCHES."</b></a></center>";
  255.                 }
  256.         }
  257.  
  258.     } elseif ($type=="comments") {
  259. /*
  260.         if (isset($sid)) {
  261.         $res = sql_query("select title from ".$prefix."_stories where sid='$sid'", $dbi);
  262.         list($st_title) = sql_fetch_row($res, $dbi);
  263.         $instory = "AND sid='$sid'";
  264.         } else {
  265.         $instory = "";
  266.         }
  267. */
  268.             $result = sql_query("select tid, sid, subject, date, name from ".$prefix."_comments where (subject like '%$query%' OR comment like '%$query%') $instory order by date DESC limit $min,$offset", $dbi);
  269.             $nrows  = sql_num_rows($result, $dbi);
  270.             $x=0;
  271.         if ($query != "") {
  272.         echo "<br><hr noshade size=\"1\"><center><b>"._SEARCHRESULTS."</b></center><br><br>";
  273.         echo "<table width=\"99%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n";
  274.         if ($nrows>0) {
  275.                         while(list($tid, $sid, $subject, $date, $name) = sql_fetch_row($result, $dbi)) {
  276.                 $res = sql_query("select title from ".$prefix."_stories where sid='$sid'", $dbi);
  277.                 list($title) = sql_fetch_row($res, $dbi);
  278.                 $reply = sql_num_rows(sql_query("select * from ".$prefix."_comments where pid='$tid'", $dbi), $dbi);
  279.                 $furl = "modules.php?name=News&file=article&thold=-1&mode=flat&order=1&sid=$sid#$tid";
  280.                             if(!$name) {
  281.                 $name = "$anonymous";
  282.                 } else {
  283.                 $name = "<a href=\"modules.php?name=Your_Account&op=userinfo&uname=$name\">$name</a>";
  284.                 }
  285.                 $datetime = formatTimestamp($date);
  286.                             echo "<tr><td><img src=\"images/folders.gif\" border=\"0\" alt=\"\"> <font class=\"option\"><a href=\"$furl\"><b>$subject</b></a></font><font class=\"content\"><br>"._POSTEDBY." $name"
  287.                             ." "._ON." $datetime<br>"
  288.                 .""._ATTACHART.": $title<br>";
  289.                 if ($reply == 1) {
  290.                 echo "($reply "._SREPLY.")";
  291.                 if (is_admin($admin)) {
  292.                     echo " [ <a href=\"admin.php?op=RemoveComment&tid=$tid&sid=$sid\">"._DELETE."</a> ]";
  293.                 }
  294.                 echo "<br><br><br></td></tr>\n";
  295.                 } else {
  296.                 echo "($reply "._SREPLIES.")";
  297.                 if (is_admin($admin)) {
  298.                     echo " [ <a href=\"admin.php?op=RemoveComment&tid=$tid&sid=$sid\">"._DELETE."</a> ]";
  299.                 }
  300.                 echo "<br><br><br></td></tr>\n";
  301.                 }
  302.                             $x++;
  303.                         }
  304.  
  305.         echo "</table>";
  306.         } else {
  307.                         echo "<tr><td><center><font class=\"option\"><b>"._NOMATCHES."</b></font></center><br><br>";
  308.             echo "</td></tr></table>";
  309.                 }
  310.  
  311.                 $prev=$min-$offset;
  312.                 if ($prev>=0) {
  313.                         print "<br><br><center><a href=\"modules.php?name=$module_name&author=$author&topic=$topic&min=$prev&query=$query&type=$type\">";
  314.                         print "<b>$min "._PREVMATCHES."</b></a></center>";
  315.                 }
  316.  
  317.                 $next=$min+$offset;
  318.         if ($x>=9) {
  319.                         print "<br><br><center><a href=\"modules.php?name=$module_name&author=$author&topic=$topic&min=$max&query=$query&type=$type\">";
  320.                         print "<b>"._NEXTMATCHES."</b></a></center>";
  321.                 }
  322.         }
  323.     } elseif ($type=="reviews") {
  324.  
  325.             $result = sql_query("select id, title, text, reviewer, score from ".$prefix."_reviews where (title like '%$query%' OR text like '%$query%') $queryrlang order by date DESC limit $min,$offset", $dbi);
  326.             $nrows  = sql_num_rows($result, $dbi);
  327.             $x=0;
  328.         if ($query != "") {
  329.         echo "<br><hr noshade size=\"1\"><center><b>"._SEARCHRESULTS."</b></center><br><br>";
  330.         echo "<table width=\"99%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n";
  331.         if ($nrows>0) {
  332.                     while(list($id, $title, $text, $reviewer, $score) = sql_fetch_row($result, $dbi)) {
  333.             $furl = "modules.php?name=Reviews&op=showcontent&id=$id";
  334.             $pages = count(explode( "<!--pagebreak-->", $text ));
  335.                         echo "<tr><td><img src=\"images/folders.gif\" border=\"0\" alt=\"\"> <font class=\"option\"><a href=\"$furl\"><b>$title</b></a></font><br>"
  336.                 ."<font class=\"content\">"._POSTEDBY." $reviewer<br>"
  337.                 .""._REVIEWSCORE.": $score/10<br>";
  338.             if ($pages == 1) {
  339.                 echo "($pages "._PAGE.")";
  340.                         } else {
  341.                 echo "($pages "._PAGES.")";
  342.             }
  343.             if (is_admin($admin)) {
  344.                 echo " [ <a href=\"modules.php?name=Reviews&op=mod_review&id=$id\">"._EDIT."</a> | <a href=\"modules.php?name=Reviews.php&op=del_review&id_del=$id\">"._DELETE."</a> ]";
  345.             }
  346.                         print "<br><br><br></font></td></tr>\n";
  347.                         $x++;
  348.                     }
  349.             echo "</table>";
  350.         } else {
  351.                     echo "<tr><td><center><font class=\"option\"><b>"._NOMATCHES."</b></font></center><br><br>";
  352.             echo "</td></tr></table>";
  353.                 }
  354.  
  355.                 $prev=$min-$offset;
  356.                 if ($prev>=0) {
  357.                         print "<br><br><center><a href=\"modules.php?name=$module_name&author=$author&topic=$t&min=$prev&query=$query&type=$type\">";
  358.                         print "<b>$min "._PREVMATCHES."</b></a></center>";
  359.                 }
  360.  
  361.                 $next=$min+$offset;
  362.         if ($x>=9) {
  363.                         print "<br><br><center><a href=\"modules.php?name=$module_name&author=$author&topic=$t&min=$max&query=$query&type=$type\">";
  364.                         print "<b>"._NEXTMATCHES."</b></a></center>";
  365.                 }
  366.         }
  367.     } elseif ($type=="sections") {
  368.  
  369.             $result = sql_query("select artid, secid, title, content from ".$prefix."_seccont where (title like '%$query%' OR content like '%$query%') $queryslang order by artid DESC limit $min,$offset", $dbi);
  370.             $nrows  = sql_num_rows($result, $dbi);
  371.             $x=0;
  372.         if ($query != "") {
  373.         echo "<br><hr noshade size=\"1\"><center><b>"._SEARCHRESULTS."</b></center><br><br>";
  374.         echo "<table width=\"99%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n";
  375.         if ($nrows>0) {
  376.                         while(list($artid, $secid, $title, $content) = sql_fetch_row($result, $dbi)) {
  377.                 $pages = count(explode( "<!--pagebreak-->", $content ));
  378.                 $result2 = sql_query("select secname from ".$prefix."_sections where secid='$secid'", $dbi);
  379.                 list($sectitle) = sql_fetch_row($result2, $dbi);
  380.                 $surl = "modules.php?name=Sections&op=listarticles&secid=$secid";
  381.                 $furl = "modules.php?name=Sections&op=viewarticle&artid=$artid";
  382.                             echo "<tr><td><img src=\"images/folders.gif\" border=\"0\" alt=\"\"> <font class=\"option\"><a href=\"$furl\"><b>$title</b></a></font><font class=\"content\"><br>"._INSECTION.": <a href=\"$surl\">$sectitle</a><br>";
  383.                 if ($pages == 1) {
  384.                 echo "($pages "._PAGE.")";
  385.                             } else {
  386.                 echo "($pages "._PAGES.")";
  387.                 }
  388.                 if (is_admin($admin)) {
  389.                 echo " [ <a href=\"admin.php?op=secartedit&artid=$artid\">"._EDIT."</a> | <a href=\"admin.php?op=secartdelete&artid=$artid&ok=0\">"._DELETE."</a> ]";
  390.                 }
  391.                 echo "</font><br><br><br></td></tr>\n";
  392.                 $x++;
  393.                         }
  394.  
  395.         echo "</table>";
  396.         } else {
  397.                         echo "<tr><td><center><font class=\"option\"><b>"._NOMATCHES."</b></font></center><br><br>";
  398.             echo "</td></tr></table>";
  399.                 }
  400.  
  401.                 $prev=$min-$offset;
  402.                 if ($prev>=0) {
  403.                         print "<br><br><center><a href=\"modules.php?name=$module_name&author=$author&topic=$t&min=$prev&query=$query&type=$type\">";
  404.                         print "<b>$min "._PREVMATCHES."</b></a></center>";
  405.                 }
  406.  
  407.                 $next=$min+$offset;
  408.         if ($x>=9) {
  409.                         print "<br><br><center><a href=\"modules.php?name=$module_name&author=$author&topic=$t&min=$max&query=$query&type=$type\">";
  410.                         print "<b>"._NEXTMATCHES."</b></a></center>";
  411.                 }
  412.         }
  413.     } elseif ($type=="users") {
  414.  
  415.             $result = sql_query("select uid, uname, name from ".$user_prefix."_users where (uname like '%$query%' OR name like '%$query%' OR bio like '%$query%') order by uname ASC limit $min,$offset", $dbi);
  416.             $nrows  = sql_num_rows($result, $dbi);
  417.             $x=0;
  418.         if ($query != "") {
  419.         echo "<br><hr noshade size=\"1\"><center><b>"._SEARCHRESULTS."</b></center><br><br>";
  420.         echo "<table width=\"99%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n";
  421.         if ($nrows>0) {
  422.                         while(list($uid, $uname, $name) = sql_fetch_row($result, $dbi)) {
  423.                 $furl = "modules.php?name=Your_Account&op=userinfo&uname=$uname";
  424.                 if ($name=="") {
  425.                 $name = ""._NONAME."";
  426.                 }
  427.                             echo "<tr><td><img src=\"images/folders.gif\" border=\"0\" alt=\"\"> <font class=\"option\"><a href=\"$furl\"><b>$uname</b></a></font><font class=\"content\"> ($name)";
  428.                 if (is_admin($admin)) {
  429.                 echo " [ <a href=\"admin.php?chng_uid=$uid&op=modifyUser\">"._EDIT."</a> | <a href=\"admin.php?op=delUser&chng_uid=$uid\">"._DELETE."</a> ]";
  430.                 }
  431.                 echo "</font></td></tr>\n";
  432.                             $x++;
  433.                         }
  434.  
  435.         echo "</table>";
  436.         } else {
  437.                         echo "<tr><td><center><font class=\"option\"><b>"._NOMATCHES."</b></font></center><br><br>";
  438.             echo "</td></tr></table>";
  439.                 }
  440.  
  441.                 $prev=$min-$offset;
  442.                 if ($prev>=0) {
  443.                         print "<br><br><center><a href=\"modules.php?name=$module_name&author=$author&topic=$t&min=$prev&query=$query&type=$type\">";
  444.                         print "<b>$min "._PREVMATCHES."</b></a></center>";
  445.                 }
  446.  
  447.                 $next=$min+$offset;
  448.         if ($x>=9) {
  449.                         print "<br><br><center><a href=\"modules.php?name=$module_name&author=$author&topic=$t&min=$max&query=$query&type=$type\">";
  450.                         print "<b>"._NEXTMATCHES."</b></a></center>";
  451.                 }
  452.         }
  453.     }
  454.     CloseTable();
  455.     if (isset($query) AND $query != "") {
  456.     echo "<br>";
  457.     if (is_active("Downloads")) { 
  458.         $dcnt = sql_num_rows(sql_query("select * from ".$prefix."_downloads_downloads WHERE title LIKE '%$query%' OR description LIKE '%$query%'", $dbi), $dbi);
  459.         $mod1 = "<li> <a href=\"modules.php?name=Downloads&d_op=search&query=$query\">"._DOWNLOADS."</a> ($dcnt "._SEARCHRESULTS.")";
  460.     }
  461.     if (is_active("Web_Links")) {
  462.         $lcnt = sql_num_rows(sql_query("select * from ".$prefix."_links_links WHERE title LIKE '%$query%' OR description LIKE '%$query%'", $dbi), $dbi);
  463.         $mod2 = "<li> <a href=\"modules.php?name=Web_Links&l_op=search&query=$query\">"._WEBLINKS."</a> ($lcnt "._SEARCHRESULTS.")";
  464.     }
  465.     if (is_active("Encyclopedia")) {
  466.         $ecnt1 = sql_query("select eid from ".$prefix."_encyclopedia WHERE active='1'", $dbi);
  467.         $ecnt = 0;
  468.         while(list($eid) = sql_fetch_row($ecnt1, $dbi)) {
  469.         $ecnt2 = sql_num_rows(sql_query("select * from ".$prefix."_encyclopedia WHERE title LIKE '%$query%' OR description LIKE '%$query%' AND eid='$eid'", $dbi), $dbi);
  470.         $ecnt3 = sql_num_rows(sql_query("select * from ".$prefix."_encyclopedia_text WHERE title LIKE '%$query%' OR text LIKE '%$query%' AND eid='$eid'", $dbi), $dbi);
  471.         $ecnt = $ecnt+$ecnt2+$ecnt3;
  472.         }
  473.         $mod3 = "<li> <a href=\"modules.php?name=Encyclopedia&file=search&query=$query\">"._ENCYCLOPEDIA."</a> ($ecnt "._SEARCHRESULTS.")";
  474.     }
  475.     OpenTable();
  476.     echo "<font class=\"title\">"._FINDMORE."<br><br>"
  477.         .""._DIDNOTFIND."</font><br><br>"
  478.         .""._SEARCH." \"<b>$query</b>\" "._ON.":<br><br>"
  479.         ."<ul>"
  480.         ."$mod1"
  481.         ."$mod2"
  482.         ."$mod3"
  483.         ."<li> <a href=\"http://www.google.com/search?q=$query\" target=\"new\">Google</a>"
  484.         ."<li> <a href=\"http://groups.google.com/groups?q=$query\" target=\"new\">Google Groups</a>"
  485.         ."</ul>";
  486.     CloseTable();
  487.     }
  488.     include("footer.php");
  489.     break;
  490. }
  491.  
  492. ?>