Buenas,
Me gusta Firefox asi que intentaré ayudaros un poco
He hecho una clase para simplificar el incorporar el script a una web, teniendo que incluir tan sólo un archivo e instanciando la clase. Además he dado la posibilidad de poner estilos personalizados.
Los temas por defecto los he copiado de la versión de papixulooo.
A seguir mejorando el script para ayudar a Firefox!!
Espero sugerencias y comentarios
Archivo a incluir:
Código PHP:
<?php
class DifundeFirefox
{
var $navegadores = array(
"firefox",
"opera",
"msie"
);
var $estiloDefecto = array("firefox" => "
<div align='center'>
<p align='center'>Veo que utilizas<em> Mozilla Firefox</em></p>
<p align='center'>¿Sabías que puedes ponerle <a href='https://addons.mozilla.org/themes/?application=firefox' target='_blank'>skins</a> y <a href='https://addons.mozilla.org/extensions/?application=firefox' target='_blank'>extensiones</a>?</p>
<p align='center'>¡Nosotros tambien utilizamos <a href='http://www.mozilla-europe.org/es/products/firefox/' target='_blank'><strong>Mozilla Firefox</strong></a>!</p>
<p align='center'><a href='http://www.mozilla-europe.org/es/products/firefox/' target='_blank'><img src='http://sfx-images.mozilla.org/affiliates/Buttons/80x15/blue_1.gif' alt='' border='0'></p>
</div>
",
"opera" => "
<div align='center'>
<p align='center'>Sabemos que utilizas Opera</p>
<p align='center'>Pero...<em></em></p>
<p align='center'>¿Conoces las ventajas de un navegador de codigo abierto?</p>
<p align='center'><a target='_blank' href='http://www.mozilla-europe.org/es/products/firefox/'><strong>Mozilla Firefox</strong></a> es de codigo abierto ¡Pruébalo!</p>
<p align='center'><a target='_blank' href='http://www.mozilla-europe.org/es/products/firefox/'><img src='http://sfx-images.mozilla.org/affiliates/Buttons/80x15/blue_1.gif' alt='' border='0'></a></p>
</div>
",
"msie" => "
<div align='center'>
<p align='center'>Veo que utilizas<em> Microsoft Internet Explorer</em></p>
<p align='center'>¿Sabías de la inseguridad de este navegador?</p>
<p align='center'>Nosotros utilizamos <a target='_blank' href='http://www.mozilla-europe.org/es/products/firefox/'><strong>Mozilla Firefox</strong></a> ¡Pruébalo!</p>
<p align='center'><a target='_blank' href='http://www.mozilla-europe.org/es/products/firefox/'><img src='http://sfx-images.mozilla.org/affiliates/Buttons/80x15/blue_1.gif' alt='' border='0'></a></p>
</div>
",
"defecto" => "
<div align='center'>
<p align='center'>No sabemos que navegador usas</p>
<p align='center'>Pero...</p>
<p align='center'>¿Tiene navegación con pestañas?</p>
<p align='center'>¿Es de código abierto? </p>
<p align='center'><a target='_blank' href='http://www.mozilla-europe.org/es/products/firefox/'><strong>Mozilla Firefox</strong></a> si tiene todo esto y más¡Pruébalo!</p>
<p align='center'><a target='_blank' href='http://www.mozilla-europe.org/es/products/firefox/'><img src='http://sfx-images.mozilla.org/affiliates/Buttons/80x15/blue_1.gif' alt='' border='0'></a></p>
</div>
"
);
var $navegador;
var $nestilo;
var $estilo;
function DifundeFirefox($nestilo = "-1",$estilos = NULL)
{
$this->navegador = $this->comprobarNavegador();
$this->nestilo = $nestilo;
if($this->nestilo < 0)
{
$this->estilo = $this->estiloDefecto[$this->navegador];
}
else
{
$this->estilos = $estilos;
$this->estilo = $this->comprobarEstilo();
}
echo $this->estilo;
}
function comprobarNavegador()
{
foreach($this->navegadores as $v)
{
if(eregi($v,$_SERVER['HTTP_USER_AGENT']))
{
return $v;
}
}
return "defecto";
}
function comprobarEstilo()
{
if(!empty($this->estilos[$this->navegador][$this->nestilo]))
{
return $this->estilos[$this->navegador][$this->nestilo];
}
else
{
return $this->estiloDefecto[$this->navegador];
}
}
}
?>
Ahora sólo instanciar la clase donde queremos que se ejecute el script:
Código PHP:
new DifundeFirefox();
Saludos!!