Location: PHPKode > projects > MyBlog: PHP and MySQL Blog/CMS software > os/files/sidebar.php
<div id="right">
<?php echo $_GET['msg']; ?>
<?php
require("config/settings.inc");
require("config/mysqlconnection.inc");
if (isset($display_page_title)) {
echo "<div id=\"sidepage\">";
$result = mysql_query("SELECT * FROM myblog_posts WHERE title = '$display_page_title'") or die(mysql_error());
while($row = mysql_fetch_array( $result )) {
echo $row['content'];
}
echo "</div>";
}


if ($login == yes OR $_GET['login'] == yes OR $_GET['blog'] == yes) {
if(isset($_COOKIE['login'])) {

echo "<div id=\"sidelogin\">";
	$name = $_COOKIE['login']; 

        echo "<p>Welcome,  <a href=\"member.php?id=". $name . "\">" . $name . "</a><br /><a href=\"lo.php?id=" . $name . "\">(Log Out)</a><br /><a href=\"member.php?id=". $name . "\">(My Control Panel)</a>";
	if (isset($_COOKIE['post']) OR isset($_COOKIE['admin'])) {
	echo "<br /><a href=\"admin/add.php\">(Make a post)</a></p></div>";
	}
	else {
	echo "</p></div>";
	}
	
}
else{

echo "<div id=\"sidelogin\">";
	echo "<p><em>You are not logged in!</em><br /><form action=\"login.php\" method=\"post\">
Username: <input type=\"text\" name=\"user\"><br />
Password: <input type=\"password\" name=\"pass\"><br />
<input type=\"submit\" value=\"Login\"></form><br />(Cookies Must Be Enabled)</p>
<a href=\"register.php\">Register</a></div>";
} ?>
<?php if(isset($_COOKIE['admin'])) {
	echo "<a href=\"admin/\">Admin Panel</a>"; 
}


}

?>
<?php
require("config/settings.inc");

if (isset($_COOKIE['login']) AND $market == yes AND ($side_only_page == no OR $_GET['blog'] == yes)) {
echo "<h2><a href=\"market.php\">Kudos Market Place</a></h2>";
}
else {
}

if (isset($_COOKIE['login']) AND $chat == yes AND ($side_only_page == no OR $_GET['blog'] == yes)) {
echo "<h2 onClick=\"message('chat')\">Instant Chat</h2>";
}
else {
}

if (isset($_COOKIE['login']) AND $games == yes AND ($side_only_page == no OR $_GET['blog'] == yes)) {
echo "<h2><a href=\"games.php\">Games Room</a></h2>";
}
else {
}

require("modules/config/installed.inc");
?>

<?php
require("config/settings.inc");
if ($welcome_msg == yes AND ($side_only_page == no OR $_GET['blog'] == yes)) {
echo "<div id=\"sidewelcome\"><h2>Welcome</h2>";
$desc1 = fopen("config/desc.txt","r");
$desc = fread($desc1, 1000);

echo $desc;
echo "</div>";
}
?>
<?php
require("config/settings.inc");
require("config/mysqlconnection.inc");
if ($pagedisplay == yes AND ($side_only_page == no OR $_GET['blog'] == yes)) {
echo "<div id=\"sidepagedisplay\"><h2>Pages</h2>";
$result = mysql_query("SELECT * FROM myblog_posts WHERE page = 'yes' AND publish = 'everyone' AND nav = 'yes'") or die(mysql_error());
while($row = mysql_fetch_array( $result )) {
echo "<a href=\"post.php?id=" . $row['title'] . "&page=yes\">" . $row['title'] . "</a><br />";
}

echo "</div>";
}
else {
}
?>

<?php

require("config/settings.inc");
if ($categories == yes AND ($side_only_page == no OR $_GET['blog'] == yes)) {
echo "
<div id=\"sidecategories\"><h2>Categories</h2>
<a href=\"index.php\">(Show All)</a><br />";
include("config/cat_list.txt");
echo "</div>";
}
?>

<?php
require("config/settings.inc");
require("config/mysqlconnection.inc");

if ($recentcomments == yes AND ($side_only_page == no OR $_GET['blog'] == yes)) {
echo "<div id=\"sidecomments\"><h2>Recent Comments</h2>";
$result = mysql_query("SELECT * FROM myblog_comments ORDER BY number DESC LIMIT 5") or die(mysql_error());
while($row = mysql_fetch_array( $result )) {
echo "<a href=\"post.php?id=" . $row['entry'] . "\">" . $row['entry'] . "</a><br />";
}
echo "</div>";
}
else {
}
?>
<?php
require("config/settings.inc");
require("config/mysqlconnection.inc");


if ($editorspicks == yes AND ($side_only_page == no OR $_GET['blog'] == yes)) {
echo "<div id=\"sidepicks\"><h2>Editors Picks</h2>";

$result = mysql_query("SELECT * FROM myblog_posts WHERE editor = '1'") or die(mysql_error());

while($row = mysql_fetch_array( $result )) {
echo "<a href=\"post.php?id=" . $row['title'] . "\">" . $row['title'] . "</a><br />";
}
echo "</div>";
}

else {
}
?>

<?php
require("config/settings.inc");
require("config/mysqlconnection.inc");

if ($memberlist == yes AND ($side_only_page == no OR $_GET['blog'] == yes)) {
echo "<div id=\"sidemembers\"><h2>Member list</h2>"; 
$result = mysql_query("SELECT * FROM myblog_users ORDER BY kudos DESC") or die(mysql_error());
if ($allowkudos == yes) {
echo "<table><tr><td><b>Username</b></td><td><b>Kudos</b></td><td><b>Group</b></tr>";
}

else {
echo "<table><tr><td><b>Username</b></td><td><b>Group</b></tr>";
}

while($row = mysql_fetch_array( $result )) {
echo "<tr><td><a href=\"member.php?id=" . $row['user'] . "\">" . $row['user'] . "</a></td>";

if ($allowkudos == yes ) {
echo "<td>" . $row['kudos'] . "</td><td>";
}
else {
echo "<td>";
}

if ($row['perm'] == 1 AND $row['super'] == no) {
echo "<b>Admin</b>";
}

elseif ($row['perm'] == 0 AND $row['super'] == no) {
echo "User";
}

elseif ($row['perm'] == 2 AND $row['super'] == no) {
echo "Poster";
}

else {
echo "<em>Super Admin</em>";
}   

echo "</td></tr>";
}
echo "</table></div>";
}
else {
}
?>
<?php
require("config/settings.inc");
if ($side_only_page == no OR $_GET['blog'] == yes) {
echo "<div id=\"sideplugins\">";
require("plugins/plugins.inc");
require("config/pluginconfig5.inc");
echo "</div>";
}
?>


</div>
Return current item: MyBlog: PHP and MySQL Blog/CMS software