Location: PHPKode > projects > Backend code/CMS for blizzle.com > v1.x/blizlets/blitzlet.php
<?
global $sbNick, $sbPunc, $sbShout, $here;

if (($sbNick) && ($sbShout)) {

$query = "INSERT INTO shouts (displayname, shout, date, punc) VALUES ('".stripNick($sbNick)."','".textReplace($sbShout)."',NOW(),'$sbPunc');";
$result = mysql_query ($query, $link) or die (mysql_error());
addModPoints(.5);

}

$bHtml = "";
$query = "SELECT * FROM shouts ORDER BY date DESC LIMIT 10;";
$result = mysql_query ($query, $link) or die (mysql_error());
while (list($displayname,$shout,$date,$punc) = mysql_fetch_row($result)) {
$dlen = (strlen($shout)/2)+(strlen($shout)/15);
switch ($punc) {
	case "!":
$color = "#3D04B0";
$displayname = "(<a href=\"accountlookup.php?name=".rawurlencode($displayname)."\">$displayname</a>)";
break;
	case "?":
$color = "#7B3C09";
$displayname = "(<a href=\"accountlookup.php?name=".rawurlencode($displayname)."\">$displayname</a>)";
break;
	case ".":
$color = "#000000";
$displayname = "(<a href=\"accountlookup.php?name=".rawurlencode($displayname)."\">$displayname</a>)";
break;
	case "*":
$color = "#C3038B";
$displayname = "* <a href=\"accountlookup.php?name=".rawurlencode($displayname)."\">$displayname</a>";
break;
}
	$bHtml = $bHtml."<div style=\"width: 130; font-size: 10px; font-family: sans-serif; color: $color;\">$displayname <img src=\"/commonimages/spacer.png\" width=10 height=\"$dlen\" align=left> $shout\n<br></div>
<div style=\"width: 130; height: 20px; font-size: 8px; font-family: sans-serif; text-align: right; text-style: italic;\">$date</div>";
}


$bHtml = "<table border=0 cellpadding=2 cellspacing=0>
<tr><td bgcolor=#DEDFD6>$bHtml</td></tr>
<tr><td bgcolor=#C6C3C6><form method=post action=$here><span style=\"width: 26px; height: 16px; font-size: 11px; font-family: sans-serif; font-weight: bold;\">nick:</span>".retUserNameFormatted("sbNick","style=\"width: 70px; height: 20px; font-size: 11px; font-family: sans-serif; font-weight: bold;\"")."<select name=sbPunc style=\"width: 34px; height: 19px; font-size: 11px; font-family: sans-serif; font-weight: bold;\">
<option value=\"!\" style=\"font-size: 11px; font-family: sans-serif;\">!
<option value=\"?\" style=\"font-size: 11px; font-family: sans-serif;\">?
<option value=\".\" selected style=\"font-size: 11px; font-family: sans-serif;\">.
<option value=\"*\" style=\"font-size: 11px; font-family: sans-serif;\">*
</select>
<textarea name=sbShout style=\"width: 130px; height: 40px; font-size: 11px; font-family: sans-serif;\"></textarea><br><input type=submit style=\"width: 130px; height: 20px; font-size: 11px; font-family: sans-serif; font-weight: bold;\" value=\"exclaim!\"></td></form></tr>
</table>";

createBlizlet('blitzlet',heftyreplace($bHtml));


?>
Return current item: Backend code/CMS for blizzle.com