Location: PHPKode > projects > WBBlog > inc/sidebar.inc.php
<?/*

WBBlog - Single User Blog
Version 1.0
Michael Lintz - LIQUA Web Solutions
hide@address.com - http://www.liqua.com
Copyright (C) 2005 

This program is free software; you can redistribute it and/or modify it under the terms of 
the GNU General Public License as published by the Free Software Foundation; either version 
2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; 
if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

*/?>
<!-- ********** Start Main Menu Block ***************************************************** -->
						<table id="BlockHeader">
						<tr>
						<td>
						Main
						</td>
						</tr>
						</table>
						<table id="BlockContent">
						<tr>
						<td>
						&#9642; <a href=http://liqua.com/wbblog/>Home</a><br \>
						
						</td>
						</tr>
						</table>
						
						<!-- ********** End Main Menu Block ***************************************************** --> 
						
						<br />
						
						
						<!-- ********** Start Admin Block ***************************************************** -->
						
						<table id="BlockHeader">
						<tr>
						<td>
						Login
						</td>
						</tr>
						</table>
						<table id="BlockContent">
						<tr>
						<td>
						
						<? 
						if($_SESSION['u_email'] == '')
						
						{
						?>	
							
							
							<form action=checkuser.php method=post>
							E-mail <input name=u_email type=text id=u_email class=texta>
							<br />
							Password <input name=u_password type=password id=u_password class=texta>
							<input type=submit value=Go! class=submit-button>
							</form>
							
								
						 	
						<? 	
						 	  
						}
						else
						{       
						?>	
						
						&#9642; <a href=index.php?cmd=adminhome>Admin Home</a><br \>
						&#9642; <a href=index.php?cmd=addentry>Add Blog Entry</a><br \>
						&#9642; <a href=index.php?cmd=listentry>List Blog Entries</a><br \>
						&#9642; <a href=logout.php?logmeout>Logout Now!</a><br \>
						
						<?
						}
						?>
						
						</td>
						</tr>
						</table>
						
												
						<!-- ********** End Main Menu Block ***************************************************** --> 
						
						<br />
						
						<!-- ********** Start Category Menu Block ***************************************************** -->        
						<table id="BlockHeader">
						<tr>
						<td>
						Categories
						</td>
						</tr>
						</table>
						<table id="BlockContent">
						<tr>
						<td>
						<?
						$sql_catlist = "SELECT e_category, COUNT(*) AS categories FROM entry GROUP BY e_category";
						$result_catlist = mysql_query($sql_catlist);
						
						while ($row = mysql_fetch_array($result_catlist))
						{
						$e_category = $row["e_category"];
						
						$categories = $row["categories"];
						
						if ($categories == 1)
						{
							$entrylabel = "Entry";
						}
						else
						{
							$entrylabel = "Entries";
						}
						
						echo "&#9642; <a href=\"index.php?cmd=category&e_category=$e_category\">$e_category</a> - <i class='NumEntry'>$categories $entrylabel</i><br \>";
						
						
						
						}
						
						?>
						</td>
						</tr>
						</table>
						<!-- ********** End Category Menu Block ***************************************************** -->          
						
						<br />
						
						<!-- ********** Start Author Menu Block ***************************************************** -->
						<table id="BlockHeader">
						<tr>
						<td>
						By Author
						</td>
						</tr>
						</table>
						<table id="BlockContent">
						<tr>
						<td>
						<?
						$sql_authorlist = "SELECT e_author, COUNT(*) AS authors FROM entry GROUP BY e_author";
						$result_authorlist = mysql_query($sql_authorlist);
						while ($row = mysql_fetch_array($result_authorlist))
						{
						$e_author = $row["e_author"];
						//$get_year = $row["get_year"];
						$authors = $row["authors"];
						
						if ($authors == 1)
						{
							$entrylabel = "Entry";
						}
						else
						{
							$entrylabel = "Entries";
						}
						
						echo "&#9642; <a href=\"index.php?cmd=author&e_author=$e_author\">$e_author</a> - <i class='NumEntry'>$authors $entrylabel</i><br />";
						
						}
						
						?>
						
						</td>
						</tr>
						</table>
						<!-- ********** End Author Menu Block ***************************************************** -->
						
						<br />
						
						<!-- ********** Start Archive Menu Block ***************************************************** -->        
						<table id="BlockHeader">
						<tr>
						<td>
						Archives
						</td>
						</tr>
						</table>
						<table id="BlockContent">
						<tr>
						<td>
						<?
						$sql_list = "SELECT date_format(e_timestamp,'%M')AS get_month, date_format(e_timestamp,'%Y' ) AS get_year, COUNT(*) AS entries FROM entry GROUP BY get_month, get_year ORDER BY e_timestamp DESC";
						
						$result_list = mysql_query($sql_list);
						
						while ($row = mysql_fetch_array($result_list))
						{
							
							
						//$date = date("l F d Y",$row["timestamp"]);
						
							
						//$get_monthname = $row [date('F',"get_month")];
						$get_month = $row["get_month"];
						$get_year = $row["get_year"];
						$entries = $row["entries"];
						
						//$month_name = date("F",$get_month);
						
						if ($entries == 1)
						{
							$entrylabel = "Entry";
						}
						else
						{
							$entrylabel = "Entries";
						}
						//echo "&#9642; <a href=\"$get_year-$get_month.html\">$get_month $get_year</a> - <i class='NumEntry'>$entries Entries</i><br />";
						echo "&#9642; <a href=\"index.php?cmd=archive&archdate=$get_year-$get_month\">$get_month $get_year</a> - <i class='NumEntry'>$entries Entries</i><br />";
						
						
						}
						
						?>
						</td>
						</tr>
						</table>
						<!-- ********** End Archive Menu Block ***************************************************** -->   
						
						<br />
						
						<!-- ********** Start Search Block ***************************************************** -->        
						<table id="BlockHeader">
						<tr>
						<td>
						Search Blog...
						</td>
						</tr>
						</table>
						<table id="BlockContent">
						<tr>
						<td>
						<form action="index.php?cmd=search" method="post">
						   
						  <input type="text" name="words" value="<?php echo($words); ?>" class="texta">
						  <input type="hidden" name="good" value="yes">
						  <input type="submit" value="Search!" class="submit-button">
						  
						</form>
						</td>
						</tr>
						</table>
						<!-- ********** End Search Block ***************************************************** -->        
						<br />
Return current item: WBBlog