Public feed
#598270
<!-- begin sidebar -->
<div id="menu">
<div id="mnav">
<?php
$today = current_time('mysql', 1);
if ( $recentposts = $wpdb->get_results("SELECT ID, post_title FROM $wpdb->posts WHERE post_status = 'publish' AND post_date_gmt < '$today' ORDER BY post_date DESC LIMIT 5")):
?>
<h4>Last posts</h4>
<ul class="mnav">
<?php
foreach ($recentposts as $post) {
if ($post->post_title == '')
$post->post_title = sprintf(__('Post #%s'), $post->ID);
echo "<li><a href='?p=$post->ID'>";
the_title();
echo '</a></li>';
}
?>
</ul>
<?php endif; ?>
<?php
global $comment;
if ( $comments = $wpdb->get_results("SELECT comment_author, comment_author_url, comment_ID, comment_post_ID FROM $wpdb->comments WHERE comment_approved='1' ORDER BY comment_date_gmt
DESC LIMIT 5") ) :
?>
<h4><?php _e('Last comments'); ?></h4>
<ul class="mnav">
<?php
foreach ($comments as $comment) {
echo '<li>' . sprintf('%s <span style="text-transform: lowercase;">on </span>%s', get_comment_author_link(), '<a href="'. get_permalink($comment->comment_post_ID) . '#comment-' . $comment->comment_ID . '">' . get_the_title($comment->comment_post_ID) . '</a>');
echo '</li>';
}
?>
</ul>
<?php endif; ?>
</div>
<div id="nav">
<ul>
<?php if (function_exists('wp_theme_switcher')) { ?>
<li><h4>Themes</h4>
<?php wp_theme_switcher('dropdown'); ?>
</li>
<?php } ?>
<?php
$link_cats = $wpdb->get_results("SELECT cat_id, cat_name FROM $wpdb->linkcategories");
foreach ($link_cats as $link_cat) {
?>
<li id="linkcat-<?php echo $link_cat->cat_id; ?>"><h4><?php echo $link_cat->cat_name; ?></h4>
<ul>
<?php wp_get_links($link_cat->cat_id); ?>
</ul>
</li>
<?php } ?>
<li id="meta"><h4><?php _e('Meta:'); ?></h4>
<ul>
<?php wp_register(); ?>
<li><?php wp_loginout(); ?></li>
<li><a href="feed:<?php bloginfo('rss2_url'); ?>" title="<?php _e('Syndicate this site using RSS'); ?>"><?php _e('<abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
<li><a href="feed:<?php bloginfo('comments_rss2_url'); ?>" title="<?php _e('The latest comments to all posts in RSS'); ?>"><?php _e('Comments <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
<li><a href="http://validator.w3.org/check/referer" title="<?php _e('This page validates as XHTML 1.0 Transitional'); ?>"><?php _e('Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr>'); ?></a></li>
<li><a href="http://gmpg.org/xfn/"><abbr title="XHTML Friends Network">XFN</abbr></a></li>
<li><a href="http://wordpress.org/" title="<?php _e('Powered by WordPress, state-of-the-art semantic personal publishing platform.'); ?>"><abbr title="WordPress">WP</abbr></a></li>
<?php wp_meta(); ?>
</ul>
</li>
<li id="search">
<h4><label for="s"><?php _e('Search:'); ?></label> </h4>
<form id="searchform" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<div>
<input type="text" name="s" id="s" size="15" /><br />
<input type="submit" value="<?php _e('Search'); ?>" />
</div>
</form>
</li>
</ul>
<br />
</div>
</div>
<!-- end sidebar -->