Location: PHPKode > projects > Modular Site Manager > htdocs/inc/flooder.php
<?php

class flooder
{
	function deletepost($id)
	{
		global $mysql;
		$mysql->delete(PRE."flooder`", "id='$id'");
		header("Location: ".$HTTP_REFERER);
		return true;
	}

	function showall()
	{
		global $mysql;
		$all = $mysql->select(PRE."flooder", NULL, "id", "DESC");
		while($r=mysql_fetch_array($all)) {
			$id = $r["id"];
			$username = $r["name"];
			$message = $r["message"];
			$ip = $r["ip"];
			echo "<strong>".$username."</strong><br />IP: ".$ip." <br />".$message."<br /><a href=\"v-delete.php?id=".$id."\">Delete this</a> <a href=\"v-edit.php?id=".$id."\">Edit this</a><br /><br />";
		}
		return true;
	}

	function showone($id)
	{
		global $mysql;
		$one = $mysql->select(PRE."flooder", "id='".$id."'", "id", "DESC", "1");
		$t=mysql_fetch_array($one);
		$id = $t["id"];
		$username = $t["name"];
		$mesage = str_replace('"', '&quot;', $t["message"]);
		$ip = $t["ip"];
		echo "<form action=\"v-edit-in.php\" method=\"post\">
		<input type=\"hidden\" name=\"id\" value=\"".$id."\" />
		<input type=\"hidden\" value=\"".$username."\" name=\"username\" />
		<strong>".$username."</strong>
		<br /><textarea rows=\"4\" cols=\"20\" name=\"message\">".$message."</textarea><br />
		<input type=\"submit\" name=\"submit\" value=\"submit\" /></form>";
		return true;
	}

	function show($limit)
	{
		global $mysql;
		$all = $mysql->select(PRE."flooder",NULL, "id", "DESC", $limit);
		$rows = mysql_num_rows($all);
		echo "<div class=\"shoutbox-tags\">\n";
		for($i = 0; $i < $rows; $i++)
		{
			$r=mysql_fetch_assoc($all);
			$username = $r["name"];
			$message = $r["message"];
			if($i % 2)
			{
 				echo "<div class=\"row1\">\n";
			} else {
				echo "<div class=\"row2\">\n";
			}
			$parsed = parse($message);
			echo "<div style=\"font-weight: bold;\"><a href=\"Members/Profile/".$username."/\">".$username."</a></div><br />".$parsed."<br /></div>\n";
		}
		echo "</div>\n";
		return true;
	}

	function tagin($name, $message, $ip)
	{
		global $mysql;
		$mysql->insert(PRE."flooder", array("name", "message", "ip", "date"), array(strip_tags($name), nl2br($message), $ip, time()));
		return true;
	}

}

?>
Return current item: Modular Site Manager