I think you want a Content Management System(CMS). Try Mambo or Joomla .
vishesh
Nearly a Posting Virtuoso
1,381 posts since Oct 2006
Reputation Points: 85
Solved Threads: 42
Are these posts online already? Do you want to archive in the 'store away from view' sense, in the 'backup' sense or do you just need a blog like WordPress or CMS like Joomla?
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080
Simply place a 'status' (tinyint, length = 1, default = 0) field at the end of the table.
You can have two or more values, e.g.
0 means current (so all posts are current by default)
1 means archived (so not shown by default but available through "archives page"
2 means inactive - these posts, although you don't want to delete them, will not be available for Joe Public to see.
For 'archived':
"SELECT * FROM posts WHERE status = 1 ORDER BY post_time DESC"
For 'current'
"SELECT * FROM posts WHERE status = 0 ORDER BY post_time DESC"
For all viewable:
"SELECT * FROM posts WHERE status <> 2 ORDER BY post_time DESC"
$r = mysql_query("SELECT * FROM posts WHERE status = 1 ORDER BY post_time DESC");
if($mysql_num_rows > 0){
$output = "";
while($d= mysql_fetch_array($r)){
$output .="\n<h3 class=\"posttitle\">" . stripslashes($d['title']) . "</h3>";
$output .="\n<p class=\"author\">by " . stripslashes($d['author']) . " on " . stripslashes($d['post_time']) . "</p>";
$output .="\n<div class=\"abstract\">" . stripslashes($d['post_abstract']) . "</div>";
$output .="\n<p class=\"readmore\"><a href=\"mainarticle.php?id={$d['id']}\">Read more...</a></p>";
}
}else{
$output = "Sorry no posts available";
}
...rest of page...
echo $output;
...rest of page...
That's just my prototype take on producing a list of posts with abstracts - similar to a news feed. The link at the bottom of each feed then takes you to the main article in full (via the 'id' querystring parameter). You just pick that up in the next page with the $_GET['id'] whatsit.
Hope that's what you were looking for. It's not tested and required some work for a production site.
diafol
Rhod Gilbert Fan (ardav)
7,792 posts since Oct 2006
Reputation Points: 1,170
Solved Threads: 1,080