includes/functions.php
changeset 741 a216e412c439
parent 720 e2762777b170
child 756 e8cf18383425
equal deleted inserted replaced
740:098e744df928 741:a216e412c439
   255 
   255 
   256   $baseprot = 'http' . ( isset($_SERVER['HTTPS']) ? 's' : '' ) . '://' . $_SERVER['HTTP_HOST'];
   256   $baseprot = 'http' . ( isset($_SERVER['HTTPS']) ? 's' : '' ) . '://' . $_SERVER['HTTP_HOST'];
   257   $url = $baseprot . $url;
   257   $url = $baseprot . $url;
   258 
   258 
   259   return ($escape) ? htmlspecialchars($url) : $url;
   259   return ($escape) ? htmlspecialchars($url) : $url;
       
   260 }
       
   261 
       
   262 /**
       
   263  * Returns the full page ID string of the main page.
       
   264  * @return string
       
   265  */
       
   266 
       
   267 function get_main_page($force_logged_in = false)
       
   268 {
       
   269   global $db, $session, $paths, $template, $plugins; // Common objects
       
   270   
       
   271   $logged_in = false;
       
   272   if ( is_object($session) && !$force_logged_in )
       
   273   {
       
   274     $logged_in = $session->user_logged_in;
       
   275   }
       
   276   else if ( $force_logged_in )
       
   277   {
       
   278     $logged_in = true;
       
   279   }
       
   280   return $logged_in ? getConfig('main_page_alt', getConfig('main_page')) : getConfig('main_page');
   260 }
   281 }
   261 
   282 
   262 /**
   283 /**
   263  * Enano replacement for date(). Accounts for individual users' timezone preferences.
   284  * Enano replacement for date(). Accounts for individual users' timezone preferences.
   264  * @param string Date-formatted string
   285  * @param string Date-formatted string