Changeset 2092 in ExiteCMS for trunk/search.php


Ignore:
Timestamp:
12/05/08 20:23:35 (3 years ago)
Author:
WanWizard
Message:

ticket #58: added "search entire site" to the search module
added missing svn properties to several files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/search.php

    r2090 r2092  
    3636$content_filters = array(); 
    3737 
    38 if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 0; 
    39 $variables['rowstart'] = $rowstart; 
     38$variables['items_per_page'] = $settings['numofthreads']; 
    4039 
    4140if (!isset($action)) $action = ""; 
     
    7271$searches = array(); 
    7372$searchindex = array(); 
    74 $result = dbquery("SELECT s.*, m.mod_folder FROM ".$db_prefix."search s LEFT JOIN ".$db_prefix."modules m ON s.search_mod_id = m.mod_id WHERE s.search_active = 1".($search_id?" AND s.search_id = '$search_id'":"")); 
     73 
     74// array to store variables we use in the search templates 
     75$reportvars = array(); 
     76$reportvars['output'] = array(); 
     77 
     78// variable initialisation 
     79if (!isset($rowstart) || !isNum($rowstart)) $rowstart = 1; 
     80$variables['rowstart'] = $rowstart; 
     81 
     82$variables['rows'] = 0; 
     83$lines = 0; 
     84$result = dbquery("SELECT s.*, m.mod_folder FROM ".$db_prefix."search s LEFT JOIN ".$db_prefix."modules m ON s.search_mod_id = m.mod_id WHERE s.search_active = 1".(($search_id > 0 && $search_id < 99999)?" AND s.search_id = '$search_id'":"")); 
    7585while ($data = dbarray($result)) { 
    7686    if (checkgroup($data['search_visibility'])) { 
     
    93103                // do any preprocessing 
    94104                @include PATH_INCLUDES."search/search.".strtolower($data['search_name']).".php"; 
     105                $lines = count($reportvars['output']); 
    95106            } else { 
    96107                $data['mod_folder'] = "-"; 
     
    130141    $variables['default_filter'] = ""; 
    131142    foreach($variables['searches'] as $key => $search) { 
    132         if ($search['search_order'] < $variables['default_location']) { 
     143        if (isset($search['search_filters']) && $search['search_order'] < $variables['default_location']) { 
    133144            $variables['default_location'] = $search['search_order']; 
    134145            $variables['default_filter'] = $search['search_filters']; 
    135             if (!isset($search['search_filters'])) _debug($search, true); 
    136146        } 
    137147    } 
     
    149159} 
    150160 
     161// update the search title in case of a global search 
     162if ($search_id == 99999) { 
     163    $variables['searches'][0]['search_title'] = $locale['src524']; 
     164} 
     165 
    151166// define the search body panel variables 
    152167$template_panels[] = array('type' => 'body', 'name' => 'search', 'title' => $title, 'template' => 'main.search.tpl', 'locale' => $locales); 
Note: See TracChangeset for help on using the changeset viewer.