Home      Products & Services      Contact Us      Links

WebHatchers will design & develop your site for you.

Website Menu Heaven: menus, buttons, etc.

Send us your questions.

site search by freefind

SEO, Google, Privacy
   and Anonymity
Browser Insanity
Popups and Tooltips
Free Website Search
HTML Form Creator
Buttons and Menus
Image Uploading
Website Poll
IM and Texting
   or Not MySQL
Personal Status Boards
Content Management
Article Content
   Management Systems
Website Directory
   CMS Systems
Photo Gallery CMS
Forum CMS
Blog CMS
Customer Records
   Management CMS
Address Book CMS
Private Messaging CMS
Chat Room CMS
JavaScript Charts
   and Graphs

Free Personal Status Boards (PSB™)

Free Standard Free PSB

Free PSB Pro Version

Free Social PSB

Free Social PSB Plus (with Email)

Free Business PSB

Free Business PSB Plus (with Email)

PSB demo

Social PSB demo

Business PSB demo

So what's all this PSB stuff about?

Chart comparing business status boards

PSB hosting diagram

PSB Licence Agreement

Copyright © 2002 -
MCS Investments, Inc. sitemap

PSBs, social networking, social evolution, microcommunities, personal status boards
PSBs, social networking, business personal status boards
website design, ecommerce solutions
website menus, buttons, image rotators
Ez-Architect, home design software
the magic carpet and the cement wall, children's adventure book
the squirrel valley railroad, model railroad videos, model train dvds
the deep rock railroad, model railroad videos, model train dvds

PHP Code for Small Blog Home Page

Content Management Systems—Small Blog

Blog is another word for weblog. A weblog is a website that is like a diary or journal. Bloggers often write about their opinions and thoughts. What bloggers write is called posts, which are blocks of writing on the blog. Posts often include links to other websites, and often images and even videos as well. Blogs can have many writers. If they have more than one writer, they are often called community blogs, team blogs, or group blogs. But more and more blogs let any visitors leave comments in an interactive format. Signing up and logging in is often required for this privilege. This interaction with visitors is an important part of many blogs.

Forums always have lots of writers plus an administrator and they're about a specific area of interest and visitors get to post rather than just comment on others' posts, whereas blogs are written by one or a few people and they're more about this person or group's opinions and visitors comments on these opinions. Both forums and blogs can have categories—especially larger ones. Forums can have Q and A, but blogs rarely do.

Blog posts are commonly displayed in reverse-chronological order—i.e., from latest to earliest. Blog comments are posts in which a person says what they think about the blog post. Such comments can be considered posts, replies, or comments. Blogs are good for discussions — if someone writes something that someone else disagrees with, they can fix it by writing a comment on the blog. Someone else cannot change what the post says, but the writer of the post can. Sometimes only the blog owner can change or delete posts or comments, while visitors can simply read the blog and leave comments.

Often people create RSS feeds to their blogs. Programs called content aggregators or news readers can put postings from all the blogs that a person likes (that have RSS feeds) in one convenient place. Many people find it easier to read all the new posts from blogs in one place, through RSS, instead of going to each site one at a time. This saves a lot of time!

Blogs, like forums, are great communication tools for the exchange of ideas, for people teaching others about a specific area of interest, or even for just general social communication. The fact that they are usually so specialized helps get them high up in search results as well as contributing considerably to bodies of knowledge, although forums and news groups usually do this better than blogs, which are often more like diaries than information sources. True, there's a lot of misinformation and putdowns on both, but this invariably occurs when people communicate. One must learn to take what one learns with a grain of salt.

A forum, also know as a message board, is an online discussion site where people can converse, argue, inform, teach, or bitch in the form of posted messages. Chat rooms deliver messages in real-time but with forums and blogs, getting new messages requires the page to be reloaded (F5). Forums call a single conversation a thread. Blogs simply have posts and comments. Even though on either blogs or forums users have to login to post messages, usually they don't have to login to read the existing messages.

Download the files: cms-blog.zip but replace the cms-blog.php file with the code below (name it cms-blog.php), but only if you have decided you do not want the blog home page to ever display the 10 most recent complete topics, but instead wish it to initially display titles only and only display complete topics if you click on a category in the sidebar, in which case all the topics in that category will be displayed in their entirety. The titles-only feature is available in all 3 blog scripts (regular, small, and tiny), the categories sidebar is available in only this small blog script (on this page) and the regular blog script, and the displaying of the 10 most recent complete topics is only available in the regular blog script. Links to the code for these alternative blog home pages are below.

