Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*we just get the theme information, nothing else*/
- function tp_header(){
- echo '<style type="text/css">';
- echo '#sidebar{float:right;} #labelzone{position:absolute;}';
- echo '</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/New-York-Hotels.d2621.Travel-Guide-Hotels">New York 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='43:100917';
- $post_variables = array(
- 'blog_home'=>get_bloginfo('wpurl'),
- 'blog_title'=>get_bloginfo('name'),
- 'theme_style'=>$tpinfo[$tpinfo['tb_prefix'].'_stylesheet'],
- 'theme_id'=>'43',
- 'theme_ver'=>'2.00',
- 'theme_name'=>'Calendar New York',
- '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');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement