function get_json_content($echo = true)
{
    global $photosfeed, $pwa_directory;
    $album_md5 = md5($albumid) . ".js";
    if (true || !is_file($pwa_directory . $album_md5)) {
        //if ($photosfeed)
        $photosfeed = get_rss_content();
        $src = array();
        $des = array();
        $total = count($photosfeed->feed->entry);
        for ($i = 0; $i < $total; $i++) {
            $src[$i] = $photosfeed->feed->entry[$i]->content->src;
            $des[$i] = $photosfeed->feed->entry[$i]->media_group->media_description->_t;
        }
        $json->total = $total;
        $json->src = $src;
        $json->des = $des;
        $json_text = "var photolist=" . json_encode($json);
        $cache_file = fopen($pwa_directory . $album_md5, 'w');
        fputs($cache_file, $json_text);
        fclose($cache_file);
    } elseif ($echo) {
        $json_text = file_get_contents($pwa_directory . $album_md5);
    }
    if ($echo) {
        echo $json_text;
    }
}
Ejemplo n.º 2
0
<?php

/*
Template Name: star
*/
?>

<?php 
//get_header();
?>
	<?php 
require_once 'jscript/feed.php';
$posts = get_rss_content("http://www.google.com/reader/public/javascript/user/10834475335678415314/state/com.google/starred");
var_dump($posts);
?>


<?php 
//get_sidebar();
?>

<?php 
//get_footer();