<?php if (!$_GET['url']) { ?> Turns a feed into <a href="http://blogxoxo.blogspot.com/2006/01/xoxo-blog-format.html">XOXO Blog Format</a> - compatible <a href="http://microformats.org/wiki/hatom">hAtom</a> <form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?> "><div> <input type="hidden" name="xn_auth" value="no" /> Feed URL: <input type="text" name="url" value="" /> <input type="submit" value="Go" /> </div></form> <?php exit; } //end if ! url header('Content-Type: application/xml; charset=utf-8'); require_once 'feed2hatom.inc.php'; require_once 'OutlineClasses/Outline.php'; $outline = new Outline(feed2hatom($_GET['url'])); $outline->fieldsFromFirstNode(array()); echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">' . "\n"; echo $outline->toXOXO(array('xoxo', 'posts', 'hfeed'), true, array('hentry'));
echo '<ul>'; foreach ($items as $item) { echo '<li><a href="/view.php?id=' . $item->id . '">' . $item->h('title') . '</a><br />' . substr($item->h('description'), 0, 90) . '...<br /><b>Group Tags:</b> ' . substr($item->my->h('grouptags'), 0, 60) . '...</li>'; } echo '</ul>'; } else { if (!$_REQUEST['format']) { echo '<p>No such group(s) exist. We reccomend you <a href="/addGroup.php">create one</a>.</p>'; } if (!class_exists('Outline')) { XN_Application::includeFile('xoxotools', '/OutlineClasses/Outline.php'); } $struct = new Outline(); if ($_REQUEST['format'] == 'xoxo') { header('Content-Type: application/xml;charset=utf-8'); echo $struct->toXOXO(); } //end if format == xoxo if ($_REQUEST['format'] == 'json') { header('Content-Type: text/javascript;charset=utf-8'); if (!isset($_REQUEST['raw'])) { if ($_REQUEST['callback']) { echo $_REQUEST['callback'] . '('; } else { echo 'if(typeof(Tagging) != "object") var Tagging = {};' . "\n" . 'Tagging.groups = ['; } } //end if ! isset raw echo $struct->toJSON('grouptags', true); if (!isset($_REQUEST['raw'])) { if ($_REQUEST['callback']) {
if (!$archivedone) { echo "\n" . ' <a rel="archive" class="published updated">' . htmlentities($design_pattern_stamp) . '</a>'; } if ($node->getField('body')) { echo "\n" . ' <dl>' . "\n"; echo ' <dt>body</dt>' . "\n"; echo ' <dd class="entry-content">' . str_replace("\n", ' ', str_replace("\r", ' ', $node->getField('body'))); if (!preg_match('/rel="?[^\\f]*?tag[^\\f]*?"?/', $node->getField('body')) && $node->getField('tags')) { echo ' <ul class="tags">'; $tags = $node->getField('tags'); $tags = $tags->toArray(); foreach ($tags as $tag) { echo ' <li><a rel="tag" href="http://www.technorati.com/tag/' . urlencode($tag['text']) . '">' . htmlentities($tag['text']) . '</a></li> '; } echo '</ul> '; } //end if ! rel=tag in body echo '</dd>' . "\n"; echo ' </dl>'; } //end if body if ($node->getNumNodes()) { $comments = new Outline($node->getNodes()); echo "\n" . $comments->toXOXO(array('classes' => array('xoxo', 'comments'))); } echo "\n" . ' </li>' . "\n\n"; } //end foreach echo '</ul>' . "\n\n"; echo '</body>' . "\n\n"; echo '</html>';