Pastoid

The page you are looking at now is at this URL: http://pastoid.com/azg

This paste was last updated on June 3, 2009 at 2:07 pm.

home.phpraw

/* Not real code, not even a little bit */
 
/* start loop */
 
<?php 
	$post1date = (empty($post2date)) ? time() : $post2date;
	$post2date = $post->pubdate->int; /* rick_c was right, need to get the ->int even though it displays fine */
	echo "Dates: $post1date, $post2date";
	/* Displays "Dates: 1244048266, 1234326558" */
?>
 
<div class="flickrfill">
	<?php $theme->flickrfill( $post1date, $post2date ); ?>
</div>
 
 
/* Display post */
 
 
/* End Loop */

Toggle wordwrap

flickrfill.plugin.phpraw

<?php
	public function theme_flickrfill( $theme, $post1date, $post2date ) /* need that theme after all */
	{
		$this->person_id= Options::get( 'flickrfill__person' );
 
		echo "Dates in function: $post1date,$post2date";
	/* Displays "Dates in function: ,1244048266" */
		$request= new RemoteRequest( 'http://api.flickr.com/services/rest/?method=flickr.photos.search&format=rest&api_key=39b1bcf1b0c84a24435677252085d436&user_id=' . $this->person_id . '&min_date_taken=' . $post1date . '&max_date_taken=' . $post2date . '&sort=interestingness-desc&media=photos&per_page=5' );
		$request->set_timeout( 5 );
		$result= $request->execute();
		if ( Error::is_error( $result ) ) {
			// this is a cronjob, so no sense displaying an error
			EventLog::log( 'Error getting photo from Flickr', 'err', 'default', 'habari' );
			return;
		}
		$response= $request->get_response_body();
		$xml= new SimpleXMLElement( $response );
		if ( ! $xml ) { return; }
		$photo=$xml->photos->photo;
		if ( ! $photo ) { return; }
		if ( ! $photo['id'] ) { return; }
		echo '<a href="http://www.flickr.com/photos/' . $this->person_id . '/' . $photo['id'] . '"><img src="http://farm' . $photo['farm'] . '.static.flickr.com/' . $photo['server'] . '/' . $photo['id'] . '_' . $photo['secret'] . '_t.jpg"></a>';
		/*Options::set( 'skippyflickr__photo', $newphoto );*/
		EventLog::log( 'Updated photo: ' . $photo['title'], 'info', 'default', 'habari' );
	}
?>
 

Toggle wordwrap

Referring DomainHits
Unknown Referer 164
pastoid.com 6
search.live.com 1
Is this paste spam?
<Hide