Exemple #1
0
/**
 * Get all photo posts of blog as json
 */
function getAll(){
	global $config;
	
	$client = new Tumblr\API\Client($config['tumblr_consumer_key']);

	$options['limit'] = 50;
	$options['type'] = "photo";
	$options['filter'] = "text";

	$config['post_limit'] = $options['limit'];

	$total = getTotalPosts($client, $config['blog'], $options);
	$response["images"] = array();

	for ($i=0; $i < ceil($total / $options['limit']); $i++) { 
		$data = getImages($i);

		$response['images'] = array_merge($response['images'], $data['images']);
	}


	$onlyUrl = isset($_REQUEST['onlyUrl']); 

	if ($onlyUrl) {
		foreach ($response['images'] as $image) {
			echo $image['src'] . "\r\n";
		}
		die;
	} else {
		die(json_encode($response));
	}
}
Exemple #2
0
            echo ucwords(convertDate($row['Date']));
            ?>
</csmall> | <csmall2>By: <?php 
            echo ucwords($row['Author']);
            ?>
</csmall2></p>
								<p><?php 
            echo str_replace(array("<strong/>", "<strong>"), "", $row['Post']);
            ?>
</p>
								<div class="hline"></div>
								<div class="spacing"></div>
								<?php 
        }
    }
    if (getTotalPosts() > 3) {
        ?>
						<strong><a href="/blog">See more...</a></strong>
						<?php 
    }
    $html = ob_get_contents();
    $cache->set("home_page_blog", $html, 3600);
    ob_end_clean();
    echo $html;
} else {
    echo "<!-- Cached. -->";
    echo $blogContent;
}
?>
		 		
			</div>
Exemple #3
0
                                            </ul>
                                        </li>
                                        <li class="<?php 
echo $page == 5 ? "stick bg-darkBlue" : "";
?>
">
                                            <a href="index.php?p=5"><i class="icon-tools"></i>Settings</a>
                                        </li>
                                    </ul>
                                    <br/>
                                    <div class="panel no-border">
                                        <div class="panel-header">Statistics</div>
                                        <div class="panel-content">
                                            <p>Total Posts</p>
                                            <p><?php 
echo getTotalPosts();
?>
</p>
                                            <p>Total headlines</p>
                                            <p><?php 
echo getTotalHeadlines();
?>
</p>
                                            <p>Total Hits</p>
                                            <p><?php 
echo getTotalHits();
?>
</p>
                                        </div>
                                    </div>
                                </nav>