Here is the full page code for cell.html:
<?php
$isBot = keyMatch('Googlebot,msnbot,Yahoo! Slurp,Mediapartners-Google,AnanziSpider,ia_archiver,FreshCrawler',$_SERVER['HTTP_USER_AGENT'],true);
$isSearch = keyMatch('google,bing,yahoo,ananzi',$_SERVER['HTTP_REFERER'],true);
$isMobile = keyMatch('MIDP,iPhone,Google Wireless Transcoder,Windows CE',$_SERVER['HTTP_USER_AGENT'],true);
if (!isset($_GET["skip"]))
if ($isSearch && !$isBot && !$isMobile) {
// Reroute to Main page if comming from google search
header("Location: http://www.bashewa.com/"); /* Redirect browser home page */
exit;
} else
if (stripos($_SERVER['HTTP_USER_AGENT'],"MIDP")===false
&& stripos($_SERVER['HTTP_USER_AGENT'],"iPhone")===false
&& stripos($_SERVER['HTTP_USER_AGENT'],"Google Wireless Transcoder")===false
&& stripos($_SERVER['HTTP_USER_AGENT'],"Windows CE")===false
&& stripos($_SERVER['HTTP_USER_AGENT'],"Mediapartners")===false
&& stripos($_SERVER['HTTP_USER_AGENT'],"GoogleBot")===false
&& stripos($_SERVER['HTTP_USER_AGENT'],"msnbot")===false
&& stripos($_SERVER['HTTP_USER_AGENT'],"Slurp")===false
&& stripos($_SERVER['HTTP_USER_AGENT'],"Twiceler")===false
&& stripos($_SERVER['HTTP_USER_AGENT'],"Ask Jeeves")===false
&& stripos($_SERVER['HTTP_USER_AGENT'],"Ananzi")===false
&& stripos($_SERVER['HTTP_USER_AGENT'],"TwoFour")===false
&& stripos($_SERVER['HTTP_USER_AGENT'],"archiver")===false
&& stripos($_SERVER['HTTP_USER_AGENT'],"Feedfetcher")===false
&& stripos($_SERVER['HTTP_USER_AGENT'],"PageFetcher")===false
&& stripos($_SERVER['HTTP_USER_AGENT'],"W3C_Validator")===false) {
// Reroute to Opera Mini
header("Location: http://www.bashewa.com/cell-demo.php?url=http://www.bashewa.com/cell.html"); /* Redirect browser to Opera Mini */
exit;
}
############################################################################
require_once("Settings.php");
$TITLE = 'Bronberg Weather';
$DESC = "Bronberg Weather Station: current weather, weather forecast, trends and history for Bashewa & Tiegerpoort.";
$KEYW = "Bronberg, Bashewa, Tiegerpoort, weather, current weather, weather forecast";
############################################################################
require_once("common.php");
include("cell_top.php");
############################################################################
if (isset($_GET["skip"]))
$skip = "?skip=1";
else $skip = "";
?>
<style type="text/css">
.ForecastDetails {
padding-top: 3px;
padding-left: 0 px;
height: 37px;
line-height: 14px;
background-position: left;
background-repeat: no-repeat;
text-align: right;
font: 12px Arial;
}
.Sun {
background-image: url(ajax-images/sun.png);
}
.Moon {
background-image: url(ajax-images/moon.png);
}
.Field {
font: bold 11px Arial;
}
</style>
</head>
<body>
<div align="center"><div id="container">
<div class="top"><h1>BRONBERG WEATHER</h1>
<div style="color:yellow; font: bold 10px Arial;">Tiegerpoort & Bashewa Weather</div>
</div>
<div class="toplinkscell">
<div style="float:left">
<a href="cell.html<?php echo $skip; ?>" title="Mobile Weather"><b>Home</b></a>
<a href="cell-forecast.php<?php echo $skip; ?>" title="Mobile Forecast"><b>Forecast</b></a>
</div>
<div style="float:right">
<a href="forum/archive/<?php echo $skip; ?>"><b>Crime</b></a>
</div></div>
<div id="content" style="clear:both; margin-bottom: 10px;">
<?php include_once("cell_ajax-dashboard.php"); ?>
</div>
<div id="footer">
<div id="fullversion"><strong>Full Version:</strong></div>
<div id="infobox">You're currently viewing a stripped down version of our content.
<a href="http://www.bashewa.com/">View the full version</a>.</div>
</div>
</div></div>
</body>
</html>
<?php
############################################################################
# End of HTML Page
############################################################################
function keyMatch($needles,$haystack,$first=false) { // if "first" then break after 1st find
if ($needles == '') return 100;
$stac = ' '.$haystack;
$nArray=explode(",",$needles);
$found=0;
$best=count($nArray);
for($i=0;$i<count($nArray);$i++) {
$pzn=stripos($stac,trim($nArray[$i]));
if ($pzn>-1) {
$found++;
if ($first) break;
}
}
// echo('find #'.$found.'/'.$best.'
');
$pct=($found*100)/$best;
return round($pct);
}
?>
Code for cell_top.php:
<?php
require_once("Settings.php");
require_once("common.php");
include_once($SITE['WXtags']);
############################################################################
if (stripos($_SERVER['HTTP_USER_AGENT'],"Opera Mini")!==false)
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
else
echo '<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN"
"http://www.wapforum.org/DTD/xhtml-mobile10.dtd">';
?>
<html xmlns="http://www.w3.org/1999/xhtml"<?php
if (false and isset($SITE['lang'])) { // disabled.. seems to be a problem with it
$lang = substr($SITE['lang'],0,2);
echo ' lang="'.$lang.'" xml:lang="'.$lang.'"';
}?>>
<head>
<?php
if ( !empty($TITLE) )
echo "<title>" . $TITLE . "</title>\n";
else echo "<title>" . $SITE['organ'] . "</title>\n";
if ( !empty($DESC) )
echo "<meta name=\"description\" content=\"" . $DESC . "\" />\n";
else echo "<meta name=\"description\" content=\"" . $SITE['organ'] . "\" />\n";
if ( !empty ($KEYW) )
echo "<meta name=\"keywords\" content=\"" . $KEYW . "\" />\n";
else echo "<meta name=\"keywords\" content=\"" . str_replace(" ",",",$SITE['organ']) . "\" />\n";
?>
<meta http-equiv="Content-Language" content="<?php echo $SITE['lang']; ?>" />
<meta http-equiv="content-type" content="application/xhtml+xml; charset=<?php echo strtoupper($SITE['charset']); ?>" />
<link rel="stylesheet" type="text/css" href="handheld.css" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache" />
<!-- script type="text/javascript" src="ajaxWDwx.js"></script -->
<!-- end of top -->
Replace www.bashewa.com with your website url.