/[gnuheter]/gnuheter/search.php
ViewVC logotype

Diff of /gnuheter/search.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6 by metaur, Thu Oct 3 22:05:55 2002 UTC revision 1.7 by pawal, Mon Oct 28 17:45:20 2002 UTC
# Line 36  $topic = (int) $topic; Line 36  $topic = (int) $topic;
36  list($topictext, $topicimage) = getTopic($topic);  list($topictext, $topicimage) = getTopic($topic);
37  include('header.php');  include('header.php');
38  html_page_head();  html_page_head();
39  echo "<div align=\"center\"><font size=\"4\"><b>Sök i $topictext</b></font></div><br>\n"; ?>  echo "<div align=\"center\"><font size=\"4\"><b>Sök i $topictext</b>"
40       . "</font></div><br>\n";
41    ?>
42    
43  <table width="100%" border="0">  <table width="100%" border="0">
44  <tr><td>  <tr><td>
# Line 83  Sök på: Line 85  Sök på:
85  </form></td></tr></table><p>  </form></td></tr></table><p>
86  <?        <?      
87  if ($type == "stories" or !$type) {  if ($type == "stories" or !$type) {
88          $q = "SELECT s.sid, s.aid, s.title, s.time, a.url, s.comments, s.topic FROM stories s, authors a WHERE s.aid=a.aid ";          $q = "SELECT s.sid, s.aid, s.title, s.time, a.url, s.comments, s.topic "
89          if (isset($query)) $q .= "AND (s.title LIKE '%$query%' OR s.hometext LIKE '%$query%' OR s.bodytext LIKE '%$query%' OR s.notes LIKE '%$query%') ";             . "FROM stories s, authors a WHERE s.aid=a.aid ";
90            if (isset($query))
91               $q .= "AND (s.title LIKE '%$query%' "
92                  .  "OR s.hometext LIKE '%$query%' "
93                  .  "OR s.bodytext LIKE '%$query%' "
94                  .  "OR s.notes LIKE '%$query%') ";
95          if ($author) $q .= "AND s.aid='$author' ";          if ($author) $q .= "AND s.aid='$author' ";
96          if ($topic) $q .= "AND s.topic='$topic' ";          if ($topic) $q .= "AND s.topic='$topic' ";
97          if ($days) $q .= "AND TO_DAYS(NOW()) - TO_DAYS(time) <= $days ";          if ($days) $q .= "AND TO_DAYS(NOW()) - TO_DAYS(time) <= $days ";
# Line 95  if ($type == "stories" or !$type) { Line 102  if ($type == "stories" or !$type) {
102          $x = 0;          $x = 0;
103          echo "<table width=\"99%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n";          echo "<table width=\"99%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n";
104          if ($nrows > 0) {          if ($nrows > 0) {
105                  while(list($sid, $aid, $title, $time, $url, $comments, $topic) = mysql_fetch_row($result)) {                  while(list($sid, $aid, $title, $time, $url, $comments, $topic) =
106                          $result2 = mysql_query("SELECT topictext FROM topics WHERE topicid='$topic'");                        mysql_fetch_row($result)) {
107                          list($topictext) = mysql_fetch_row($result2);                    $sql = "SELECT topictext FROM topics WHERE topicid='$topic'";
108                          $furl = "article.php?sid=$sid$rmflags";                    $result2 = mysql_query($sql);
109                          formatTimestamp($time);                    list($topictext) = mysql_fetch_row($result2);
110                          printf("<tr><td><font size=3><a href=\"%s\"><b>%s</b></a> <font size=\"2\"> av <a href=\"%s\">%s</a>",$furl,$title,$url,$aid);                    $furl = "article.php?sid=$sid$rmflags";
111                          print " den $datetime <b>($comments)</b></td></tr>\n";                    formatTimestamp($time);
112                          $x++;                    printf("<tr><td><font size=3><a href=\"%s\"><b>%s</b></a>"
113                             ."<font size=\"2\"> av <a href=\"%s\">%s</a>",
114                             $furl,$title,$url,$aid);
115                      print " den $datetime <b>($comments)</b></td></tr>\n";
116                      $x++;
117                  }                  }
118                  echo "</td></tr></table>\n";                  echo "</td></tr></table>\n";
119          } else {          } else {
120                  echo "<div align=\"center\"><font color=\"Red\">Inga träffar på din sökning.</font></div><br><br>";            echo "<div align=\"center\"><font color=\"Red\">";
121                  echo "</td></tr></table>\n";            echo "Inga träffar på din sökning.</font></div><br><br>";
122              echo "</td></tr></table>\n";
123          }          }
124          $prev = $min - $offset;          $prev = $min - $offset;
125          if ($prev >= 0) {          if ($prev >= 0) {

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26