logo.php 673 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. $logo = '';
  3. // Initialize an URL to the variable
  4. if(isset($_SERVER['HTTPS'])) {
  5. if ($_SERVER['HTTPS'] == "on") {
  6. $logo = "https://{$_SERVER['HTTP_HOST']}/theme/images/logo.svg";
  7. }
  8. }
  9. // Use get_headers() function
  10. $headers = @get_headers($logo);
  11. // Use condition to check the existence of URL
  12. if($headers && strpos( $headers[0], '200')) {
  13. include_once('templates/core/Smarty.class.php');
  14. $smarty = new smarty();
  15. $smarty->assign('haslogo', 1);
  16. $smarty->assign('base', $_SERVER['HTTP_HOST']);
  17. $smarty->assign('logo', $logo);
  18. } else {
  19. include_once('templates/core/Smarty.class.php');
  20. $smarty = new smarty();
  21. $smarty->assign('haslogo', 0);
  22. }
  23. ?>