Changeset 57 for branches

Show
Ignore:
Timestamp:
02/21/09 08:05:20 (3 years ago)
Author:
daris
Message:

quick search: if user cant search dont run extension code

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/quick_search/manifest.xml

    r52 r57  
    1212 
    1313                <hook id="hd_head"><![CDATA[ 
    14 global $lang_search; 
    15 require_once FORUM_ROOT.'lang/'.$forum_user['language'].'/search.php'; 
    16 $language_js = 'var lang_search = {\'Display results\' : \''.$lang_search['Display results'].'\', \'Show as topics\' : \''.$lang_search['Show as topics'].'\', \'Show as posts\' : \''.$lang_search['Show as posts'].'\', \'Submit search\' : \''.$lang_search['Submit search'].'\', \'Perform new search\' : \''.$lang_search['Perform new search'].'\'};'; 
     14// If user can search 
     15if ((!$forum_user['is_admmod'] && $forum_user['g_read_board'] == '1' && $forum_user['g_search'] == '1') || $forum_user['is_admmod']) 
     16{ 
     17        global $lang_search; 
     18        require_once FORUM_ROOT.'lang/'.$forum_user['language'].'/search.php'; 
     19        $language_js = 'var lang_search = {\'Display results\' : \''.$lang_search['Display results'].'\', \'Show as topics\' : \''.$lang_search['Show as topics'].'\', \'Show as posts\' : \''.$lang_search['Show as posts'].'\', \'Submit search\' : \''.$lang_search['Submit search'].'\', \'Perform new search\' : \''.$lang_search['Perform new search'].'\'};'; 
    1720 
    1821        $forum_head['quick_search_js'] = '<script type="text/javascript" src="'.$ext_info['url'].'/scripts.js"></script>'; 
     
    2023        $forum_head['quick_search_css'] = '<link rel="stylesheet" type="text/css" media="screen" href="'.$ext_info['url'].'/style.css" />'; 
    2124 
    22 if (strpos($tpl_main, '<body>') !== false) 
    23         $tpl_main = str_replace('<body>', '<body onload="quick_search_onload();">', $tpl_main); 
    24 else 
    25         $tpl_main = str_replace('<body', '<body onload="quick_search_onload();"', $tpl_main); 
    26  
     25        if (strpos($tpl_main, '<body>') !== false) 
     26                $tpl_main = str_replace('<body>', '<body onload="quick_search_onload();">', $tpl_main); 
     27        else 
     28                $tpl_main = str_replace('<body', '<body onload="quick_search_onload();"', $tpl_main); 
     29} 
    2730                ]]></hook> 
    2831