Skip to content

Instantly share code, notes, and snippets.

@tsudot
Created April 12, 2010 05:30
Show Gist options
  • Save tsudot/363293 to your computer and use it in GitHub Desktop.
Save tsudot/363293 to your computer and use it in GitHub Desktop.
<?php
//initialized in config.inc.php
$THINKTANK_CFG['site_url'] = "";
require_once ("common/init.php");
$db = new Database($THINKTANK_CFG);
$conn = $db->getConnection();
$cfg = new Config();
$pd = new PostDAO($db);
$s = new SmartyThinkTank();
$count = 15;
if (isset($_REQUEST['page'])) {
$page = $_REQUEST['page'];
} else {
$page = 1;
}
$s->assign('cfg', $cfg);
if (isset($_REQUEST['v'])) {
$view = $_REQUEST['v'];
switch ($view) {
case 'timeline':
$posts = $pd->getPostsByPublicInstances($page, $count);
$s->assign('posts', $posts);
$s->assign('option', $view);
$s->display('rss.tpl');
break;
case 'mostretweets':
$posts = $pd->getMostRetweetedPostsByPublicInstances($page, $count);
$s->assign('posts', $posts);
$s->assign('option', $view);
$s->display('rss.tpl');
break;
case 'mostreplies':
$posts = $pd->getMostRepliedToPostsByPublicInstances($page, $count);
$s->assign('posts', $posts);
$s->assign('option', $view);
$s->display('rss.tpl');
break;
case 'photos':
$posts = $pd->getPhotoPostsByPublicInstances($page, $count);
$s->assign('posts', $posts);
$s->assign('option', $view);
$s->display('rss.tpl');
break;
case 'links':
$posts = $pd->getLinkPostsByPublicInstances($page, $count);
$s->assign('posts', $posts);
$s->assign('option', $view);
$s->display('rss.tpl');
break;
}
} else {
header('location: http://localhost/thinktank/public.php');
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment