<?php
//----------------------------------------------------
// m_recent_blogs
// show recent blog posts
//----------------------------------------------------

		drawMenuTop( 'Recent Blog Posts ' );
					
					$show_recent = 10;
		  
					$titles = mysql_query("select blog.title,blog.ID from blog LEFT JOIN
				   	permissions ON permissions.objectID=blog.ID LEFT JOIN permissionGroups ON 
					blog.permission = permissionGroups.pGroup where ((permissions.action <> 'denyView' or permissions.action IS NULL )
				   	or (permissions.username <> '".$CURRENTUSER."' or permissions.username IS NULL)) 
					and (permissionGroups.username ='".$CURRENTUSER."') and (blog.replyID = 0) order by 
					blog.date desc limit 0,$show_recent") 
					or DIE( mysql_error() );
					
					print("<u>Recently Posted:</u><br><br>");	
					print("<font class='fine'>");
					
					while( $row = mysql_fetch_array( $titles ))
					{
						print("<a href='index.php?shard=blog&amp;action=g_viewPost&amp;ID=" . $row['ID'] . "'>" . $row['title'] . "</a>");
						print("<br>");
					}
					
					print("</font>");
          
					
					$titles = mysql_query("select title, replyID from blog where replyID <> 0 order by date desc limit 0,5");
					

					print("<u>Recently Replied To:</u><br><br>");	
					print("<font class='fine'>");
					
					while( $row = mysql_fetch_array( $titles ))
					{
						print("<a href='index.php?shard=blog&amp;action=g_viewPost&amp;ID=" . $row['replyID'] . "'>" . $row['title'] . "</a>");
						print("<br>");
					}
					
					print("</font>");

					
					
		drawMenuBottom();

?>
