[ Index ]
 

Code source de PHP NUKE 7.9

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/modules/Search/ -> index.php (source)

   1  <?php
   2  
   3  /************************************************************************/

   4  /* PHP-NUKE: Web Portal System                                          */

   5  /* ===========================                                          */

   6  /*                                                                      */

   7  /* Copyright (c) 2005 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 (!defined('MODULE_FILE')) {
  16      die ("You can't access this file directly...");
  17  }
  18  
  19  require_once ("mainfile.php");
  20  $instory = ''; 
  21  $module_name = basename(dirname(__FILE__));
  22  get_lang($module_name);
  23  
  24  if (isset($query)) {
  25      if (strlen($query) < 3) {
  26          Header("Location: modules.php?name=$module_name&qlen=1");
  27      }
  28  }
  29  
  30  global $admin, $prefix, $db, $module_name, $articlecomm, $multilingual, $admin_file;
  31  if ($multilingual == 1) {
  32      $queryalang = "AND (s.alanguage='$currentlang' OR s.alanguage='')"; /* stories */
  33      $queryrlang = "AND rlanguage='$currentlang' "; /* reviews */
  34  } else {
  35      $queryalang = "";
  36      $queryrlang = "";
  37      $queryslang = "";
  38  }
  39  
  40      if (!isset($query)) { $query = ""; }
  41      if (!isset($type)) { $type = ""; }
  42      if (!isset($category)) { $category = 0; }
  43      if (!isset($days)) { $days = 0; }
  44      if (!isset($author)) { $author = ""; }
  45  
  46  switch($op) {
  47  
  48      case "comments":
  49      break;
  50  
  51      default:
  52      $ThemeSel = get_theme();
  53      $offset=10;
  54      if (!isset($min)) $min=0;
  55      if (!isset($max)) $max=$min+$offset;
  56      $min = intval($min);
  57      $max = intval($max);
  58      $query = stripslashes(check_html($query, "nohtml"));
  59      $pagetitle = "- "._SEARCH."";
  60      include ("header.php");
  61      $topic = intval($topic);
  62      if ($topic>0) {
  63          $row = $db->sql_fetchrow($db->sql_query("SELECT topicimage, topictext from ".$prefix."_topics where topicid='$topic'"));
  64          $topicimage = filter($row['topicimage'], "nohtml");
  65          $topictext = filter($row['topictext'], "nohtml");
  66          if (file_exists("themes/$ThemeSel/images/topics/$topicimage")) {
  67              $topicimage = "themes/$ThemeSel/images/topics/$topicimage";
  68          } else {
  69              $topicimage = "$tipath/$topicimage";
  70          }
  71      } else {
  72          $topictext = ""._ALLTOPICS."";
  73          if (file_exists("themes/$ThemeSel/images/topics/AllTopics.gif")) {
  74              $topicimage = "themes/$ThemeSel/images/topics/AllTopics.gif";
  75          } else {
  76              $topicimage = "$tipath/AllTopics.gif";
  77          }
  78      }
  79      if (file_exists("themes/$ThemeSel/images/topics/AllTopics.gif")) {
  80          $alltop = "themes/$ThemeSel/images/topics/AllTopics.gif";
  81      } else {
  82          $alltop = "$tipath/AllTopics.gif";
  83      }
  84      OpenTable();
  85      if ($type == "users") {
  86          echo "<center><font class=\"title\"><b>"._SEARCHUSERS."</b></font></center><br>";
  87      } elseif ($type == "reviews") {
  88          echo "<center><font class=\"title\"><b>"._SEARCHREVIEWS."</b></font></center><br>";
  89      } elseif ($type == "comments" AND isset($sid)) {
  90          $res = $db->sql_query("select title from ".$prefix."_stories where sid='$sid'");
  91          list($st_title) = $db->sql_fetchrow($res);
  92          $st_title = filter($st_title, "nohtml");
  93          $instory = "AND sid='$sid'";
  94          echo "<center><font class=\"title\"><b>"._SEARCHINSTORY." $st_title</b></font></center><br>";
  95      } else {
  96          echo "<center><font class=\"title\"><b>"._SEARCHIN." $topictext</b></font></center><br>";
  97      }
  98  
  99      echo "<table width=\"100%\" border=\"0\"><TR><TD>";
 100      if (($type == "users") OR ($type == "reviews")) {
 101          echo "<img src=\"$alltop\" align=\"right\" border=\"0\" alt=\"\">";
 102      } else {
 103          echo "<img src=\"$topicimage\" align=\"right\" border=\"0\" alt=\"$topictext\">";
 104      }
 105      echo "<form action=\"modules.php?name=$module_name\" method=\"POST\">"
 106      ."<input size=\"25\" type=\"text\" name=\"query\" value=\"$query\">&nbsp;&nbsp;"
 107      ."<input type=\"submit\" value=\""._SEARCH."\"><br><br>";
 108      if (isset($sid)) {
 109          echo "<input type='hidden' name='sid' value='$sid'>";
 110      }
 111      echo "<!-- Topic Selection -->";
 112      $toplist = $db->sql_query("SELECT topicid, topictext from ".$prefix."_topics order by topictext");
 113      echo "<select name=\"topic\">";
 114      echo "<option value=\"\">"._ALLTOPICS."</option>\n";
 115      while($row2 = $db->sql_fetchrow($toplist)) {
 116          $topicid = intval($row2['topicid']);
 117          $topics = filter($row2['topictext'], "nohtml");
 118          if ($topicid==$topic) { $sel = "selected "; }
 119          echo "<option $sel value=\"$topicid\">$topics</option>\n";
 120          $sel = "";
 121      }
 122      echo "</select>";
 123      /* Category Selection */

 124      $category = intval($category);
 125      echo "&nbsp;<select name=\"category\">";
 126      echo "<option value=\"0\">"._ARTICLES."</option>\n";
 127      $result3 = $db->sql_query("SELECT catid, title from ".$prefix."_stories_cat order by title");
 128      while ($row3 = $db->sql_fetchrow($result3)) {
 129          $catid = intval($row3['catid']);
 130          $title = filter($row3['title'], "nohtml");
 131          if ($catid==$category) { $sel = "selected "; }
 132          echo "<option $sel value=\"$catid\">$title</option>\n";
 133          $sel = "";
 134      }
 135      echo "</select>";
 136      /* Authors Selection */

 137      $thing = $db->sql_query("SELECT aid from ".$prefix."_authors order by aid");
 138      echo "&nbsp;<select name=\"author\">";
 139      echo "<option value=\"\">"._ALLAUTHORS."</option>\n";
 140      while($row4 = $db->sql_fetchrow($thing)) {
 141          $authors = filter($row4['aid'], "nohtml");
 142          if ($authors==$author) { $sel = "selected "; }
 143          echo "<option value=\"$authors\">$authors</option>\n";
 144          $sel = "";
 145      }
 146      echo "</select>";
 147      /* Date Selection */

 148                  ?>
 149          &nbsp;<select name="days">
 150                          <option <?php echo $days == 0 ? "selected " : ""; ?> value="0"><?php echo _ALL ?></option>
 151                          <option <?php echo $days == 7 ? "selected " : ""; ?> value="7">1 <?php echo _WEEK ?></option>
 152                          <option <?php echo $days == 14 ? "selected " : ""; ?> value="14">2 <?php echo _WEEKS ?></option>
 153                          <option <?php echo $days == 30 ? "selected " : ""; ?> value="30">1 <?php echo _MONTH ?></option>
 154              <option <?php echo $days == 60 ? "selected " : ""; ?> value="60">2 <?php echo _MONTHS ?></option>
 155                          <option <?php echo $days == 90 ? "selected " : ""; ?> value="90">3 <?php echo _MONTHS ?></option>
 156                  </select><br>
 157          <?php
 158          $sel1 = $sel2 = $sel3 = $sel4 = "";
 159          if (($type == "stories") OR (empty($type))) {
 160              $sel1 = "checked";
 161          } elseif ($type == "comments") {
 162              $sel2 = "checked";
 163          } elseif ($type == "users") {
 164              $sel3 = "checked";
 165          } elseif ($type == "reviews") {
 166              $sel4 = "checked";
 167          }
 168          $num_rev = $db->sql_numrows($db->sql_query("SELECT * from ".$prefix."_reviews"));
 169          echo ""._SEARCHON."";
 170          echo "<input type=\"radio\" name=\"type\" value=\"stories\" $sel1> "._SSTORIES."";
 171          if ($articlecomm == 1) {
 172              echo "<input type=\"radio\" name=\"type\" value=\"comments\" $sel2> "._SCOMMENTS."";
 173          }
 174          echo "<input type=\"radio\" name=\"type\" value=\"users\" $sel3> "._SUSERS."";
 175          if ($num_rev > 0) {
 176              echo "<input type=\"radio\" name=\"type\" value=\"reviews\" $sel4> "._REVIEWS."";
 177          }
 178          echo "</form></td></tr></table>";
 179          if ($qlen == 1) {
 180              OpenTable();
 181              echo ""._SEARCHCHARACTERS."";
 182              CloseTable();
 183          }
 184          $query = stripslashes(check_html($query, "nohtml"));
 185          $query2 = filter($query, "nohtml", 1);
 186          $query3 = filter($query, "", 1);
 187          if ($type=="stories" OR !$type) {
 188  
 189              if ($category > 0) {
 190                  $categ = "AND catid='$category' ";
 191              } else {
 192                  $categ = "";
 193              }
 194              $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";
 195              if (isset($query)) $q .= "AND (s.title LIKE '%$query2%' OR s.hometext LIKE '%$query3%' OR s.bodytext LIKE '%$query3%' OR s.notes LIKE '%$query3%') ";
 196              if (!empty($author)) $q .= "AND s.aid='$author' ";
 197              if (!empty($topic)) $q .= "AND s.topic='$topic' ";
 198              if (!empty($days) && $days!=0) $q .= "AND TO_DAYS(NOW()) - TO_DAYS(time) <= '$days' ";
 199              $q .= " ORDER BY s.time DESC LIMIT $min,$offset";
 200              $t = $topic;
 201              $result5 = $db->sql_query($q);
 202              $nrows = $db->sql_numrows($result5);
 203              $x=0;
 204              if (!empty($query)) {
 205                  echo "<br><hr noshade size=\"1\"><center><b>"._SEARCHRESULTS."</b></center><br><br>";
 206                  echo "<table width=\"99%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n";
 207                  if ($nrows>0) {
 208                      while($row5 = $db->sql_fetchrow($result5)) {
 209                          $sid = intval($row5['sid']);
 210                          $aid = stripslashes($row5['aid']);
 211                          $informant = filter($row5['informant'], "nohtml");
 212                          $title = filter($row5['title'], "nohtml");
 213                          $time = $row5['time'];
 214                          $hometext = filter($row5['hometext']);
 215                          $bodytext = filter($row5['bodytext']);
 216                          $url = filter($row5['url'], "nohtml");
 217                          $comments = intval($row5['comments']);
 218                          $topic = intval($row5['topic']);
 219                          $row6 = $db->sql_fetchrow($db->sql_query("SELECT topictext from ".$prefix."_topics where topicid='$topic'"));
 220                          $topictext = filter($row6['topictext'], "nohtml");
 221                          $furl = "modules.php?name=News&file=article&sid=$sid";
 222                          $datetime = formatTimestamp($time);
 223                          $query = stripslashes(check_html($query, "nohtml"));
 224                          if (empty($informant)) {
 225                              $informant = $anonymous;
 226                          } else {
 227                              $informant = "<a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$informant\">$informant</a>";
 228                          }
 229                          if (!empty($query) AND $query != "*") {
 230                              if (eregi(quotemeta($query),$title)) {
 231                                  $a = 1;
 232                              }
 233                              $text = "$hometext$bodytext";
 234                              if (eregi(quotemeta($query),$text)) {
 235                                  $a = 2;
 236                              }
 237                              if (eregi(quotemeta($query),$text) AND eregi(quotemeta($query),$title)) {
 238                                  $a = 3;
 239                              }
 240                              if ($a == 1) {
 241                                  $match = _MATCHTITLE;
 242                              } elseif ($a == 2) {
 243                                  $match = _MATCHTEXT;
 244                              } elseif ($a == 3) {
 245                                  $match = _MATCHBOTH;
 246                              }
 247                              if (!isset($a)) {
 248                                  $match = "";
 249                              } else {
 250                                  $match = "$match<br>";
 251                              }
 252                          }
 253                          printf("<tr><td><img src=\"images/folders.gif\" border=\"0\" alt=\"\">&nbsp;<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);
 254                          echo " "._ON." $datetime<br>"
 255                          ."$match"
 256                          .""._TOPIC.": <a href=\"modules.php?name=$module_name&amp;query=&amp;topic=$topic\">$topictext</a> ";
 257                          if ($comments == 0) {
 258                              echo "("._NOCOMMENTS.")";
 259                          } elseif ($comments == 1) {
 260                              echo "($comments "._UCOMMENT.")";
 261                          } elseif ($comments >1) {
 262                              echo "($comments "._UCOMMENTS.")";
 263                          }
 264                          if (is_admin($admin)) {
 265                              echo " [ <a href=\"".$admin_file.".php?op=EditStory&amp;sid=$sid\">"._EDIT."</a> | <a href=\"".$admin_file.".php?op=RemoveStory&amp;sid=$sid\">"._DELETE."</a> ]";
 266                          }
 267                          echo "</font><br><br><br></td></tr>\n";
 268                          $x++;
 269                      }
 270  
 271                      echo "</table>";
 272                  } else {
 273                      echo "<tr><td><center><font class=\"option\"><b>"._NOMATCHES."</b></font></center><br><br>";
 274                      echo "</td></tr></table>";
 275                  }
 276  
 277                  $prev=$min-$offset;
 278                  if ($prev>=0) {
 279                      print "<br><br><center><a href=\"modules.php?name=$module_name&amp;author=$author&amp;topic=$t&amp;min=$prev&amp;query=$query&amp;type=$type&amp;category=$category\">";
 280                      print "<b>$min "._PREVMATCHES."</b></a></center>";
 281                  }
 282  
 283                  $next=$min+$offset;
 284                  if ($x>=9) {
 285                      print "<br><br><center><a href=\"modules.php?name=$module_name&amp;author=$author&amp;topic=$t&amp;min=$max&amp;query=$query&amp;type=$type&amp;category=$category\">";
 286                      print "<b>"._NEXTMATCHES."</b></a></center>";
 287                  }
 288              }
 289  
 290          } elseif ($type=="comments") {
 291              /*

 292              $sid = intval($sid);

 293              if (isset($sid)) {

 294              $row7 = $db->sql_fetchrow($db->sql_query("SELECT title from ".$prefix."_stories where sid='$sid'"));

 295              $st_title = stripslashes(check_html($row7['title'], "nohtml"));

 296              $instory = "AND sid='$sid'";

 297              } else {

 298              $instory = "";

 299              }

 300              */
 301              $result8 = $db->sql_query("SELECT tid, sid, subject, date, name from ".$prefix."_comments where (subject like '%$query2%' OR comment like '%$query3%') order by date DESC limit $min,$offset");
 302              $nrows = $db->sql_numrows($result8);
 303              $x=0;
 304              if (!empty($query)) {
 305                  echo "<br><hr noshade size=\"1\"><center><b>"._SEARCHRESULTS."</b></center><br><br>";
 306                  echo "<table width=\"99%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n";
 307                  if ($nrows>0) {
 308                      while($row8 = $db->sql_fetchrow($result8)) {
 309                          $tid = intval($row8['tid']);
 310                          $sid = intval($row8['sid']);
 311                          $subject = filter($row8['subject'], "nohtml");
 312                          $date = $row8['date'];
 313                          $name = filter($row8['name'], "nohtml");
 314                          $row_res = $db->sql_fetchrow($db->sql_query("SELECT title from ".$prefix."_stories where sid='$sid'"));
 315                          $title = filter($row_res['title'], "nohtml");
 316                          $reply = $db->sql_numrows($db->sql_query("SELECT * from ".$prefix."_comments where pid='$tid'"));
 317                          $furl = "modules.php?name=News&amp;file=article&amp;thold=-1&amp;mode=flat&amp;order=1&amp;sid=$sid#$tid";
 318                          if(!$name) {
 319                              $name = "$anonymous";
 320                          } else {
 321                              $name = "<a href=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$name\">$name</a>";
 322                          }
 323                          $datetime = formatTimestamp($date);
 324                          echo "<tr><td><img src=\"images/folders.gif\" border=\"0\" alt=\"\">&nbsp;<font class=\"option\"><a href=\"$furl\"><b>$subject</b></a></font><font class=\"content\"><br>"._POSTEDBY." $name"
 325                          ." "._ON." $datetime<br>"
 326                          .""._ATTACHART.": $title<br>";
 327                          if ($reply == 1) {
 328                              echo "($reply "._SREPLY.")";
 329                              if (is_admin($admin)) {
 330                                  echo " [ <a href=\"".$admin_file.".php?op=RemoveComment&amp;tid=$tid&amp;sid=$sid\">"._DELETE."</a> ]";
 331                              }
 332                              echo "<br><br><br></td></tr>\n";
 333                          } else {
 334                              echo "($reply "._SREPLIES.")";
 335                              if (is_admin($admin)) {
 336                                  echo " [ <a href=\"".$admin_file.".php?op=RemoveComment&amp;tid=$tid&amp;sid=$sid\">"._DELETE."</a> ]";
 337                              }
 338                              echo "<br><br><br></td></tr>\n";
 339                          }
 340                          $x++;
 341                      }
 342                      echo "</table>";
 343                  } else {
 344                      echo "<tr><td><center><font class=\"option\"><b>"._NOMATCHES."</b></font></center><br><br>";
 345                      echo "</td></tr></table>";
 346                  }
 347  
 348                  $prev=$min-$offset;
 349                  if ($prev>=0) {
 350                      print "<br><br><center><a href=\"modules.php?name=$module_name&amp;author=$author&amp;topic=$topic&amp;min=$prev&amp;query=$query&amp;type=$type\">";
 351                      print "<b>$min "._PREVMATCHES."</b></a></center>";
 352                  }
 353  
 354                  $next=$min+$offset;
 355                  if ($x>=9) {
 356                      print "<br><br><center><a href=\"modules.php?name=$module_name&amp;author=$author&amp;topic=$topic&amp;min=$max&amp;query=$query&amp;type=$type\">";
 357                      print "<b>"._NEXTMATCHES."</b></a></center>";
 358                  }
 359              }
 360          } elseif ($type=="reviews") {
 361              $res_n = $db->sql_query("SELECT id, title, text, reviewer, score from ".$prefix."_reviews where (title like '%$query2%' OR text like '%$query3%') $queryrlang order by date DESC limit $min,$offset");
 362              $nrows = $db->sql_numrows($res_n);
 363              $x=0;
 364              if (!empty($query)) {
 365                  echo "<br><hr noshade size=\"1\"><center><b>"._SEARCHRESULTS."</b></center><br><br>";
 366                  echo "<table width=\"99%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n";
 367                  if ($nrows>0) {
 368                      while($rown = $db->sql_fetchrow($res_n)) {
 369                          $id = intval($rown['id']);
 370                          $title = filter($rown['title'], "nohtml");
 371                          $text = filter($rown['text']);
 372                          $reviewer = filter($rown['reviewer'], nohmtl);
 373                          $score = intval($rown['score']);
 374                          $furl = "modules.php?name=Reviews&amp;op=showcontent&amp;id=$id";
 375                          $pages = count(explode( "[--pagebreak--]", $text ));
 376                          echo "<tr><td><img src=\"images/folders.gif\" border=\"0\" alt=\"\">&nbsp;<font class=\"option\"><a href=\"$furl\"><b>$title</b></a></font><br>"
 377                          ."<font class=\"content\">"._POSTEDBY." $reviewer<br>"
 378                          .""._REVIEWSCORE.": $score/10<br>";
 379                          if ($pages == 1) {
 380                              echo "($pages "._PAGE.")";
 381                          } else {
 382                              echo "($pages "._PAGES.")";
 383                          }
 384                          if (is_admin($admin)) {
 385                              echo " [ <a href=\"modules.php?name=Reviews&amp;op=mod_review&amp;id=$id\">"._EDIT."</a> | <a href=\"modules.php?name=Reviews.php&amp;op=del_review&amp;id_del=$id\">"._DELETE."</a> ]";
 386                          }
 387                          print "<br><br><br></font></td></tr>\n";
 388                          $x++;
 389                      }
 390                      echo "</table>";
 391                  } else {
 392                      echo "<tr><td><center><font class=\"option\"><b>"._NOMATCHES."</b></font></center><br><br>";
 393                      echo "</td></tr></table>";
 394                  }
 395  
 396                  $prev=$min-$offset;
 397                  if ($prev>=0) {
 398                      print "<br><br><center><a href=\"modules.php?name=$module_name&amp;author=$author&amp;topic=$t&amp;min=$prev&amp;query=$query&amp;type=$type\">";
 399                      print "<b>$min "._PREVMATCHES."</b></a></center>";
 400                  }
 401  
 402                  $next=$min+$offset;
 403                  if ($x>=9) {
 404                      print "<br><br><center><a href=\"modules.php?name=$module_name&amp;author=$author&amp;topic=$t&amp;min=$max&amp;query=$query&amp;type=$type\">";
 405                      print "<b>"._NEXTMATCHES."</b></a></center>";
 406                  }
 407              }
 408          } elseif ($type=="users") {
 409              $res_n3 = $db->sql_query("SELECT user_id, username, name from ".$user_prefix."_users where (username like '%$query2%' OR name like '%$query2%' OR bio like '%$query3%') order by username ASC limit $min,$offset");
 410              $nrows = $db->sql_numrows($res_n3);
 411              $x=0;
 412              if (!empty($query)) {
 413                  echo "<br><hr noshade size=\"1\"><center><b>"._SEARCHRESULTS."</b></center><br><br>";
 414                  echo "<table width=\"99%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n";
 415                  if ($nrows>0) {
 416                      while($rown3 = $db->sql_fetchrow($res_n3)) {
 417                          $uid = intval($rown3['user_id']);
 418                          $uname = filter($rown3['username'], "nohtml");
 419                          $name = filter($rown3['name'], "nohtml");
 420                          $furl = "modules.php?name=Your_Account&amp;op=userinfo&amp;username=$uname";
 421                          if (empty($name)) {
 422                              $name = ""._NONAME."";
 423                          }
 424                          echo "<tr><td><img src=\"images/folders.gif\" border=\"0\" alt=\"\">&nbsp;<font class=\"option\"><a href=\"$furl\"><b>$uname</b></a></font><font class=\"content\"> ($name)";
 425                          if (is_admin($admin)) {
 426                              echo " [ <a href=\"".$admin_file.".php?chng_uid=$uid&amp;op=modifyUser\">"._EDIT."</a> | <a href=\"".$admin_file.".php?op=delUser&amp;chng_uid=$uid\">"._DELETE."</a> ]";
 427                          }
 428                          echo "</font></td></tr>\n";
 429                          $x++;
 430                      }
 431  
 432                      echo "</table>";
 433                  } else {
 434                      echo "<tr><td><center><font class=\"option\"><b>"._NOMATCHES."</b></font></center><br><br>";
 435                      echo "</td></tr></table>";
 436                  }
 437  
 438                  $prev=$min-$offset;
 439                  if ($prev>=0) {
 440                      print "<br><br><center><a href=\"modules.php?name=$module_name&amp;author=$author&amp;topic=$t&amp;min=$prev&amp;query=$query&amp;type=$type\">";
 441                      print "<b>$min "._PREVMATCHES."</b></a></center>";
 442                  }
 443  
 444                  $next=$min+$offset;
 445                  if ($x>=9) {
 446                      print "<br><br><center><a href=\"modules.php?name=$module_name&amp;author=$author&amp;topic=$t&amp;min=$max&amp;query=$query&amp;type=$type\">";
 447                      print "<b>"._NEXTMATCHES."</b></a></center>";
 448                  }
 449              }
 450          }
 451          CloseTable();
 452          $mod1 = $mod2 = $mod3 = "";
 453          if (isset($query) AND !empty($query)) {
 454              echo "<br>";
 455              if (is_active("Downloads")) {
 456                  $dcnt = $db->sql_numrows($db->sql_query("SELECT * from ".$prefix."_downloads_downloads WHERE title LIKE '%$query2%' OR description LIKE '%$query3%'"));
 457                  $mod1 = "<li> <a href=\"modules.php?name=Downloads&amp;d_op=search&amp;query=$query3\">"._DOWNLOADS."</a> ($dcnt "._SEARCHRESULTS.")";
 458              }
 459              if (is_active("Web_Links")) {
 460                  $lcnt = $db->sql_numrows($db->sql_query("SELECT * from ".$prefix."_links_links WHERE title LIKE '%$query2%' OR description LIKE '%$query3%'"));
 461                  $mod2 = "<li> <a href=\"modules.php?name=Web_Links&amp;l_op=search&amp;query=$query\">"._WEBLINKS."</a> ($lcnt "._SEARCHRESULTS.")";
 462              }
 463              if (is_active("Encyclopedia")) {
 464                  $ecnt1 = $db->sql_query("SELECT eid from ".$prefix."_encyclopedia WHERE active='1'");
 465                  $ecnt = 0;
 466                  while($row_e = $db->sql_fetchrow($ecnt1)) {
 467                      $eid = intval($row_e['eid']);
 468                      $ecnt2 = $db->sql_numrows($db->sql_query("select * from ".$prefix."_encyclopedia WHERE title LIKE '%$query2%' OR description LIKE '%$query3%' AND eid='$eid'"));
 469                      $ecnt3 = $db->sql_numrows($db->sql_query("select * from ".$prefix."_encyclopedia_text WHERE title LIKE '%$query2%' OR text LIKE '%$query3%' AND eid='$eid'"));
 470                      $ecnt = $ecnt+$ecnt2+$ecnt3;
 471                  }
 472                  $mod3 = "<li> <a href=\"modules.php?name=Encyclopedia&amp;file=search&amp;query=$query\">"._ENCYCLOPEDIA."</a> ($ecnt "._SEARCHRESULTS.")";
 473              }
 474              OpenTable();
 475              echo "<font class=\"title\">"._FINDMORE."<br><br>"
 476              .""._DIDNOTFIND."</font><br><br>"
 477              .""._SEARCH." \"<b>$query</b>\" "._ON.":<br><br>"
 478              ."<ul>"
 479              ."$mod1"
 480              ."$mod2"
 481              ."$mod3"
 482              ."<li> <a href=\"http://www.google.com/search?q=$query\" target=\"new\">Google</a>"
 483              ."<li> <a href=\"http://groups.google.com/groups?q=$query\" target=\"new\">Google Groups</a>"
 484              ."</ul>";
 485              CloseTable();
 486          }
 487          include ("footer.php");
 488          break;
 489  }
 490  
 491  ?>


Généré le : Sun Apr 1 11:11:59 2007 par Balluche grâce à PHPXref 0.7