Location: PHPKode > projects > ArticleSetup > ArticleSetup-v1-1/upload/author/index.php
<?php 
session_start();
$pagetitle = "Author Control Panel Homepage";
include('../config.php');
include('security.php');
include('header.php');

// A query to get article information 
	$query = "select * from articles where authorid =".$id.";";
	$result = mysql_query($query,$connection) or die(mysql_error());
	$totalarticles = mysql_num_rows($result);
	
	$query = "select * from articles where authorid =".$id." and status=1;";
	$result = mysql_query($query,$connection) or die(mysql_error());
	$reviewarticles = mysql_num_rows($result);

	$query = "select * from articles where authorid =".$id." and status=2;";
	$result = mysql_query($query,$connection) or die(mysql_error());
	$problemarticles = mysql_num_rows($result);

	$query = "select SUM(articleviews.views) from articles, articleviews where authorid = ".$id." and articleviews.articleid = articles.id; "; 
	$result = mysql_query($query,$connection) or die(mysql_error());
	$getviews = mysql_fetch_array($result);
	$totalviews = $getviews['SUM(articleviews.views)'];
?>


<!-- LEFT SIDEBAR -->
<?php include('../sidebar.php');

// Call the top area of the author template
	$authortop = new Template("../templates/".$template."/author-top.tpl");
	// Outputs the page template!
	echo $authortop->output();

 ?>


<h1><?php echo $fname; ?>'s Author Dashboard</h1>

<div class="alert"><b>Welcome to your author dashboard!</b><br/> Here you can publish and edit your articles, update your author profile, edit your account settings, and more. </div>


<br/>
<table><tr><td>
<table><tr>
<td style="padding: 0 10px"><a href="submit.php"><center><img border="0" src="../images/icon_add.png" /><br/><b>Submit an Article</b></center></a></td>
<td style="padding: 0 10px"><a href="articles.php"><center><img border="0" src="../images/icon_edit.png" /><br/><b>View/Edit Articles</b></center></a></td>
<td style="padding: 0 10px"><a href="profile.php"><center><img border="0" src="../images/icon_profile.png" /><br/><b>View Your Profile</b></center></a></td></tr>
<tr><td height="25px" colspan="4"></td></tr>
<trstyle="padding: 0 10px"><td><a href="settings.php"><center><img border="0" src="../images/icon_settings.png" /><br/><b> Account Settings</b></center></a></td>
<td style="padding: 0 10px"><a href="logout.php"><center><img border="0" src="../images/icon_logout.png" /><br/><b>Logout</b></center></a></td>
<td></td></td>
</tr></table>
</td>
<td>
<div style="float: right;  background: #eee; border: 1px solid #999; padding: 7px; margin: 5px 0; color: #666;">
<b><?php echo $fname; ?>'s Profile (<a href="profile.php">update</a>) &nbsp;</b><br/>
<img style="border:2px solid #999; margin: 6px 6px 8px 0; float: left;" src="<?php echo $gravatar; ?>" />
<?php echo $bio; ?>
<br/>

<div style="clear:both;"></div>

<b>Stats:</b><br/>
Live Articles:<b> <?php echo $totalarticles; ?> </b>(<a href="articles.php">Go</a>)<br/>
Articles in Review:<b> <?php echo $reviewarticles; ?> </b>(<a href="articles.php">Go</a>)<br/>
Problem Articles:<b> <?php echo $problemarticles; ?> </b>(<a href="articles.php">Go</a>)<br/>
Total Article Views:<b> <?php echo $totalviews; ?> &nbsp;</b><br/>
</div>
</td></tr></table>

<div style="clear:both; width: 100%; padding-top: 15px; border-bottom: 3px solid #F3F1E9;"></div>

<?php
// Call the bottom area of the author template
	$authorbottom = new Template("../templates/".$template."/author-bottom.tpl");
	// Outputs the page template!
	echo $authorbottom->output();


 include('../obinclude.php'); ?>
Return current item: ArticleSetup