tagwall.php (lidt gammel kode men det fungere)
------------
<?
if ($action == "tagwall") {
echo "
<table width=400 border=0 cellspacing=2 cellpadding=2 class=menu>
<tr>
<td><span class=normaltextfed><a href='$PHP_SELF?action=tagwall_write'>Skriv i tagwallen klik her</a> - <a href=# onClick=window.open('
http://amici.dk/smiley.php','Smiley','height=350,width=50')>Smiley code</a></span></td>
</tr>
</table><br>";
$pr_side = "5";
if (!isset($s)) {
$s = "0";
}
$query = mysql_query("select * from tagwall ORDER BY id DESC limit $s,$pr_side") or die(mysql_error());
while($tags = mysql_fetch_array($query)){
$tags[tekst] = htmlentities($tags[tekst]);
$tags[tekst] = str_replace(":)", "<img src='gfx/smiley/smiley1.gif'>", $tags[tekst]);
$tags[tekst] = str_replace(":D", "<img src='gfx/smiley/smiley2.gif'>", $tags[tekst]);
$tags[tekst] = str_replace(":(", "<img src='gfx/smiley/smiley3.gif'>", $tags[tekst]);
$tags[tekst] = str_replace(":p", "<img src='gfx/smiley/smiley4.gif'>", $tags[tekst]);
$tags[tekst] = str_replace(":/", "<img src='gfx/smiley/smiley5.gif'>", $tags[tekst]);
$tags[tekst] = str_replace(":|", "<img src='gfx/smiley/smiley7.gif'>", $tags[tekst]);
$tags[tekst] = str_replace(":x", "<img src='gfx/smiley/smiley9.gif'>", $tags[tekst]);
$tags[tekst] = str_replace("8|", "<img src='gfx/smiley/smiley10.gif'>", $tags[tekst]);
$tags[tekst] = str_replace("[ANGRY]", "<img src='gfx/smiley/smiley11.gif'>", $tags[tekst]);
$tags[tekst] = str_replace("8D", "<img src='gfx/smiley/smiley12.gif'>", $tags[tekst]);
$tags[tekst] = str_replace(";)", "<img src='gfx/smiley/smiley13.gif'>", $tags[tekst]);
$tags[tekst] = str_replace(":-(", "<img src='gfx/smiley/smiley14.gif'>", $tags[tekst]);
$tags[tekst] = str_replace(":'(", "<img src='gfx/smiley/smiley15.gif'>", $tags[tekst]);
$tags[tekst] = str_replace("[DEVIL]", "<img src='gfx/smiley/smiley16.gif'>", $tags[tekst]);
$tags[tekst] = str_replace("[YUM]", "<img src='gfx/smiley/smiley17.gif'>", $tags[tekst]);
$tags[tekst] = str_replace("[HYBER]", "<img src='gfx/smiley/smiley18.gif'>", $tags[tekst]);
echo "
<table width=400 border=0 cellspacing=2 cellpadding=2 class=menu>
<tr>
<td><span class=normaltextfed>$tags[opretter] - $tags[tid] - Ident: Logged
<br><center>-------------------------------------------------------------------------------------------------</center></span></td>
</tr>
<tr>
<td>
<table width=100% height=100% cellspacing=2 cellpadding=2><tr><td>
<span class=normaltext>
$tags[tekst]
</span>
</td></tr></table>
</td>
</tr>
</table><br>";
}
$g_total = mysql_query("select count(id) as total from tagwall") or die(mysql_error());
$total = mysql_result($g_total,0);
echo "<center><span class=normaltext>Side: ";
$page = 1; //Definerer hvor sidetal skal starte
for($start=0; $total > $start; $start=$start+$pr_side){
if ($start != $s) {
echo "<span class=normaltext><a href='$PHP_SELF?action=tagwall&&s=$start'> $page</a></span>";
} else {
echo "<span class=normaltext> $page</span>";
}
$page++;
}
echo "</span></center><br>";
}
if($action=="tagwall_write") {
echo "
<span class=normaltextfed> Max 400 tegn resten bliver slettet!!!<br>
<form action=tagwall.php?action=tagwall_write2 method=post>
<table width=300 border=0 cellspacing=0 cellpadding=0>";
if($_SESSION['bruger']) { echo ""; } else { echo "
<tr>
<td width=20%><span class=normaltext> Navn:</span></td>
<td><input name=opretter class=form_kom></td>
</tr>"; }
echo "<tr>
<td width=20%><span class=normaltext> Text:</span></td>
<td><textarea name=tekst class=form_kom cols=30 rows=5></textarea></td>
</tr>
<tr>
<td> <input type=submit value=Gem class=form_kom name=submit></td>
</tr>
</table>
</form>";
}
if($action=="tagwall_write2") {
include("mysql.php");
if (!$opretter) { echo " fejl fejl fejl fejl fejl fejl "; }
if (!$tekst) { echo " fejl fejl fejl fejl fejl fejl "; }
else {
$tagip=$_SERVER['REMOTE_ADDR'];
if(date("F") == January) { $m = Januar; }
if(date("F") == February) { $m = Februar; }
if(date("F") == March) { $m = Marts; }
if(date("F") == April) { $m = April; }
if(date("F") == May) { $m = Maj; }
if(date("F") == June) { $m = Juni; }
if(date("F") == July) { $m = Juli; }
if(date("F") == August) { $m = August; }
if(date("F") == September) { $m = September; }
if(date("F") == October) { $m = Oktober; }
if(date("F") == November) { $m = November; }
if(date("F") == December) { $m = December; }
$date = date("j");
$tid = date(" Y, H:i");
$idag = "Den $date. $m $tid";
mysql_query("insert into tagwall (opretter,tekst,tid,tagip) values ('$opretter','$tekst','$idag','$tagip')")or die (mysql_error());
echo "<meta http-equiv=refresh content=0;URL=tagwall.php?action=tagwall>";
}
}
?>
MySQL DUMP:
-----------
CREATE TABLE `tagwall` (
`id` int(1) NOT NULL auto_increment,
`tagip` varchar(30) NOT NULL default '',
`tid` varchar(50) NOT NULL default '',
`opretter` varchar(50) NOT NULL default '',
`tekst` text,
PRIMARY KEY (`id`),
KEY `modstander` (`opretter`)
) TYPE=MyISAM;