Ok, her er koden til filen index.php :
<?php
if ($lstvst == \"\") {
$lstvst = \"10000\";
}
//########################################
// SET COOKIE FOR LAST VISIT
//########################################
if ($expand == \"1\") {
$lastvisit = date(YmdHis);
setcookie(\"lstvst\",$lastvisit,time()+1166832000);
}
//########################################
// END SET COOKIE FOR LAST VISIT
//########################################
?>
<html>
<title>Kim Bodnia - Debatforum</title>
<?php
include (\"config.php\");
echo \"<center>\";
echo \"<table width=806 border=0 bgcolor=$general cellspacing=0 cellpadding=1><tr><td>\";
echo \"<center>\";
echo \"<IMG NAME=myphpbrd0 SRC=images/myphpbrd.jpg WIDTH=631 HEIGHT=85 BORDER=0 USEMAP=\\\"#myphpbrd\\\">\";
echo \"<MAP NAME=myphpbrd>\";
echo \"<AREA SHAPE=circle COORDS=57,25,4 HREF=\\\"
http://wmf.eyep.net\\\">\";echo \"</MAP>\";
echo \"</center>\";
echo \"</td></tr>\";
echo \"<tr>\";
echo \"<td bgcolor=ffffff><table width=100% cellspacing=1 cellpadding=0><tr>\";
echo \"<td bgcolor=$general width=20%><a href=index.php><img src=icons/icon10.gif border=0>START</a></td>\";
echo \"<td bgcolor=$general width=20%><a href=index.php><img src=icons/icon10.gif border=0>INDHOLD</a></td>\";
echo \"<td bgcolor=$general width=20%><a href=../MyPHPBoard-0.8a.tar.gz><img src=icons/icon10.gif border=0>DOWNLOAD</a></td>\";
echo \"<td bgcolor=$general width=20%><a href=index.php?show=about><img src=icons/icon10.gif border=0>ABOUT</a></td>\";
echo \"<td bgcolor=$general width=20%><a href=boardadmin/index.php><img src=icons/icon10.gif border=0>ADMIN PAGE</a></td>\";
echo \"</tr></table>\";
echo \"</td></tr></table>\";
echo \"</center>\";
echo \"<body bgcolor=$bgcolor text=$text link=$link vlink=$vlink>\";
//##################################################
//SHOW ALL OF THE DISCUSSION GROUPS AVAILABLE
//##################################################
if ($show == \"\") {
echo \"<center>\";
echo \"<table><tr><td></td></tr></table>\";
echo \"<TABLE width=806 border=\\\"0\\\" cellpadding=\\\"0\\\" cellspacing=\\\"0\\\" bgcolor=$general>\";
echo \"<TD>\";
echo \" <TABLE width=100% cellpadding=1 cellspacing=1 BORDER=\\\"0\\\">\";
echo \"<table bgcolor=$general width=806 valign=top border=0><tr><td bgcolor=$replybg>\";
echo \"<font color=$replytext><b>Her kan du skrive dine spørgsmål til Kim Bodnia, og han vil besvare
dem hver uge.</b></font>\";
echo \"</td>\";
echo \"<td bgcolor=$replybg width=10%><font color=$replytext><b>Indlæg</b></font></td>\";
echo \"<td bgcolor=$replybg width=5%><font color=$replytext><b>Nye</b></font></td>\";
echo \" </TABLE>\";
echo \"</tr></table>\";
echo \"</TD></TABLE>\";
echo \"<table cellspacing=0 cellpadding=0><tr><td></td></tr></table>\";
mysql_connect ($dbhost, $username, $password);
mysql_select_db ($database);
$result = mysql_query (\"SHOW TABLES;\");
while($value = mysql_fetch_array($result))
{
for($i=0; $i< mysql_num_fields($result); $i++ )
{
echo \"<TABLE width=806 border=\\\"0\\\" cellpadding=\\\"0\\\" cellspacing=\\\"0\\\" bgcolor=000000>\";
echo \"<td>\";
echo \" <TABLE width=100% cellpadding=1 cellspacing=1 BORDER=\\\"0\\\"><tr><td bgcolor=$general>\";
print \"<a href=\\\"index.php?show=1&group=$value[$i]\\\"><b>$value[$i]</b></A>\";
echo \"</td>\";
echo \"<td bgcolor=$general width=10%>\";
//#####################################
// COUNT THE NUMBER OF POSTS
//#####################################
$result2 = mysql_query (\"select count(*) from $value[$i];\");
while($value2 = mysql_fetch_array($result2))
{
for($i=0; $i< mysql_num_fields($result2); $i++ )
{
echo \"$value2[$i]\";
//#####################################
// COUNT NEW MSGS
//#####################################
$result2 = mysql_query (\"select count(*) from $value[$i] where date >= $lstvst;\");
while($value2 = mysql_fetch_array($result2))
{
for($i=0; $i< mysql_num_fields($result2); $i++ )
{
if ($value2[$i] == \"0\") {
echo \"</td><td bgcolor=$general2 width=5%>$value2[$i]\";
} else {
echo \"</td><td bgcolor=$replybg width=5%><font color=$replytext><b>$value2[$i]</b></font>\";
}
}
}
//#####################################
// END COUNT NEW MSGS
//#####################################
}
}
//#####################################
//END COUNT NUMBER OF POSTS
//#####################################
echo \"</td>\";
echo \"</tr></table>\";
echo \"</td></tr></table>\";
}
}
mysql_free_result($result);
mysql_close();
echo \"</center>\";
}
//##################################################
//END SHOW DISSCUSION GROUPS AVALABLE
//##################################################
//##################################################
//SHOW MESSAGE TITLES
//##################################################
if ($show == \"1\") {
echo \"<center>\";
echo \"<table><tr><td></td></tr></table>\";
echo \"<table width=806 bgcolor=$general><tr>\";
if ($expand == \"1\") {
echo \"<td bgcolor=$replybg><a href=index.php?show=1&group=$group><font color=$replytext><img src=images/back.jpg align=center></a></td>\";
echo \"<td bgcolor=$replybg width=10%><a href=index.php?post=new&show=postnew&disgroup=$group><font color=$replytext><b>Nyt indlæg</a></td>\";
echo \"<td bgcolor=$replybg width=10%><a href=index.php?post=reply&show=postreply&disgroup=$group&id=$id><font color=$replytext><b>Svar</a></td>\";
} else {
echo \"<td bgcolor=$replybg><a href=index.php><font color=$replytext><img src=images/back.jpg align=center></a></td>\";
echo \"<td bgcolor=$replybg width=10%><a href=index.php?post=new&show=postnew&disgroup=$group><font color=$replytext><b>Nyt Indlæg</a></td>\";
echo \"<td bgcolor=$replybg width=7%><font color=$replytext><b>Svar</a></td>\";
echo \"<td bgcolor=$replybg width=5%><font color=$replytext><b>Nye</a></td>\";
}
echo \"</tr></table>\";
mysql_connect ($dbhost, $username, $password);
mysql_select_db ($database);
if ($expand == \"1\") {
$result = mysql_query (\"SELECT * FROM $group where id=$id or reply=$id order by id\");
} else {
$result = mysql_query (\"SELECT * FROM $group where reply=0 order by id desc\");
}
if ($row = mysql_fetch_array($result)) {
echo \"<table width=810 border=0>\";
do {
echo \"<tr><td bgcolor=$general>\";
$id = $row[\"id\"];
$name = $row[\"name\"];
$icon = $row[\"icon\"];
$msg = $row[\"msg\"];
$reply = $row[\"reply\"];
$title = $row[\"title\"];
$y = $row[\"date\"][0];
$e = $row[\"date\"][1];
$a = $row[\"date\"][2];
$r = $row[\"date\"][3];
$m = $row[\"date\"][4];
$o = $row[\"date\"][5];
$d = $row[\"date\"][6];
$ay = $row[\"date\"][7];
$h = $row[\"date\"][8];
$our = $row[\"date\"][9];
$mi = $row[\"date\"][10];
$n = $row[\"date\"][11];
echo \"<table width=100% border=0><tr><td width=45% bgcolor=$general2>\";
echo \"   <b>\";
echo \"<img src=icons/icon$icon.gif align=center>   \";
if ($expand == \"1\") {
print \"<a href=index.php?group=$group&id=&expand=0&show=1>$title</a>\";
echo \"</b></td><td width=20%>\";
print \"Af:<b>$name</b></td><td width=20%>   Dato <b>$m$o-$d$ay-$y$e$a$r $h$our:$mi$n</b></td><td>\";
} else {
print \"<a href=index.php?group=$group&id=$id&expand=1&show=1>$title</a>\";
echo \"</b></td><td width=20%>\";
print \"Af: <b>$name</b></td><td width=20%>  Dato <b>$m$o-$d$ay-$y$e$a$r $h$our:$mi$n</b></td>\";
$result2 = mysql_query (\"select count(*) from $group where reply=$id;\");
while($value2 = mysql_fetch_array($result2))
{
for($i=0; $i< mysql_num_fields($result2); $i++ )
{
echo \"<td bgcolor=$replybg width=7%><font color=$replytext><b><center>$value2[$i]</center></b></font>\";
//################################################
// COUNT NEW REPLY AND POST
//################################################
$result2 = mysql_query (\"select count(date) from $group where reply=$id and date >= $lstvst or id=$id and date >= $lstvst;\");
while($value2 = mysql_fetch_array($result2))
{
for($i=0; $i< mysql_num_fields($result2); $i++ )
{
if ($value2[$i] == \"0\") {
echo \"</td><td bgcolor=$general2 width=5%>$value2[$i]\";
} else {
echo \"</td><td bgcolor=$replybg width=5%><font color=$replytext><b>$value2[$i]</b></font>\";
}
}
}
//###############################################
// END COUNT NEW REPLY AND POST
//###############################################
}
}
}
echo \"</td></tr></table>\";
if ($expand == \"1\") {
echo \"<table width=804 bgcolor=$general><tr><td bgcolor=$general2>\";
echo \"$msg </td></tr></table>\";
}
} while($row = mysql_fetch_array($result));
} else {print \"<h3>Der er desværre ingen emner endnu</h3>\";
}
echo \"</td></tr></table>\";
echo \"</center>\";
}
//###################################################
//END SHOW MESSAGE TITLES
//###################################################
//###################################################
//POST MESSAGE FORM
//###################################################
if ($post == \"new\") {
echo \"<center>\";
echo \"<table><tr><td></td></tr></table>\";
echo \"<table bgcolor=$general width=806><tr>\";
echo \"<td bgcolor=$replybg width=10%><a href=index.php?show=1&group=$disgroup><font color=$replytext><b>Tilbage</a></td>\";
echo \"</tr></table>\";
echo \"<form name=newpost action=index.php method=post>\";
echo \"<table bgcolor=$general width=50%>\";
echo \"<tr><td>Navn</td><td><input type=text name=name size=15 maxlength=15></td></tr>\";
//echo \"<tr><td>Password</td><td><input type=text name=passwd></td></tr>\";
echo \"<tr><td>Emne</td><td><input type=text name=title size=45 maxlength=45 ></td></tr>\";
echo \"<tr><td>Spørgsmål</td><td><textarea type=text name=msg rows=8 cols=70 wrap=hard></textarea>\";
echo \"<br>Vælg et ikon </tr>\";
echo \"<tr><td> </td><td>\";
include (\"icons.html\");
echo \"</td></tr>\";
echo \"<input type=hidden name=show value=postit>\";
echo \"<input type=hidden name=expand value=1>\";
echo \"<input type=hidden name=reply value=0>\";
echo \"<input type=hidden name=disgroup value=$disgroup>\";
echo \"<tr><td> </td><td><input type=submit></form></td><td></td></tr>\";
echo \"</td></tr></table>\";
echo \"</center>\";
}
//##################################################
//END POST MESSAGE FORM
//##################################################
//###################################################
//REPLY MESSAGE FORM
//###################################################
if ($post == \"reply\") {
if ($id != \"\") {
mysql_connect ($dbhost, $username, $password);
mysql_select_db ($database);
$result2 = mysql_query (\"select * from $disgroup where id=$id\");
while($value2 = mysql_fetch_array($result2))
{
for($i=0; $i< mysql_num_fields($result2); $i++ )
{
$t = $value2[5];
}
}
echo \"<center>\";
echo \"<table><tr><td></td></tr></table>\";
echo \"<table bgcolor=$general width=806><tr>\";
echo \"<td bgcolor=$replybg width=10%><a href=index.php?show=1&group=$disgroup><font color=$replytext><b>Tilbage</a></td>\";
echo \"</tr></table>\";
echo \"<form name=newpost action=index.php method=post>\";
echo \"<table bgcolor=$general width=50%>\";
echo \"<tr><td>Navn</td><td><input type=text name=name maxlength=15></td></tr>\";
//echo \"<tr><td>Password</td><td><input type=text name=passwd></td></tr>\";
echo \"<tr><td>Emne</td><td><input type=text name=title size=45 maxlength=45 value=\\\"Svar: $t\\\"></td></tr>\";
echo \"<tr><td>Svar</td><td><textarea type=text name=msg rows=8 cols=70 wrap=hard></textarea><br>Vælg et ikon\";
echo \" </tr>\";
echo \"<tr><td> </td><td>\";
include (\"icons.html\");
echo \"</td></tr>\";
echo \"<input type=hidden name=show value=postit>\";
echo \"<input type=hidden name=expand value=1>\";
echo \"<input type=hidden name=reply value=$id>\";
echo \"<input type=hidden name=disgroup value=$disgroup>\";
echo \"<tr><td></td><td><input type=submit></td><td></td></tr>\";
echo \"</td></tr></table>\";
echo \"</center>\";
} else {
echo \"<center><table><tr><td></td></tr></table>\";
echo \"<table bgcolor=$general width=806><tr>\";
echo \"<td bgcolor=$replybg width=10%><a href=index.php?show=1&group=$disgroup><font color=$replytext><b>BACK</a></td>\";
echo \"</tr></table></center>\";
echo \"<center><b><br>You must select a message to reply to first</b></center>\";
}
}
//##################################################
//END REPLY MESSAGE FORM
//##################################################
//##################################################
//POST MESSAGE TO MySQL
//##################################################
if ($show == \"postit\") {
require (\"global.php\");
$pat = \"<.+>\";
$repl = \"<img src=icons/icon46.gif border=0>\";
$title2 = (ereg_replace($pat, $repl, $title));
$name2 = (ereg_replace($pat, $repl, $name));
$msg2 = htmlfilt($msg);
$msg3 = nl2br($msg2);
mysql_connect ($dbhost, $username, $password);
mysql_select_db ($database);
$result2 = mysql_query (\"select now()\");
while($value2 = mysql_fetch_array($result2))
{
for($i=0; $i< mysql_num_fields($result2); $i++ )
{
$now = \"$value2[$i]\";
}
}
mysql_query (\"insert into $disgroup values (\'\',\'$name2\',\'$icon\',\'$msg3\',\'$reply\',\'$title2\',\'$now\')\");
mysql_query (\"delete from $disgroup where name=\\\"\\\"\");
mysql_query (\"delete from $disgroup where title=\\\"\\\"\");
//SHOW PREVIEW
echo \"<center>\";
echo \"<table width=810 border=0><tr><td bgcolor=$general>\";
echo \"<table width=100%><tr>\";
echo \"<td width=70% bgcolor=$general2> <b><img src=icons/icon$icon.gif align=center>  \";
echo \"<a href=index.php?group=$disgroup&expand=0&show=1>$title2</a></b>\";
echo \"</td><td>Posted By: $name2</td></tr></table>\";
echo \"<table width=804 bgcolor=$general><tr><td bgcolor=$general2>$msg3 </td></tr></table>\";
echo \"</td></tr></table></center>\";
echo \"</center>\";
}
//#################################################
//END POST MESSAGE TO MySQL
//#################################################