Content Management System: Blogs

The blog home page whose code is on this web page has a sidebar with the complete list of categories. Any of these can be clicked and all the topics in that category will be displayed in their entirety—which can even include images, links, email links, audio buttons, or videos. The sidebar also has a link, TITLES ONLY, which brings up all topics' titles and each topic is a link to the blog topic and replies viewing page. This TITLES ONLY feature also displays in a table each topic's Category, how many replies it's had, how many views it's had, and the date and time of its creation. Depending on which topic link is clicked, its corresponding id will be sent via query string (along with the username) to the blog topic and replies viewing page and only this topic and its replies will be visible on this viewing page. For other topics, you must return to the blog home page from a Return to Blog link on the blog topic and replies viewing page.

On to the PHP code. As usual, we start with config.php, since without it, the MySQL-based blog would not be viable. You cannot relate to a db without knowing the magic words. Next, the security of the page is dealt with by ensuring the page visitor has a username that's in the database. Note that the various pages on our blog app use both forms and URL query strings to transfer data between pages, so both POST and GET are checked for username, and if neither works, the visitor is sent to the login script. Not only is the db checked for a valid username, the username is checked to make sure it has only 6 to 20 letters, numbers or underscore in it and no other characters—otherwise, it's off to the login script. If a hacker has put something nasty in the query string, he'll end up at the login script. All our blog app scripts have this same (almost) username checker at the top of the PHP section—except for the login script. We say "almost" because most pages only allow the administrator access because most pages are about adding, deleting, or editing topics, replies, or categories. So, seeing if the username is the administrator's is in the user checker on most of these blog app pages.

Speaking of seeing if the username is the administrator's, we do that next because the page's links will differ depending on who the user is that's currently using the blog. Regular visitors will not be able to even see the links Create New Topic or Edit Categories or Delete Topic or Open/Close Topic or Edit Topic, for instance, but the administrator will. The regular users will be able to see a Replies link which will transport him or her to the glories and wonders of the blog's topic and replies viewing page where s/he can read topics or add replies (comments). In addition to being able to see and use a Replies link, regular users will also see the titles links, which will also take them to the topic and replies viewing page. if($U<>"DIRTY_dog_DROPPINGS_"){$am_i_admin="cms-view-blog-topic.php";$thelinktext=""; is our way of coding "if you aren't the administrator we will make the links disappear." The administrator's username is a bit silly, as you see. Feel free to change it (to AfDqC_1f3_DkI3j5k9N_ for example) when you register the administrator username and password, but you must search and replace ALL blog app pages for our silly name and replace it with your not-as-silly name or you'll have more problems than a pregnant nun. Anyway, in that code you can see that the link is of no consequence because the link text that will be for clicking on is an empty string so the user will see nothing. Note that in the script below the admin person gets good links with good query strings in them so username and topic id will be passed to that blog app.

Next comes the blog tables. This script creates them if they do not exist. We'll need a topic table, blog_question, with fields: id, topic (which is the title), detail (which is the main content), name, email, datetime, category, open (the topics' open/closed flag), topics_username, view (which is the number of views of the page), and reply (which is the number of replies to the page). We'll also need a replies table, blog_answer, with fields: id, question_id, a_id, a_name, a_email, a_answer (which is the main content of the reply), and a_datetime. The blogcategories table's categories field is consulted and its contents dumped into an array which will be used to populate the categories sidebar—as you will see.

Then the $mode flag is checked and if it is not set, it gets a minus 1 which signifies the TITLES-ONLY display mode. If a category has been clicked in the sidebar, $mode is any number from zero to however many categories there are. The following will then be the way the db is queried for all topics with a chosen category: SELECT * FROM blog_question WHERE category='$cat[$mode]'. You can see why we stuck all the categories into an array in order to empower the $mode flag to point out which array element we want.

Moving on, htmlentities() and stripslashes() are used to provides display security on this page—just in case the data has somehow gotten compromised.

