Getting ready for the Big FIREFOX DOWNLOAD DAY with aim to make some Google Referal money too.
Hi,
As you may know tomorrow, June 17 2008 is the Firefox Download Day, when Mozilla is trying to set a world record for the number of downloads as they are releasing Firefox 3.
Also, as you may know Google AdSense has a Firefox referal link "Firefox with Google Toolbar", which comes as an automated Javascript. If a new person installs Firefox, Google gives up to $1 (depending on his/her location, and provided that thaat person did not have firefox before)
So I'm trying to use this global event to promote firefox (which is good for my website) and hopefully make few bucks in the meanwhile.
This is my aim: if a user comes to my site with an Internet Explorer, in the $messages it will display "Your current browser does not allow you to make full use of our website. We strongly recommend that you switch to FIREFOX WITH GOOGLE TOOLBAR" (the last capitalised words will be the automated text link from Google's javascript).
Here are some scripts to detect the browsers:
<?php
if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') )
{
if (!strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') )
{
$browser = 'Internet Explorer (MSIE/Compatible)';
echo 'Your current browser does not allow you to make full use of our website. We strongly recommend that you switch to ';
}
}
?>(The above worked for me when I inserted it into my page.tpl)
There's a more enhanced variant of this here http://drupal.org/node/65903
But since I'm not a programmer, I cannot integrate Google's < script > to display the link "Firefox with Google Toolbar" as a continuation of the above text. It keeps giving me WSOD because I don't know ho to use the right syntax (commas, etc).
Can anyone help please??? This is kinda urgent because the Firefox Download day is tomorrow. And I'm sure other Drupal webmasters would love to have something like this on their website on Juune 17 (tomorrow).
Thanks

I'm not quiet sure if
I'm not quiet sure if firefox with google toolbar will be released the same day. Therefore all the referral links would go to the previous firefox.
What you are looking for is
What you are looking for is drupal_add_js which should be available to the template file.
<?php
if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') )
{
if (!strpos($_SERVER['HTTP_USER_AGENT'], 'Opera') )
{
$browser = 'Internet Explorer (MSIE/Compatible)';
$output = 'Your current browser does not allow you to make full use of our website. We strongly recommend that you switch to ';
$output .= drupal_add_js('<script type="text/javascript"><!--
google_ad_client = "pub-3089583805516298";
/* 120x60, created 6/17/08 */
google_ad_slot = "4271965468";
google_ad_width = 120;
google_ad_height = 60;
google_cpa_choice = ""; // on file
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>','inline');
print $output;
}
}
?>
Should give you what you need.
http://api.drupal.org/api/function/drupal_add_js
Hiveminds Magazine | Drupal Developers Network
IE Destroyer module
http://drupal.org/node/66987
gpk
----
www.alexoria.co.uk