web/wp-content/themes/aparatus/sidebar.php
changeset 1 0d28b7c10758
equal deleted inserted replaced
0:0d9a58d2c515 1:0d28b7c10758
       
     1 <?php global $options;
       
     2  		foreach ($options as $value) {
       
     3 			 if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); 
       
     4 		}
       
     5 	} ?>
       
     6 
       
     7 <div id="sidebar">
       
     8 <div id="searchform">		
       
     9 		<form method="get" action="<?php bloginfo('home'); ?>/">
       
    10 		<input name="s" type="text" class="inputs" id="s" value="<?php echo wp_specialchars($s, 1); ?>" size="32" />
       
    11 		<input type="submit" class="go" value="SEARCH" />	     
       
    12 		</form>
       
    13 </div><!--searchform-->
       
    14 <!--the twitter widget-->
       
    15 <div id="twitter-entry">
       
    16 <?php if ($apa_Twitter == ''){$apa_Twitter = 'mks6804';}?>
       
    17 <?php require_once(ABSPATH . 'wp-includes/class-snoopy.php');
       
    18 $tweet   = get_option("lasttweet");
       
    19 $url  = 'http://twitter.com/statuses/user_timeline/' .$apa_Twitter. '.json?count=20';
       
    20 if ($tweet['lastcheck'] < ( mktime() - 60 ) ) {
       
    21   $snoopy = new Snoopy;
       
    22   $result = $snoopy->fetch($url);
       
    23   if ($result) {
       
    24     $twitterdata   = json_decode($snoopy->results,true);
       
    25     $i = 0;
       
    26     while ($twitterdata[$i]['in_reply_to_user_id'] != '') {
       
    27       $i++;
       
    28     }
       
    29     $pattern  = '/\@([a-zA-Z]+)/';
       
    30     $replace  = '<a href="http://twitter.com/'.strtolower('\1').'">@\1</a>';
       
    31     $output   = preg_replace($pattern,$replace,$twitterdata[$i]["text"]); 
       
    32 	$output = make_clickable($output);  
       
    33     $tweet['lastcheck'] = mktime();
       
    34     $tweet['data']    = $output;
       
    35     $tweet['rawdata']  = $twitterdata;
       
    36     $tweet['followers'] = $twitterdata[0]['user']['followers_count'];
       
    37     update_option('lasttweet',$tweet);
       
    38   } else {
       
    39     echo "Twitter API not responding.";
       
    40   }
       
    41 } else {
       
    42   $output = $tweet['data'];
       
    43 }
       
    44 echo "<p>".$output."</p>";
       
    45 ?>
       
    46 </div><!--twitter widget-->
       
    47 
       
    48 <div id="adblock-big">
       
    49 <a href="<?php echo $apa_ad300x250destination; ?>"><img src="<?php if ($apa_ad300x250image == ""){echo bloginfo('template_directory'). '/images/ad-blocks-big.jpg'; } else {echo $apa_ad300x250image; } ?>"  /></a>
       
    50 </div><!--adblock-big-->
       
    51 
       
    52 <?php include (TEMPLATEPATH . '/tabbed-container.php');?>
       
    53 
       
    54 <div id="adblock-small">
       
    55 <ul>
       
    56 	<li><a href="<?php echo $apa_1_ad_destination; ?>"><img src="<?php if ($apa_1_ad_image == ""){echo bloginfo('template_directory'). '/images/1st-ad-blocks.jpg'; } else {echo $apa_1_ad_image; } ?>"/></a></li>
       
    57 	<li><a href="<?php echo $apa_2_ad_destination; ?>"><img src="<?php if ($apa_2_ad_image == ""){echo bloginfo('template_directory'). '/images/2nd-ad-blocks.jpg'; } else {echo $apa_2_ad_image; } ?>"  /></a></li>
       
    58 	<li><a href="<?php echo $apa_3_ad_destination; ?>"><img src="<?php if ($apa_3_ad_image == ""){echo bloginfo('template_directory'). '/images/3rd-ad-blocks.jpg'; } else {echo $apa_3_ad_image; } ?>"  /></a></li>
       
    59 	<li><a href="<?php echo $apa_4_ad_destination; ?>"><img src="<?php if ($apa_4_ad_image == ""){echo bloginfo('template_directory'). '/images/4th-ad-blocks.jpg'; } else {echo $apa_4_ad_image; } ?>"  /></a></a></li>
       
    60 </ul>
       
    61 </div><!--adblock-small-->
       
    62 	<?php if ( !function_exists('dynamic_sidebar')
       
    63 		|| !dynamic_sidebar('sidebar') ) : ?>
       
    64 	<?php endif; ?>
       
    65 </div><!--sidebar-->