[geeklog-cvs] geeklog-1.3/system/classes search.class.php,1.1,1.2

geeklog-cvs-admin at lists.geeklog.net geeklog-cvs-admin at lists.geeklog.net
Fri Jun 6 13:56:19 EDT 2003


Update of /usr/cvs/geeklog/geeklog-1.3/system/classes
In directory internal.geeklog.net:/tmp/cvs-serv22028

Modified Files:
	search.class.php 
Log Message:
Removed debug messages.  Fixed bug with searching comments.

Index: search.class.php
===================================================================
RCS file: /usr/cvs/geeklog/geeklog-1.3/system/classes/search.class.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** search.class.php	2 May 2003 03:50:21 -0000	1.1
--- search.class.php	6 Jun 2003 17:56:17 -0000	1.2
***************
*** 253,267 ****
              $B = DB_fetchArray($result_count);
              $story_results = new Plugin();
-             //$story_results->setExpandedSearchSupport(true);
              $story_results->searchlabel = $LANG09[53];
!             //if (!$_CONF['expanded_search_results']) {
!                 $story_results->addSearchHeading($LANG09[16]);
!                 $story_results->addSearchHeading($LANG09[17]);
!                 $story_results->addSearchHeading($LANG09[18]);
!                 $story_results->addSearchHeading($LANG09[23]);
!             //} else {
!             //    $story_results->addSearchHeading('');
!             //}
!     
              $story_results->num_searchresults = 0;
              $story_results->num_itemssearched = $B[0];
--- 253,261 ----
              $B = DB_fetchArray($result_count);
              $story_results = new Plugin();
              $story_results->searchlabel = $LANG09[53];
!             $story_results->addSearchHeading($LANG09[16]);
!             $story_results->addSearchHeading($LANG09[17]);
!             $story_results->addSearchHeading($LANG09[18]);
!             $story_results->addSearchHeading($LANG09[23]);
              $story_results->num_searchresults = 0;
              $story_results->num_itemssearched = $B[0];
***************
*** 274,289 ****
                      // get rows    
                      $A['title'] = str_replace('$','$',$A['title']);
!                     /*if ($_CONF['expanded_search_results']) {
!                         $fulltext = $A['introtext'] . ' ' .$A['bodytext'];
!                         $author = '<b>' . $LANG09[48] . ':</b> ' . DB_getItem($_TABLES['users'],'username',"uid = '{$A['uid']}'");
!                         $thetime = COM_getUserDateTimeFormat($A['day']);
!                         $thetime = '<b>' . $LANG09[49] . ':</b> ' . $thetime[0];
!                         $hits = '<b>' . $LANG09[50] . ':</b> ' . $A['hits'];
!                         $row = array($A['title'], $this->_getSummary($this->_query, $fulltext), $author, $thetime);
!                     } else {*/
!                         $thetime = COM_getUserDateTimeFormat($A['day']);
!                         $row = array('<a href="article.php?story=' . $A['sid'] . '&query=' . $urlQuery . '">' . stripslashes($A['title']) . '</a>',$thetime[0], DB_getItem($_TABLES['users'],'username',"uid = '{$A['uid']}'"), $A['hits']);
!                     //}
!                     
                      $story_results->addSearchResult($row);
                      $story_results->num_searchresults++;
--- 268,273 ----
                      // get rows    
                      $A['title'] = str_replace('$','$',$A['title']);
!                     $thetime = COM_getUserDateTimeFormat($A['day']);
!                     $row = array('<a href="article.php?story=' . $A['sid'] . '&query=' . $urlQuery . '">' . stripslashes($A['title']) . '</a>',$thetime[0], DB_getItem($_TABLES['users'],'username',"uid = '{$A['uid']}'"), $A['hits']);
                      $story_results->addSearchResult($row);
                      $story_results->num_searchresults++;
***************
*** 372,388 ****
              $result_count = DB_query($sql);
              $B = DB_fetchArray ($result_count);
-             $A = DB_fetchArray($result_comments);
-             
              $comment_results = new Plugin();
              $comment_results->searchlabel = $LANG09[54];
!             //if (!$_CONF['expanded_search_results']) {
!                 $comment_results->addSearchHeading($LANG09[16]);
!                 $comment_results->addSearchHeading($LANG09[17]);
!                 $comment_results->addSearchHeading($LANG09[18]);
!                 $comment_results->addSearchHeading($LANG09[23]);
!             //} else {
!             //    $comment_results->addSearchHeading('');
!             //}
!     
              $comment_results->num_searchresults = 0;
              $comment_results->num_itemssearched = $B[0];
