Jump to content

Multiple Domains - Change Logo $_SERVER['SERVER_NAME']


geoff777

Recommended Posts

Hi

 

I have a few related domains all pointing at the root folder.

 

I need to change the logo for the appropriate site.

 

So I have set up multiple CSS files.

 

I need to check the Server Name and load the correct CSS file ... anyone know how to do this?

 

I have this ...

 

variable(array('name' => 'server_name', 'value' => strtolower($_SERVER['SERVER_NAME'])));

 

I don't know how to construct the conditional statement as I get www.mydomain.com and mydomain.com returned

 

also how do I include the CSS files

 

Thanks Geoff

 

After a search I found this from another thread.

 

I've inserted the domains that I'm using.

 

I'm not sure if it is correct or how to call the function ...

function get_css($baselink='../css/',$hostname=NULL) {
   $hostname = $hostname === NULL ? $_SERVER['SERVER_NAME'] : $hostname;
   switch($hostname) {
      case "www.the-rock-of-gibraltar.com":
      case "the-rock-of-gibraltar.com":
      $css_file = "gibraltar_logo.css";
      break;
      
  case "www.torremolinos-benalmadena.com":
      case "torremolinos-benalmadena.com":
      $css_file = "torremolinos_logo.css";
      break;
      
      case "www.fuengirola-mijas.com":
      case "fuengirola-mijas.com":
      $css_file = "fuengirola_logo.css";
      break;
      
      case "www.marbella-puerto-banus.com":
      case "marbella-puerto-banus.com":
      $css_file = "marbella_logo.css";
      break;
  
  case "www.estepona-san-pedro.com":
      case "estepona-san-pedro.com":
      $css_file = "estepona_logo.css";
      break;
  
  case "www.manilva-sabinillas.com":
      case "manilva-sabinillas.com":
      $css_file = "manilva_logo.css";
      break;
  
  case "www.puerto-de-la-duquesa.com":
      case "puerto-de-la-duquesa.com":
      $css_file = "duquesa_logo.css";
      break;
  
  case "www.sotogrande-guadiaro.com":
      case "sotogrande-guadiaro.com":
      $css_file = "sotogrande_logo.css";
      break;
  
  case "www.puerto-de-la-duquesa.com":
      case "puerto-de-la-duquesa.com":
      $css_file = "duquesa_logo.css";
      break;
   }
   return $baselink . $css_file;
}

 

Any help would be much appreciated

 

Geoff

 

Thanks,

 

I put the switch into a file logo_css.php

I want this in the headerinclude of a vBulletin forum but it's not working at all.

 

<?php include 'http://www.the-rock-of-gibraltar.com/forums/logo_css.php'; ?>

 

<link rel="stylesheet" href="<?php print get_css(); ?>" type="text/css" />

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.