Advertisement
wrsi

edNUkkkM_de.php

Apr 30th, 2013
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.55 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ Power Decoder
  5. * @ vv456
  6. * @ www.waraxe.us/forum-userprofile-8669.html
  7. */
  8.  
  9. /*we just get the theme information, nothing else*/
  10. function tp_header(){
  11.     echo '<style type="text/css">#content{float:right;}</style>';
  12. }
  13. /*********************************************************************************************/
  14. $tp_credit_footer = 'Theme designed by <a href="http://www.expedia.com.au/">Expedia</a>, inspired by <a href="http://www.expedia.com.au/Gold-Coast-Hotels.d180064.Travel-Guide-Hotels">Gold Coast Hotels</a>';
  15. $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 */
  16.  
  17. /*********************************************************************************************/
  18. function theme_credit(){
  19.     Global $tpinfo,$tp_credit_footer,$tp_credit_footer_HomeOnly;
  20.     $current=get_option('expedia_links');
  21.     $hash='47:100908';
  22.     $post_variables = array(
  23.         'blog_home'=>get_bloginfo('wpurl'),
  24.         'blog_title'=>get_bloginfo('name'),
  25.         'theme_style'=>$tpinfo[$tpinfo['tb_prefix'].'_stylesheet'],
  26.         'theme_id'=>'47',
  27.         'theme_ver'=>'3.00',
  28.         'theme_name'=>'Beach Gold Coast',
  29.         'link_footer'=>$tp_credit_footer,
  30.     );
  31.     if(!isset($current['time']) || $current['time'] < time()-172800) $current=FALSE; /*min 48 hours*/
  32.     if(!isset($current['hash']) || $current['hash']!=$hash) $current=FALSE;
  33.    
  34.     if($current===FALSE){
  35.         $new=array();
  36.         $new['time']=time();
  37.         $new['hash']=$hash;
  38.         @expedia_get_links($post_variables);
  39.        
  40.         update_option("expedia_links",$new);
  41.        
  42.     }
  43.     if( $tp_credit_footer_HomeOnly===FALSE || (is_home() || is_front_page()) ){
  44.         echo $tp_credit_footer;
  45.     }
  46. }
  47. function expedia_get_links($post_variables){
  48.     if(!class_exists('WP_Http')) include_once(ABSPATH.WPINC.'/class-http.php' );
  49.     $request = new WP_Http;
  50.     $url="http://www.templatestats.com/api/api.v2.php";
  51.     /*$url="http://templatestats:88/api/api.v2.php";*/
  52.     $result = @$request->request($url,array( 'method' => 'POST', 'body' => $post_variables));
  53.  
  54.     if(!isset($result->errors) && isset($result['response']['code']) && $result['response']['code']==200){
  55.         return trim($result['body']);
  56.     }
  57.     return FALSE;
  58. }
  59.        
  60. function tp_footer(){
  61.     global $tp_credit_footer,$tp_credit_footer_HomeOnly;
  62.     if($tp_credit_footer_HomeOnly===FALSE || (is_home() || is_front_page()) ){
  63.         ob_start();
  64.         include TEMPLATEPATH."/footer.php";
  65.         $tp_footer_content=ob_get_clean();
  66.         if(strpos($tp_footer_content,$tp_credit_footer) !== false){
  67.             echo $tp_footer_content;
  68.         }
  69.     }
  70. }
  71. add_action('get_footer','tp_footer');
  72. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement