Changeset 1408 in ExiteCMS for branches/PLi-Fusion/search.php


Ignore:
Timestamp:
05/15/08 22:25:54 (4 years ago)
Author:
hverton
Message:

Merged trunk revisions 1342:1407 into the PLi-Fusion branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PLi-Fusion/search.php

    r1124 r1408  
    4646$variables['rowstart'] = $rowstart; 
    4747 
     48// do we have a localized menu? If so, select only the current locale 
     49switch ($settings['sitelinks_localisation']) { 
     50    case "none": 
     51        $where = ""; 
     52        break; 
     53    case "single": 
     54        $where = ""; 
     55        break; 
     56    case "multiple": 
     57        if (isset($link_locale)) { 
     58            $result = dbquery("SELECT * FROM ".$db_prefix."locale WHERE locale_code = '".stripinput($link_locale)."' AND locale_active = '1' LIMIT 1"); 
     59            if (!dbrows($result)) unset($link_locale); 
     60        } 
     61        if (!isset($link_locale)) $link_locale = $settings['locale_code']; 
     62        $variables['link_locale'] = $link_locale; 
     63        $where = "AND link_locale = '".$link_locale."' "; 
     64        break; 
     65} 
     66 
    4867// get the available options from the database 
    49 $result = dbquery("SELECT * FROM ".$db_prefix."site_links WHERE link_position<='2' ORDER BY link_order"); 
     68$result = dbquery("SELECT * FROM ".$db_prefix."site_links WHERE link_position<='2' ".$where."ORDER BY link_order"); 
    5069$variables['links'] = array(); 
    5170if (dbrows($result) != 0) { 
     
    91110        case "f":   // forums 
    92111            $result = dbquery( 
    93                 "SELECT tp.*, tf.*, tu.user_id,user_name, 
    94                 MATCH(post_subject, post_message) AGAINST ('$stext' IN BOOLEAN MODE) AS score 
     112                "SELECT tp.*, tf.*, tu.user_id,user_name, fa.attach_id, 
     113                MATCH(tp.post_subject, tp.post_message, fa.attach_name, fa.attach_realname, fa.attach_comment) AGAINST ('$stext' IN BOOLEAN MODE) AS score 
    95114                FROM ".$db_prefix."posts tp 
    96115                INNER JOIN ".$db_prefix."forums tf USING(forum_id) 
    97116                INNER JOIN ".$db_prefix."users tu ON tp.post_author=tu.user_id 
    98                 WHERE ".groupaccess('forum_access')." AND MATCH(post_subject, post_message) AGAINST ('$stext' IN BOOLEAN MODE) 
     117                LEFT JOIN ".$db_prefix."forum_attachments fa ON tp.post_id=fa.post_id 
     118                WHERE ".groupaccess('forum_access')." AND MATCH(tp.post_subject, tp.post_message, fa.attach_name, fa.attach_realname, fa.attach_comment) AGAINST ('$stext' IN BOOLEAN MODE) 
    99119                ORDER BY score DESC, post_datestamp DESC" 
    100120            ); 
Note: See TracChangeset for help on using the changeset viewer.