[geeklog-cvs] geeklog-1.3/system/classes search.class.php,1.12,1.13

geeklog-cvs-admin at lists.geeklog.net geeklog-cvs-admin at lists.geeklog.net
Sun Aug 17 15:39:43 EDT 2003


Update of /usr/cvs/geeklog/geeklog-1.3/system/classes
In directory geeklog_prod:/tmp/cvs-serv4769

Modified Files:
	search.class.php 
Log Message:
Fixed links to search results in comments to polls (bug #51). Also added proper highlighting of search results in comments.


Index: search.class.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/system/classes/search.class.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** search.class.php	2 Aug 2003 22:07:42 -0000	1.12
--- search.class.php	17 Aug 2003 19:39:41 -0000	1.13
***************
*** 355,359 ****
              $powhere .= "({$_TABLES['pollquestions']}.perm_anon IS NOT NULL)";
      
!             $sql = "SELECT {$_TABLES['stories']}.sid,{$_TABLES['comments']}.title,comment,pid,{$_TABLES['comments']}.uid,type as comment_type,UNIX_TIMESTAMP({$_TABLES['comments']}.date) as day,'comment' as type FROM {$_TABLES['comments']} ";
              $sql .= "LEFT JOIN {$_TABLES['stories']} ON (({$_TABLES['stories']}.sid = {$_TABLES['comments']}.sid)" . $stsql . ") ";
              $sql .= "LEFT JOIN {$_TABLES['pollquestions']} ON ((qid = {$_TABLES['comments']}.sid)" . $posql . ") ";
--- 355,359 ----
              $powhere .= "({$_TABLES['pollquestions']}.perm_anon IS NOT NULL)";
      
!             $sql = "SELECT {$_TABLES['stories']}.sid,{$_TABLES['comments']}.title,comment,pid,{$_TABLES['comments']}.uid,{$_TABLES['comments']}.sid AS qid,type as comment_type,UNIX_TIMESTAMP({$_TABLES['comments']}.date) as day,'comment' as type FROM {$_TABLES['comments']} ";
              $sql .= "LEFT JOIN {$_TABLES['stories']} ON (({$_TABLES['stories']}.sid = {$_TABLES['comments']}.sid)" . $stsql . ") ";
              $sql .= "LEFT JOIN {$_TABLES['pollquestions']} ON ((qid = {$_TABLES['comments']}.sid)" . $posql . ") ";
***************
*** 391,398 ****
              while ($A = DB_fetchArray($result_comments)) {
                  $A['title'] = str_replace('$','$',$A['title']);
                  if ($A['comment_type'] == 'article') {
!                     $A['title'] = '<a href="article.php?story=' . $A['sid'] . '#comments">' . stripslashes($A['title']) . '</a>';
                  } else {
!                     $A['title'] = '<a href="pollbooth.php?qid=' . $A['sid'] . '&aid=-1#comments">' . stripslashes($A['title']) . '</a>';
                  }
                  
--- 391,403 ----
              while ($A = DB_fetchArray($result_comments)) {
                  $A['title'] = str_replace('$','$',$A['title']);
+                 if (!empty ($this->_query)) {
+                     $querystring = '&query=' . $this->_query;
+                 } else {
+                     $querystring = '';
+                 }
                  if ($A['comment_type'] == 'article') {
!                     $A['title'] = '<a href="article.php?story=' . $A['sid'] . $querystring . '#comments">' . stripslashes($A['title']) . '</a>';
                  } else {
!                     $A['title'] = '<a href="pollbooth.php?qid=' . $A['qid'] . '&aid=-1' . $querystring . '#comments">' . stripslashes($A['title']) . '</a>';
                  }
                  





More information about the geeklog-cvs mailing list