på
www.zaimoon.dk som ikke er online nu har jeg downloadet et script til en tagwall... php kode i selve tagwall.php: <? include("db.php"); ?>
<html>
<head>
<title>Tagwall - Tags</title>
<style TYPE="text/css">
BODY, P, TD, DIV {
LINE-HEIGHT:13px;
FONT-FAMILY: verdana;
FONT-SIZE: 10;
FONT-COLOR: 000000;
}
a:link {text-decoration:none; COLOR: #000000;}
a:visited {text-decoration:none; COLOR: #000000;}
a:hover {text-decoration:none; COLOR: #000000;}
}
td.top{
border-top: black 1px solid;
border-left: black 1px solid;
border-right: black 1px solid;
border-bottom: black 1px solid;
}
td.main{
border-right: black 1px solid;
border-left: black 1px solid;
}
</style>
</head>
<body bgcolor="#FFFFFF">
<center>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="top" width="100%">
<center>
<b>Tagwall</b>
</center>
</td>
</tr>
<?
if($nick && $msg) {
$nick = htmlentities($nick);
$mail = htmlentities($mail);
$msg = htmlentities($msg);
mysql_query("insert into tagwall(id, nick, mail, msg, ip)
values ('','$nick','$mail','$msg','$REMOTE_ADDR')");
}
?>
<table border="0" width="100%" bgcolor="#000000" cellspacing="0" cellpadding="0" align="left">
<form action="tagwall.php" method="post">
<table aline="left" border="0" width="100%">
<tr>
<td width="20"><font face="verdana" color="000000" size="2">Nick/navn:</font></td>
<td width="300"><input type="text" class="input" name="nick" maxlength="24" size="30"></td>
</tr>
<tr>
<td width="20"><font face="verdana" color="000000" size="2">Email:</font></td>
<td width="300"><input type="text" class="input" name="mail" maxlength="40" size="30"></td>
</tr>
<tr>
<td width="20" valign="top"><font face="verdana" color="000000" size="2">Tag:</font></td>
<td width="300"><textarea rows="3" type="text" class="input" name="msg" maxlength="500" cols="50"></textarea></td>
</tr>
<tr>
<td width="380" colspan="2">
<input type="submit" style="cursor:hand" name="tag" value="Tag !">
<input type="submit" style="cursor:hand" name="opdater" value="Opdater">
</td>
</tr>
</table>
</form>
<tr>
<td width="100%">
<center>
<table width="100%" border="0">
<tr><td bgcolor="#000000">
</td></tr>
<?
$result = mysql_query("select * from tagwall order by id desc limit 20");
$res = mysql_query("SELECT *, UNIX_TIMESTAMP(date) AS tid FROM tagwall ORDER BY id DESC limit 20") or die("Der er sket en fejl: ".mysql_error());
$col0 = "ffffff";
$col1 = "efefef";
$i=0;
while($row = mysql_fetch_array($res)) {
++$i;
$col = "col" . $i%2;
$tid = $row[tid];
$tid = date(" H:i - d/m y", $tid);
echo"<tr bgcolor=" . $$col . "><td><font face=verdana size=1><b><a href='mailto:$row[mail]' title='skrevet: $tid '>$row[nick]</a></b><font face=verdana size=1 color=000000> : $row[msg] </td></tr>\n";
}
?>
</table>
</center>
</td>
</tr>
<tr>
<td width="100%">
<center>
<a href="alltags.php"><u>alltags.php</u></a> - <a href="deltags.php"><u>deltags.php</u></a>
</center>
</td>
</tr>
</table>
</center>
Så kommer config.php :<?
$user = "zeizu_dk"; // mysql username
$pass = "xxxxxxx"; // mysql password
$db = "zeizu_dk"; //mysql database
$host = "mysql01.cliche.dk"; //mysql host
?>
Så db.php: <?
include("config.php");
$connection = mysql_connect("$localhost","$user","$pass");
mysql_select_db("$db", $connection);
?>
Så er der kun alltags.php og deltags.php tror ikke de er så vigtige lige nu og jeg tror at jeg har skrevet det maksimale...