<?php
//dv at josheli.com

exit('Remove This Exit Call');

$cpanel_user '';
$cpanel_pass '';
$cpanel_domain 'www.mydomain.com';//do not include 'http://'
$cpanel_theme 'x2';
$view_domain 'mydomain.com';//domain to see stats for

$header '<html><head><style type="text/css">body{background:#FFFFCC} .big{font-size:larger;font-weight:bold;}</style></head><body>';
$footer '</body></html>';



function 
get_file($uri)

  return 
file_get_contents($uri);
}

function 
change_img_src($html)
{
  global 
$gifs;
  foreach(
$gifs as $gif)
  {
    
$html str_replace('src='.$gif'src="'.$_SERVER['PHP_SELF'].'?img='.$gif.'"'$html);
  }
  return 
$html;
}

function 
extract_info($html)
{
  if(
preg_match('@.*(<font.*?</fieldset>).*@s'$html$match))
  {
    return 
$match[1];
  }
    return 
$html;
}



$base_url "http://$cpanel_user:$cpanel_pass@$cpanel_domain:2082/frontend/$cpanel_theme/subdomain/";
$gifs = array('arrow.gif''spacer-wide.gif');

if(isset(
$_GET['img']) && in_array($_GET['img'], $gifs))
{
  
header("Content-type: image/gif");
  echo 
get_file($base_url.$_GET['img']);
}
else
{
  
$page get_file($base_url.'lastvisit.html?domain='.$view_domain);
  
$page extract_info($page);
  
$page change_img_src($page);
  echo 
$header $page $footer;
}

?>