--- 356,364 ----
              $result_count = DB_query($sql);
              $B = DB_fetchArray ($result_count);
              $comment_results = new Plugin();
              $comment_results->searchlabel = $LANG09[54];
!             $comment_results->addSearchHeading($LANG09[16]);
!             $comment_results->addSearchHeading($LANG09[17]);
!             $comment_results->addSearchHeading($LANG09[18]);
              $comment_results->num_searchresults = 0;
              $comment_results->num_itemssearched = $B[0];
***************
*** 394,398 ****
                  $A['title'] = str_replace('$','$',$A['title']);
                  if ($A['comment_type'] == 'article') {
!                     $A['title'] = '<a href="article.php?story=' . $A['sid'] . '">' . stripslashes($A['title']) . '</a>';
                  } else {
                      $A['title'] = '<a href="pollbooth.php?qid=' . $A['sid'] . '&aid=-1#comments">' . stripslashes($A['title']) . '</a>';
--- 370,374 ----
                  $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>';
***************
*** 400,404 ****
                  
                  $thetime = COM_getUserDateTimeFormat($A['day']);
!                 $row = array($A['title'], $thetime[0],DB_getItem($_TABLES['users'],'username',"uid = '{$A['uid']}'"), $A['hits']);
              }
          } else {
--- 376,382 ----
                  
                  $thetime = COM_getUserDateTimeFormat($A['day']);
!                 $row = array($A['title'], $thetime[0],DB_getItem($_TABLES['users'],'username',"uid = '{$A['uid']}'"));
!                 $comment_results->addSearchResult($row);
!                 $comment_results->num_searchresults++;
              }
          } else {
***************
*** 470,479 ****
              $link_results = new Plugin();
              $link_results->searchlabel = $LANG09[38];
!             //if (!$_CONF['expanded_search_results']) {
!                 $link_results->addSearchHeading($LANG09[16]);
!                 $link_results->addSearchHeading($LANG09[33]);
!                 $link_results->addSearchHeading($LANG09[23]);
!             //}
!     
              $link_results->num_searchresults = 0;
              $link_results->num_itemssearched = DB_count($_TABLES['links']);
--- 448,454 ----
              $link_results = new Plugin();
              $link_results->searchlabel = $LANG09[38];
!             $link_results->addSearchHeading($LANG09[16]);
!             $link_results->addSearchHeading($LANG09[33]);
!             $link_results->addSearchHeading($LANG09[23]);
              $link_results->num_searchresults = 0;
              $link_results->num_itemssearched = DB_count($_TABLES['links']);
***************
*** 485,497 ****
                  if (SEC_hasAccess($A['owner_id'],$A['group_id'],$A['perm_owner'],$A['perm_group'],$A['perm_members'],$A['perm_anon']) > 0) {
                      $thetime = COM_getUserDateTimeFormat($A['day']);
!                     if ($_CONF['expanded_search_results']) {
!                         $row = array($A['title'], '<a href="' . $_CONF['site_url']
!                             . '/portal.php?what=link&item=' . $A['lid'] . '">'
!                             . $A['url'] . '</a>', $A['hits'], $A['description']);
!                     } else {
!                         $row = array($A['title'], '<a href="' . $_CONF['site_url']
                              . '/portal.php?what=link&item=' . $A['lid'] . '">'
                              . $A['url'] . '</a>', $A['hits']);
-                     }
                      $link_results->addSearchResult($row);
                      $link_results->num_searchresults++;
--- 460,466 ----
                  if (SEC_hasAccess($A['owner_id'],$A['group_id'],$A['perm_owner'],$A['perm_group'],$A['perm_members'],$A['perm_anon']) > 0) {
                      $thetime = COM_getUserDateTimeFormat($A['day']);
!                     $row = array($A['title'], '<a href="' . $_CONF['site_url']
                              . '/portal.php?what=link&item=' . $A['lid'] . '">'
                              . $A['url'] . '</a>', $A['hits']);
                      $link_results->addSearchResult($row);
                      $link_results->num_searchresults++;
***************
*** 702,717 ****
                  
          for ($i = 1; $i <= count($result_plugins); $i++) {
!             /*if ($_CONF['expanded_search_results']) {
!                 $searchresults->set_file(array('searchheading'=>'searchresults_heading.thtml',
!                                             'searchrows'=>'searchresults_rows.thtml',
!                                             'searchblock' => 'searchblock.thtml',
!                                             'headingcolumn'=>'headingcolumn.thtml',
!                                             'resultrow'=>'resultrowenhanced.thtml',
!                                             'resulttitle'=>'resulttitle.thtml',
!                                             'resultcolumn'=>'resultcolumn.thtml',
!                                             'resultsummary'=>'resultsummary.thtml',
!                                             'resultauthdatehits'=>'resultauthdatehits.thtml'));
!             } else {*/
!                 $searchresults->set_file(array('searchheading'=>'searchresults_heading.thtml',
                                              'searchrows'=>'searchresults_rows.thtml',
                                              'searchblock' => 'searchblock.thtml',
--- 671,675 ----
                  
          for ($i = 1; $i <= count($result_plugins); $i++) {
!             $searchresults->set_file(array('searchheading'=>'searchresults_heading.thtml',
                                              'searchrows'=>'searchresults_rows.thtml',
                                              'searchblock' => 'searchblock.thtml',
***************
*** 720,724 ****
                                              'resulttitle'=>'resultcolumn.thtml',
                                              'resultcolumn'=>'resultcolumn.thtml'));
-             //}
              if ($i == 1) {
                  $searchresults->set_var('data_cols','');
--- 678,681 ----
***************
*** 737,758 ****
                  $searchresults->set_var('results','');
                  for ($j = 1; $j <= $cur_plugin->num_searchresults; $j++) {
!                     //if ($resultNumber >= $start AND $resultNumber <= $end) {
!                         $columns = current($cur_plugin->searchresults);
!                         /*if ($_CONF['expanded_search_results'] AND $cur_plugin->supportsExpandedSearch()) {
                              $searchresults->set_var('data', current($columns));
                              next($columns);
!                             $searchresults->set_var('data2', current($columns));
!                             next($columns);
!                             $searchresults->set_var('data3', current($columns));
!                         } else {*/
!                             for ($x = 1; $x <= count($columns); $x++) {
!                                 $searchresults->set_var('data', current($columns));
!                                 $searchresults->parse('data_cols','resultcolumn',true);
!                                 next($columns);
!                             }
!                         //}
!                         $searchresults->parse('results','resultrow',true);
!                         $searchresults->set_var('data_cols','');
!                     //}
                      next($cur_plugin->searchresults);
                      $resultNumber++;
--- 694,705 ----
                  $searchresults->set_var('results','');
                  for ($j = 1; $j <= $cur_plugin->num_searchresults; $j++) {
!                     $columns = current($cur_plugin->searchresults);
!                     for ($x = 1; $x <= count($columns); $x++) {
                              $searchresults->set_var('data', current($columns));
+                             $searchresults->parse('data_cols','resultcolumn',true);
                              next($columns);
!                     }
!                     $searchresults->parse('results','resultrow',true);
!                     $searchresults->set_var('data_cols','');
                      next($cur_plugin->searchresults);
                      $resultNumber++;
***************
*** 765,775 ****
                  $searchresults->set_var('end_block', COM_endBlock());
                  $searchblocks .= $searchresults->parse('tmpoutput','searchblock');
-                 //$searchmain->set_var('search_blocks', $searchblock
-                 //$searchmain->parse('search_blocks', $searchblock, true);
              }
              next($result_plugins);
          }
          $searchmain->set_var('search_blocks', $searchblocks);
-                 //$searchmain->parse('search_blocks', $searchblock, true);
          $searchmain->set_var('search_pager', $this->_showPager($resultPage, $pages, ''));
          $retval .= $searchmain->parse('output','searchresults');
--- 712,719 ----
***************
*** 1024,1029 ****
          // Have plugins do their searches
          list($nrows_plugins, $total_plugins, $result_plugins) = PLG_doSearch($this->_query, $this->_dateStart, $this->_dateEnd, $this->_topic, $this->_type, $this->_author);
!         print_r($result_plugins);
!         exit;
          // Add the core GL object search results to plugin results
          $nrows_plugins = $nrows_plugins + $this->story_results->num_searchresults;
--- 968,972 ----
          // Have plugins do their searches
          list($nrows_plugins, $total_plugins, $result_plugins) = PLG_doSearch($this->_query, $this->_dateStart, $this->_dateEnd, $this->_topic, $this->_type, $this->_author);
!         
          // Add the core GL object search results to plugin results
          $nrows_plugins = $nrows_plugins + $this->story_results->num_searchresults;





More information about the geeklog-cvs mailing list