<!-- LEFT SIDEBAR -->
<div id="left-menu">
<?php 
session_start();
if (isset($_SESSION['valid_user'])) { ?>
	<h3>Author Navigation</h3>
	<div class="author-list">
	<ul>
		<li><a href="<?php echo $siteurl; ?>/author/index.php">Dashboard Home</a></li>
		<li><a href="<?php echo $siteurl; ?>/author/submit.php">Submit an Article</a></li>
		<li><a href="<?php echo $siteurl; ?>/author/articles.php">View & Edit Articles</a></li>
		<li><a href="<?php echo $siteurl; ?>/author/profile.php">Update Your Profile</a></li>
		<li><a href="<?php echo $siteurl; ?>/author/settings.php">Account Settings</a></li>
		<li><a href="<?php echo $siteurl; ?>/author/logout.php">Logout</a></li>
	</ul>
<br style="clear:left"/>
</div>

<br/>
<?php } ?>
	
		<?php // PRINT OUT THE 120 x XXX ad code
	$query = "select * from adboxes where id=3;"; 
	$result = mysql_query($query,$connection) or die(mysql_error());
	$info = mysql_fetch_assoc($result);

	echo $info['adcode']."<br/><br/>"; 
	?>


	<h3>All Categories</h3>
	<div class="side-lists">
	<ul>
	<?php 
// Populates the Dropdown list with all categories and subcats
	$query = "select * from categories where parentid is null order by name;"; 
	$result = mysql_query($query,$connection) or die(mysql_error());
	$num_results = mysql_num_rows($result);
		
	for ($i=0; $i <$num_results; $i++) { 
		$row = mysql_fetch_assoc($result);
		if ($seourls == 1) { $scrubcatname = generate_seo_link($row['name']); }
		
		if ($seourls == 1) { // With SEO URLS 
			echo "<li><a href=\"".$siteurl."/category/".$row['id']."/".$scrubcatname."/\">".$row['name']."</a></li>"; 
		} else {
			echo "<li><a href=\"".$siteurl."/category.php?id=".$row['id']."\">".$row['name']."</a></li>";
		}
	}
	
?>
	</ul>
<br style="clear:left"/>
</div>

<br />

<?php
	// Populates the Dropdown list with all pages
	$query = "select * from pages;"; 
	$result = mysql_query($query,$connection) or die(mysql_error());
	$num_results = mysql_num_rows($result);
	
	if (!$num_results) {
	} else {
?>
	<h3>Pages</h3>
	<div class="side-lists">
	<ul>

<?php
	for ($i=0; $i <$num_results; $i++) { 
		$row = mysql_fetch_assoc($result); 
		
		if ($seourls == 1) { $scrubtitle = generate_seo_link($row['title']); }
		
		if ($seourls == 1) { // With SEO URLS 
			echo "<li><a href=\"".$siteurl."/page/".$row['id']."/".$scrubtitle."/\">".$row['title']."</a></li>"; 
		} else {
			echo "<li><a href=\"".$siteurl."/page.php?p=".$row['id']."\">".$row['title']."</a></li>";
		}

	}
	echo 	"</ul> <br style=\"clear:left\"/> </div>";
	}
	?>


</div>
