I had found out that we can add announcements from SQL, so not being able to use the built in CMS shouldn't be a problem. I had tested, I can comment on the announcement, the comment system works fine. Problem is, it isn't showing at our main page.
here's the announcement http://www.revived-r...ion=page&post=1
While the main page is http://www.revived-r...in&action=index
The above is how it should've been shown at the main page, with up to 5 announcements visible.
Below is the code for that part
<?php
/*mySQL connection to retrieve data from 'post' table*/
mysql_connect($host,$username,$password);
@mysql_select_db($database) or die("Unable to select database");
$result=mysql_query("SELECT * FROM cp_posts ORDER BY ID DESC");
$num=mysql_numrows($result);
if($num>7){$num=7;}
$ctr=0;
while($ctr<$num) {
$id=mysql_result($result,$ctr,"ID");
$author=mysql_result($result,$ctr,"post_author");
$title=mysql_result($result,$ctr,"post_title");
$content=mysql_result($result,$ctr,"post_content");
$timestamp=mysql_result($result,$ctr,"post_date");
$type=mysql_result($result,$ctr,"post_type");
$comment=mysql_result($result,$ctr,"comment_count");
//color coding for text
if($type == "news")
$color = "#d29665";
else if($type =="event")
$color = "#9fc9ce";
else if($type =="update")
$color = "#b2cfa0";
/*
Following code used to display a specific post.
$result=mysql_query("SELECT * FROM cp_posts WHERE ID='$post'");
while ($row = mysql_fetch_assoc($result)) {
$author=$row["post_author"];
$title=$row["post_title"];
$content=$row["post_content"];
$timestamp=$row["post_date"];
$type=$row["post_type"];
$comment=$row["comment_count"];
}
mysql_close();
*/
?>
Is there something wrong with the codes?