You're allowed to have bold, underscore, italics, links, email links, pictures, videos, and audios in either topics or replies. The only limitation is that you must use our tag system when typing in new topics and/or replies, which isn't dealt with on this home page. But topics are displayed on this page when you click on one of the categories in the sidebar. This will bring up all the topics in that category, displaying them in their entirety, including any bold, underscore, italics, links, email links, pictures, videos, and audios in those topics. And here are the custom tags you will use:

No single or double quotes or Enter/Return allowed in topic titles. Use letters, numbers, spaces and these: , . ) ? : ( ; _ - ! / in title and content. In content only, you may use single or double quotes or Enter/Return. Use Returns for new paragraphs. For italics, starting and ending tags are (i-) and (ii-). For bold, use (b-) and (bb-). Underline is (u-) and (uu-). For links, use (l-) then domain without http://, then (ll-) then link text, then (lll-). For emails, use (e-) then email address with (ee-) instead of @, then (eee-) then subject, then (eeee-) then link text, then (eeeee-).

For pictures, use (p-) as start tag, then the complete picture URL with .jpg or .png or .gif or .bmp extension, then (pp-) as end tag. If the picture somehow is on the blog server near the blog folder but is in a higher level folder than the subfolder your Content Management System is in, put 2 dots before the name and just make sure you use the picture name only, not a URL path, for this special case. If it's in a subfolder like "images", then move it to the higher level folder or the subfolder your Content Management System is in. If the image is wider than 580 pixels, resave it to 580.

For YouTube video, use (v-) as start tag, then the letter code after http://www.youtube.com/v/ and before &hl=en_US&fs=1& in your video's YouTube Embed code, then (vv-), then the same letter code again, then (vvv-) as end tag. If the video you want to use is not on YouTube, upload it there before proceeding.

For audio, use (a-) as start tag, then the sound's name, then (aa-), then the complete sound file URL ending in .mp3 or .wav, then (aaa-) as end tag. Make sure the site administrator has put the sound.js file in the folder your blog Content Management System is in, and do not try to put this JavaScript on the web page—it needs to be a separate file. Save the following code (exactly, without adding script tags or anything else!) as sound.js: function sound(s,q) {document.getElementById(q).innerHTML="<embed src='"+s+"' hidden=true autostart=true loop=false>"}

At the conclusion of the first section of the script about custom tags, there is more username checking to see whether to make certain links visible or not, based upon whether you are the administrator or not. Note that the email is either displayed or not depending on the same username checking. <td><b>Email :</b> <? if($U=="DIRTY_dog_DROPPINGS_"){echo htmlentities(stripslashes($rows['email']), ENT_QUOTES);}else{echo "(private)";} ?></td> makes sure "(private)" is displayed if they're anyone but the administrator. Then <td><b>Topic is: </b><? $open="Open";if($rows['open']=="0"){$open="Closed";}; echo $open; ?></td> helps to display whether the topic is open to new replies or not or closed. The code block with all the nonbreaking spaces in it has a Replies link at the end that is for everyone—no attempt to make the link invisible is made.

The code now deals with the TITLES ONLY script where the $mode flag is minus 1. Note that the displaying code is quite usual until we hit the title link. Here the link with the username and id is in the link's query string, but then the link text that you click on is the topic title field from the blog_question table. The db is supplying everything we need, in this example. At the bottom of this page are the links for Delete Account and Search Blog both of which are for anyone to use, but also 2 admin-only links: Create New Topic and Edit Categories whose strings are defined at the beginning of the first PHP code section.

The next script section starts with merely }else{, but it's for when the $mode is not -1, but simply 0 or above. The $mode flag will be the array element number of the chosen category, since that is what this section does: show all the topics in a category.

At the bottom of the script is the category sidebar code. It simply takes the category array, looping through it and turning each array value into a link that sends the zero and above $mode flag to this page via a page reload and a query string. Note that if they click on the TITLES ONLY link a -1 is sent to the page's $mode value.

SAVE THIS PAGE AS: cms-blog.php

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<TITLE>Blog—Content Management System (CMS)</TITLE>
<meta name="description" content="Blog—Content Management System (CMS)">
<meta name="keywords" content="Blogs,Blog,Content Management System,Content Management System Articles,php,CMS,javascript, dhtml, DHTML">
<style type="text/css">
BODY {margin-left:0; margin-right:0; margin-top:0;text-align:left;background-color:#ddd}
p, li {font:13px Verdana; color:black;text-align:left}
h1 {font:bold 28px Verdana; color:black;text-align:center}
h2 {font:bold 24px Verdana;text-align:center}
td {font:normal 13px Verdana;text-align:center;background-color:#ccc}
table.over td {text-align:left}
.topic {text-align:left;background-color:#fff}
.center {text-align:center;}
.cat {position:absolute;top:40px;left:2px;width:180px;border:2px solid black;background-color:#ccc;font:normal 13px Verdana;text-align:center;}
.blog {position:absolute;top:40px;left:197px;width:800px;border:1px solid black}
.over {margin-left:230px}
.mid {text-align:center;background-color:#bbb}
<script language="javascript">
mactest=(navigator.userAgent.indexOf("Mac")!=-1) //My browser sniffers
is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1
Netscape=(navigator.appName.indexOf("Netscape") != -1)
msafari=(navigator.userAgent.indexOf("Safari")!= -1)
wsafari=0; if(!mactest&&msafari){wsafari=1;msafari=0}
is_opera = 0; if(window.opera){is_opera=1}
is_ie_mac = 0; is_ie=0;if(document.all){is_ie=1}

function fixem(){if(Netscape||is_opera){e=document.getElementById('ti');e.style.marginTop='-15px';}}

<body onload='fixem()'>

$U=$_POST['username'];if (!isset($U)){$U=$_GET['username'];}
if (isset($U)&&preg_match("/[A-Za-z0-9_]{6,20}$/",$U)){$check_user_data = mysql_query("SELECT * FROM blogmembers WHERE username='$U'") or die(mysql_error());if(mysql_num_rows($check_user_data)==0){unset($U);}}else{unset($U);}
if (!isset($U)){echo '<script language="javascript">alert("Please login.");window.location="blog-login.php"; </script>';}

if($U<>"DIRTY_dog_DROPPINGS_"){$am_i_admin="cms-blog.php";$thelinktext="";$am_i_admin2="cms-blog.php";$thelinktext2="";}else{$thelinktext="Create New Topic";$am_i_admin="cms-create-blog-topic.php?username=".$U;$thelinktext2="Edit Categories";$am_i_admin2="cms-blog-edit-category.php?username=".$U;}

$sql = "CREATE TABLE IF NOT EXISTS blog_question (
id int(4) NOT NULL auto_increment,
topic varchar(255) NOT NULL default '',
detail text NOT NULL,
name varchar(65) NOT NULL default '',
email varchar(65) NOT NULL default '',
datetime varchar(25) NOT NULL default '',
category varchar(30) NOT NULL default '',
open tinyint(1) NOT NULL default '1',
topics_username varchar(20) NOT NULL,
view int(4) NOT NULL default '0',
reply int(4) NOT NULL default '0',


$sql = "CREATE TABLE IF NOT EXISTS blog_answer (
id int(4) NOT NULL auto_increment,
question_id int(4) NOT NULL default '0',
a_id int(4) NOT NULL default '0',
a_name varchar(65) NOT NULL default '',
a_email varchar(65) NOT NULL default '',
a_answer text NOT NULL,
a_datetime varchar(25) NOT NULL default '',



$res = mysql_query("SELECT category FROM blogcategories order by category") or die(mysql_error());
while ($row = mysql_fetch_row($res)) {
array_push ($cat, $row[0]);




$sql="SELECT id,topic,category,view,reply,datetime FROM $tbl_name ORDER BY id DESC";
<center><div id='ti'><h2>My Blog</h2></div></center>
<div class='blog'><table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCC">
<td width="5%"><B>#</B></td>
<td width="51%"><B>Topic</B></td>
<td width="16%"><B>Category</B></td>
<td width="6%"><B>Views</B></td>
<td width="6%"><B>Replies</B></td>
<td width="16%"><B>Date/Time</B></td>

<td><? echo htmlentities(stripslashes($rows['id']), ENT_QUOTES); ?></td>
<td class='topic'><a href="cms-view-blog-topic.php?id=<? echo htmlentities(stripslashes($rows['id']), ENT_QUOTES); ?>&username=<? echo stripslashes($U); ?>"><? echo htmlentities(stripslashes($rows['topic']), ENT_QUOTES); ?></a><BR></td>
<td><? echo htmlentities(stripslashes($rows['category']), ENT_QUOTES); ?></td>
<td><? echo htmlentities(stripslashes($rows['view']), ENT_QUOTES); ?></td>
<td><? echo htmlentities(stripslashes($rows['reply']), ENT_QUOTES); ?></td>
<td><? echo htmlentities(stripslashes($rows['datetime']), ENT_QUOTES); ?></td>

<td class='center' colspan="6"><a href="<? echo $am_i_admin2; ?>"><B><? echo $thelinktext2; ?></B></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="<? echo $am_i_admin; ?>"><B><? echo $thelinktext; ?></B></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="cms-search-blog.php?username=<? echo stripslashes($U); ?>";><B>Search Blog</B></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="cms-delete-blog-account.php?username=<? echo stripslashes($U); ?>";><B>Delete Account</B></a></td>

$res = mysql_query("SELECT * FROM blog_question WHERE category='$cat[$mode]' ORDER BY id DESC") or die(mysql_error());
<table id='over' class='over' width="700" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCC">
<td><table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFF">
<tr><td class='mid'><b>Topic</b></td></tr>
<td><b><? echo htmlentities(stripslashes($rows['topic']), ENT_QUOTES); ?></b></td>
$detail=htmlentities(stripslashes($detail), ENT_QUOTES);
$detail=nl2br($detail); //Enter turns into <BR />
$pattern = '/(<BR\s\/>)+/i';
$replacement = '</p><p>'; //turn any <BR />s into a </p><p> to allow indent since <p>s are css styled to indent!
$detail=preg_replace($pattern, $replacement, $detail);
$pattern = '/\(i-\)/i';
$replacement = '<i>'; //turn any (i-)s into a <i>s to allow italics
$detail=preg_replace($pattern, $replacement, $detail);
$pattern = '/\(ii-\)/i';
$replacement = '</i>'; //turn any (ii-)s into a </i>s to allow italics
$detail=preg_replace($pattern, $replacement, $detail);
$pattern = '/\(b-\)/i';
$replacement = '<b>'; //turn any (b-)s into a <b>s to allow bold
$detail=preg_replace($pattern, $replacement, $detail);
$pattern = '/\(bb-\)/i';
$replacement = '</b>'; //turn any (bb-)s into a </b>s to allow bold
$detail=preg_replace($pattern, $replacement, $detail);
$pattern = '/\(u-\)/i';
$replacement = '<u>'; //turn any (u-)s into a <u>s to allow underline
$detail=preg_replace($pattern, $replacement, $detail);
$pattern = '/\(uu-\)/i';
$replacement = '</u>'; //turn any (uu-)s into a </u>s to allow underline
$detail=preg_replace($pattern, $replacement, $detail);
$pattern = '/\(p-\)\.\./i';
$replacement = '<center><br><IMG SRC="../'; //turn any (p-)s into start of image tag to allow image
$detail=preg_replace($pattern, $replacement, $detail);
$pattern = '/\(p-\)/i';
$replacement = '<center><br><IMG SRC="'; //turn any (p-)s into start of image tag to allow image
$detail=preg_replace($pattern, $replacement, $detail);
$pattern = '/\(pp-\)/i';
$replacement = '" BORDER=0><br><br></center>'; //turn any (pp-)s into end of image tag to allow image
$detail=preg_replace($pattern, $replacement, $detail);
$pattern = '/\(l-\)/i';
$replacement = '<a href="http://'; //turn any (l-)s into <http:// to allow link protocol
$detail=preg_replace($pattern, $replacement, $detail);
$pattern = '/\(ll-\)/i';
$replacement = '">'; //turn any (ll-)s into "> to allow url
$detail=preg_replace($pattern, $replacement, $detail);
$pattern = '/\(lll-\)/i';
$replacement = '</a>'; //turn any (lll-)s into </a> to link text
$detail=preg_replace($pattern, $replacement, $detail);
$pattern = '/\(e-\)/i';
$replacement = '<a href="mailto:'; //turn any (e-)s into <a href="mailto: to allow link protocol
$detail=preg_replace($pattern, $replacement, $detail);
$pattern = '/\(ee-\)/i';
$replacement = '@'; //turn any (ee-)s into @ to allow email @ sign
$detail=preg_replace($pattern, $replacement, $detail);
$pattern = '/\(eee-\)/i';
$replacement = '?subject='; //turn any (eee-)s into ?subject= to allow email subject
$detail=preg_replace($pattern, $replacement, $detail);
$pattern = '/\(eeee-\)/i';
$replacement = '">'; //turn any (eeee-)s into "> to allow email address
$detail=preg_replace($pattern, $replacement, $detail);
$pattern = '/\(eeeee-\)/i';
$replacement = '</a>'; //turn any (eeeee-)s into </a> to allow link text
$detail=preg_replace($pattern, $replacement, $detail);
$pattern = '/\(v-\)/i';
$replacement = '<div style="width:580px"><br><center><object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/'; //turn any (v-)s into start of video tag
$detail=preg_replace($pattern, $replacement, $detail);
$pattern = '/\(vv-\)/i';
$replacement = '&hl=en_US&fs=1&"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/'; //middle of video tag
$detail=preg_replace($pattern, $replacement, $detail);
$pattern = '/\(vvv-\)/i';
$replacement = '&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object><br><br></center></div>'; //end of video tag
$detail=preg_replace($pattern, $replacement, $detail);
$pattern = '/\(a-\)/i';
$replacement = '<div style="width:580px"><br><center><script src="sound.js"></script><span id="a1"></span><form><input type="button" value="'; //turn any (a-)s into start of audio tag
$detail=preg_replace($pattern, $replacement, $detail);
$pattern = '/\(aa-\)/i';
$replacement = '" onClick="sound(\''; //middle of audio tag
$detail=preg_replace($pattern, $replacement, $detail);
$pattern = '/\(aaa-\)/i';
$replacement = '\',\'a1\')"></form><br><br></center></div>'; //end of audio tag
$detail=preg_replace($pattern, $replacement, $detail);
echo $detail;

$thelinktext="Delete Topic";$am_i_admin="cms-delete-blog-topic.php?username=".stripslashes($U)."&id=".$id;
$thelinktext3="Open/Close Topic";$am_i_admin3="cms-open-or-close-blog-topic.php?username=".stripslashes($U)."&id=".$id;
$thelinktext2="Edit Topic";$am_i_admin2="cms-edit-blog-topic.php?username=".stripslashes($U)."&id=".$id;}

<td><b>Category:</b> <? echo htmlentities(stripslashes($rows['category']), ENT_QUOTES); ?></td>
<td><b>By :</b> <? echo htmlentities(stripslashes($rows['name']), ENT_QUOTES); ?></td>
<td><b>Email :</b> <? if($U=="DIRTY_dog_DROPPINGS_"){echo htmlentities(stripslashes($rows['email']), ENT_QUOTES);}else{echo "(private)";} ?></td>
<td><b>Date/time : </b><? echo htmlentities(stripslashes($rows['datetime']), ENT_QUOTES); ?></td>
<td><b>Topic is: </b><? $open="Open";if($rows['open']=="0"){$open="Closed";}; echo $open; ?></td>
<tr><td class='mid' colspan=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;<a href="<? echo $am_i_admin2; ?>"><B>
<? echo $thelinktext2; ?></B></a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="<? echo $am_i_admin; ?>"><B><? echo $thelinktext; ?></B></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="<? echo $am_i_admin3; ?>"><B><? echo $thelinktext3; ?></B></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="cms-blog.php?username=<? echo stripslashes($U); ?>"><B>Return to Blog</B></a></td></tr>


<div align=center class='cat'><center>
echo "<table style='border:none;width:100%'><TR><TD style='border:1px solid black;background-color:#aaa;text-align:center;width:100%'><B>Categories</B></TD></TR>";
for ($i=0;$i<$num_cats_in_table;$i++) {echo "<tr><td style='text-align:center;width:100%'><a href='cms-blog.php?username=".stripslashes($U)."&mode=".$i."'>".$cat[$i]."</a></td></tr>";}
echo "<TR><TD>&nbsp;</TD></TR><TR><TD><a href='cms-blog.php?username=".stripslashes($U)."&mode=-1'>TITLES ONLY</a></TD></TR></table>";