Skip to content

Provides basic integration with Tumblr for your LemonStand store.

Notifications You must be signed in to change notification settings

dardub/ls-module-tumblr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ls-module-tumblr

Provides basic integration with Tumblr for your store.

Installation

  1. Download Tumblr.
  2. Create a folder named tumblr in the modules directory.
  3. Extract all files into the modules/tumblr directory (modules/tumblr/readme.md should exist).
  4. Done!

Usage

Add this code to your page (and change the username parameter). There must be more than 2 posts and caching must be enabled - the Tumblr API is unreliable.

	<?
	$tumblr = Tumblr_Account::create(array('username' => 'myusername'));

	$posts = $tumblr->get_posts();
	
 	// fixes an issue with unreliable tumblr api
	$cache = Core_CacheBase::create();
		
	if(count($posts) > 2)
		$cache->set('tumblr_posts', $posts);
	else
		$posts = $cache->get('tumblr_posts');
	
	foreach($posts as $post): 
	?>
		<? if($post['type'] === 'regular'): ?>
		
		<? elseif($post['type'] === 'audio'): ?>
 
		<? elseif($post['type'] === 'photo'): ?>

		<? elseif($post['type'] === 'video'): ?>

		<? elseif($post['type'] === 'link'): ?>

		<? elseif($post['type'] === 'quote'): ?>
		
		<? endif ?>
	<? endforeach ?>

About

Provides basic integration with Tumblr for your LemonStand store.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages