Timeline

How to use Timeline for Wordpress archives

Basically, just read this post Timeline Archive View For WordPress and then do some improvement by following my article.
First, we don't want to generate a XML file every time, so make it generate one XML file and let the Timeline uses that XML file. Here is the code, put this code in the wordpress root, this is the modified version of the original one from Crickets Chirping:

if (empty($wp)) {
    require_once('wp-config.php');
    wp('feed=atom');
}
$more = 1;
$data = '<data>';
$my_query = new WP_Query('showposts=50');//change the number for showposts
//to how many post you want to show on the timeline.
 
while ($my_query->have_posts()){
	$my_query->the_post();
    $data .= '<event 
        start="';
        ob_start();
    	$data .= get_post_time('M d Y H:i:s \G\M\T', true);
    	ob_end_clean();
        $data .= '"
        isDuration="false"
        title="';
        ob_start();
        the_title_rss();
        $data .= ob_get_contents();
        ob_end_clean();
        $data .= '"
        link="';
        ob_start();
        permalink_single_rss();
        $data .= ob_get_contents();
        ob_end_clean();
        $data .= '">';
 
	ob_start();
	the_excerpt_rss(40, 1);
	$cool = ob_get_contents();
	ob_end_clean();
	$data .= str_replace('>','&gt;',str_replace('<', '&lt;',$cool));
	$data .= '</event>';
}
 
$data .= '</data>';
$fname = "timeline-xml.xml";//name of the file
$fhandle = fopen($fname,"w");
fwrite($fhandle,$data);
fclose($fhandle);

And that generate a XML file in the server. Make the Timeline API link to that XML file
Now we just want to run it every one hour(or what ever you think it's fit), do that by configure the cron job or using a fake cron script like WP-cron.

Timeline

Timeline is like Google Map, but instead show information about locations, it shows info about time. It's part of the MIT's SIMILE project. A demo can be seen by view my the top of this site.
This site's uses the Timeline Archive View For WordPress(with a little modification so it does not generate XML every time).

Editor Comment:

I have not posted anything in last two days because I was busying working on Timeline :hot:

Designline - A Design Timeline

Designline - A Design Timeline shows how a site start from scratch to the final product. Here is copy that stored on this site.

designline openair


Editor Comment:

Wow. this is cool, going to make one myself.

Syndicate content
Honey Pot that kill bots