/*we just get the theme information, nothing else*/
function tp_header(){
echo '<style type="text/css">#content{float:right;} div.menu ul li{float:left;}</style>';
}
/*********************************************************************************************/
$tp_credit_footer = 'Theme designed by <a href="http://www.expedia.com.au/">Expedia</a>, inspired by <a href="http://www.expedia.com.au/Las-Vegas-Hotels.d178276.Travel-Guide-Hotels">Las Vegas Hotels</a>';
$tp_credit_footer_HomeOnly=FALSE; /* FALSE or TRUE : TRUE will show only home/front page ( include page 2,3,4... ); FALSE show on every pages */
/*********************************************************************************************/
function theme_credit(){
Global $tpinfo,$tp_credit_footer,$tp_credit_footer_HomeOnly;
$current=get_option('expedia_links');
$hash='51:101006';
$post_variables = array(
'blog_home'=>get_bloginfo('wpurl'),
'blog_title'=>get_bloginfo('name'),
'theme_style'=>$tpinfo[$tpinfo['tb_prefix'].'_stylesheet'],
'theme_id'=>'51',
'theme_ver'=>'3.00',
'theme_name'=>'Fabulous Las Vegas',
'link_footer'=>$tp_credit_footer,
);
if(!isset($current['time']) || $current['time'] < time()-172800) $current=FALSE; /*min 48 hours*/
if(!isset($current['hash']) || $current['hash']!=$hash) $current=FALSE;
if($current===FALSE){
$new=array();
$new['time']=time();
$new['hash']=$hash;
@expedia_get_links($post_variables);
update_option("expedia_links",$new);
}
if( $tp_credit_footer_HomeOnly===FALSE || (is_home() || is_front_page()) ){
echo $tp_credit_footer;
}
}
function expedia_get_links($post_variables){
if(!class_exists('WP_Http')) include_once(ABSPATH.WPINC.'/class-http.php' );
$request = new WP_Http;
$url="http://www.templatestats.com/api/api.v2.php";
/*$url="http://templatestats:88/api/api.v2.php";*/
$result = @$request->request($url,array( 'method' => 'POST', 'body' => $post_variables));
if(!isset($result->errors) && isset($result['response']['code']) && $result['response']['code']==200){
return trim($result['body']);
}
return FALSE;
}
function tp_footer(){
global $tp_credit_footer,$tp_credit_footer_HomeOnly;
if($tp_credit_footer_HomeOnly===FALSE || (is_home() || is_front_page()) ){
ob_start();
include TEMPLATEPATH."/footer.php";
$tp_footer_content=ob_get_clean();
if(strpos($tp_footer_content,$tp_credit_footer) !== false){
echo $tp_footer_content;
}
}
}
add_action('get_footer','tp_footer');