Firefox PHP

Announcement links

Posted by sebross 
Announcement links
January 15, 2006 12:18PM
Hi,

I've made a script that collects information from the MySQL database and shows a list of the 10 latest posts on my front page.

But I can't figure out how to make it work with announcements. Because when I create one, the link to it from the front page only links to the forum index.

Any ideas on what can be done?

Here's my script:

<?PHP
//connects to database
$connection = @mysql_connect("HOST", "USERNAME", "PASSWORD") or die("Could not connect to database.");
print("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
//Select database
mysql_select_db('DATABASE');

$setning = @mysql_query("SELECT * FROM debattforum_messages ORDER BY datestamp DESC LIMIT 0,5");

while($debattforum = @mysql_fetch_array($setning))
{

print("<tr><td>&nbsp;Da</td><td><a href=\"/debattforum/read.php?$debattforum[forum_id],$debattforum[thread],$debattforum[message_id]#msg-$debattforum[message_id]\">$debattforum[subject]</a></td>");
print("<tr><td>&nbsp;</td><td>$debattforum[author]</td></tr>");
}
print("</table>");
?>

Sincerely,
sebross



Edited 1 time(s). Last edit at 01/15/2006 02:40PM by sebross.
Re: Announcement links
January 15, 2006 02:52PM
nice, you replace your whole post with a completely different question.

you need to link to one given forum for announcements as those have forum_id 0 which will not show any forum.


Thomas Seifert
Phorum Development Team / Mysnip-Solutions.de
Custom Phorum and general software development
worry-free Phorum Hosting
Sorry, only registered users may post in this forum.

Click here to login