Ignore:
Timestamp:
Dec 27, 2009, 9:59:11 PM (14 years ago)
Author:
EXFTB
Message:

LLGBO improve Header management

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/LLGBO2/main.inc.php

    r4523 r4574  
    1818$obj = new look_like_gbo(); /* class loading */
    1919global $conf,$ttvalues,$plugvalues,$frvalues;
    20 define ('LLGBO_INFO_VERSION','2.0.I');
     20define ('LLGBO_INFO_VERSION','2.0.Ia');
    2121define('LLGBO_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
    2222         
    2323 $conf['LLGBO_SETTINGS'] =  explode("," , $conf['LLGBO']);
    2424 $conf['LLGBO_TOOLTIP'] = explode(",",$conf['LLGBOTOOLTIP']);
    25  $conf['LLGBO_FRAME'] = explode (",",$conf['LLGBOFRAME']);   
     25 $conf['LLGBO_FRAME'] = explode (",",$conf['LLGBOFRAME']);
     26 $conf['LLGBO_HEADER'] = explode (",",$conf['LLGBOHEADER']);   
    2627/////////////////////////////////////////////////////
    2728/*  plugin Class  */
     
    4546function MyBeginheader()
    4647{ global $page,$conf;
    47         // echo '-10-'.$conf['LLGBO_SETTINGS',10];
     48       
    4849         If ($conf['LLGBO_SETTINGS'][2]  == 'true' ) // reset nofollow, noindex
    4950        { unset ($page['meta_robots']);}
     
    5253function Myheader()
    5354{global $template,$conf;
    54         $Page_body = $template->get_template_vars('BODY_ID');   
    55         $Categories = $template->get_template_vars('U_MODE_FLAT'); // Home page
    56  if ((isset ($Page_body)) )// pb with redirect.tpl
    57         {If ($conf['LLGBO_SETTINGS'][6]  == 'true' )  //display Header on home page
    58                 { if (strpos( $Categories ,'categories') === False )
    59                         { $exclu =  strtoupper($Page_body);     /*  maintain header on user  define  page */     
    60                                 if (strpos( strtoupper($conf['LLGBO_SETTINGS'] [7]),$exclu) === False)
    61                                         {$template->append('head_elements',"\n".' <STYLE type="text/css">#theHeader{display: none}</STYLE>');}
    62                         }       
    63                 }
    64 
    65         //
    66         If ($conf['LLGBO_SETTINGS'] [9]  == 'true' and $Page_body == 'thePicturePage')
    67                 {$template->append('head_elements',"\n".' <STYLE type="text/css">.navThumb{display: none} </STYLE>');}
    68  }
     55$page_name = script_basename();
     56if ($conf['LLGBO_SETTINGS'] [6] = 'true' )
     57{$no_header = false;
     58if (  $page_name == 'index')
     59        {//  print_r($_GET.'----'.$page_name );
     60        if ((count ($_GET)) == 0   and ($conf['LLGBO_HEADER'][0] == 'false')) {$no_header = true;}// home
     61         foreach($_GET as $cle =>$valeur)
     62                {//print_r($cle.'_'.$valeur); 
     63                        if ((strpos( $cle ,'categories') == true ) and ($conf['LLGBO_HEADER'][0] == 'false')) {$no_header = true;}// categories
     64                        if ((strpos( $cle ,'category') == true ) and ($conf['LLGBO_HEADER'][1] == 'false')) {$no_header = true;break;}
     65                        if ((strpos( $cle ,'filter=') == true ) and ($conf['LLGBO_HEADER'][2] == 'false')) {$no_header = true;break;}
     66                        if ((strpos( $cle ,'categories/flat') == true ) and ($conf['LLGBO_HEADER'][3] == 'false')) {$no_header = true;break;}
     67                        if ((strpos( $cle ,'categories/posted-monthly-list') == true ) and ($conf['LLGBO_HEADER'][4] == 'false')) {$no_header = true;break;}
     68                        if ((strpos( $cle ,'additional_page') == true ) and ($conf['LLGBO_HEADER'][6] == 'false')) {$no_header = true;break;}
     69                        if ((strpos( $cle ,'most_visited') == true ) and ($conf['LLGBO_HEADER'][7] == 'false')) {$no_header = true;break;}
     70                        if ((strpos( $cle ,'best_rated') == true ) and ($conf['LLGBO_HEADER'][8] == 'false')) {$no_header = true;break;}
     71                        if ((strpos( $cle ,'list') == true ) and ($conf['LLGBO_HEADER'][9] == 'false')) {$no_header = true;break;}
     72                        if ((strpos( $cle ,'recent_pics') == true ) and ($conf['LLGBO_HEADER'][10] == 'false')) {$no_header = true;break;}
     73                        if ((strpos( $cle ,'tags') == true ) and ($conf['LLGBO_HEADER'][11] == 'false')) {$no_header = true;break;}
     74                        if ((strpos( $cle ,'created-monthly-list') == true ) and ($conf['LLGBO_HEADER'][12] == 'false')) {$no_header = true;break;}
     75                        if ((strpos( $cle ,'favorites') == true ) and ($conf['LLGBO_HEADER'][19] == 'false')) {$no_header = true;break;}
     76                    if ((strpos( $cle ,'recent_cats') == true ) and ($conf['LLGBO_HEADER'][20] == 'false')) {$no_header = true;break;}
     77       
     78                 }
     79        }
     80        //print_r($_GET.'----'.$page_name );
     81 if ( $page_name == 'picture' and  $conf['LLGBO_HEADER'][5] == 'false')  {$no_header = true;}//picture page
     82 if ( $page_name == 'tags' and  $conf['LLGBO_HEADER'][11] == 'false')  {$no_header = true;}//tags
     83 if ( $page_name == 'search' and  $conf['LLGBO_HEADER'][13] == 'false')  {$no_header = true;}//search   
     84 if ( $page_name == 'comments' and  $conf['LLGBO_HEADER'][14] == 'false')  {$no_header = true;}//comments
     85 if ( $page_name == 'about' and  $conf['LLGBO_HEADER'][15] == 'false')  {$no_header = true;}//about     
     86 if ( $page_name == 'notification' and  $conf['LLGBO_HEADER'][16] == 'false')  {$no_header = true;}//notification       
     87 if ( $page_name == 'register' and  $conf['LLGBO_HEADER'][17] == 'false')  {$no_header = true;} //notification   
     88 if ( $page_name == 'identification' and  $conf['LLGBO_HEADER'][18] == 'false')  {$no_header = true;}//about     
     89 if ($no_header == true)
     90{$template->append('head_elements',"\n".' <STYLE type="text/css">#theHeader{display: none}</STYLE>');}
     91}       
     92               
     93
     94//
     95If ($conf['LLGBO_SETTINGS'] [9]  == 'true' )
     96{$template->append('head_elements',"\n".' <STYLE type="text/css">.navThumb{display: none} </STYLE>');}
     97 
    6998}  // end header
    7099
     
    100129</style>';
    101130// -----------  add JS tooltip in header ----------------------
    102  If (($conf['LLGBO'][1]  == 'true' ) /*  tooltip  */  or  ($conf['LLGBO_SETTINGS'] [2]  == 'true' )  /* exif under bt */ )
     131 If (($conf['LLGBO'][1]  == 'true' ) /*  tooltip  */  or  ($conf['LLGBO_SETTINGS'] [2]  == 'true' )  /* exif under bt */
     132 or  ($conf['LLGBO_SETTINGS'] [4]  === 'true' ) /* usemap and Display Thumb  */)
    103133            {  $javacss = '<script type="text/javascript" charset="utf-8"  src="'.LLGBO_PATH;   
    104134                  $linkcss = '<link rel="stylesheet" type="text/css" href="'.LLGBO_PATH;
Note: See TracChangeset for help on using the changeset viewer.