marirds |
23rd February 2009 01:58 |
Bigger picture... I don't have it .. that picture is from another tracker.
Tweak it ... wel... those button change text, like in the picture. If i press Bold button, i write with bold and sends bold to shoutbox, if i select red color, it writes with red color and send it to shoutbox. Here is my shoutbox.php
PHP Code:
<?php require_once("include/bittorrent.php");
dbconn(); loggedinorreturn(); //maxsysop (); //if ($CURUSER["chatpost"] == 'no') //{ //echo "<center>Drepturile de a folosii shoutbox'u ti-au fost suspendate!<img src=\"pic/stop.gif\"</center>";
//exit; //}
header("Content-Type: text/html; charset=UTF-8");
function decode_unicode_url( $str ) { $res = '';
$i = 0;
$max = strlen( $str ) - 6;
while ( $i <= $max ) { $character = $str[$i];
if ( $character == '%' && $str[$i + 1] == 'u' ) { $value = hexdec( substr( $str, $i + 2, 4 ) );
$i += 6;
if ( $value < 0x0080 ) $character = chr($value); else if ($value < 0x0800) { $character = chr((($value & 0x07c0) >> 6) | 0xc0) . chr(($value & 0x3f) | 0x80); } else { $character = chr((($value & 0xf000) >> 12) | 0xe0) . chr((($value & 0x0fc0) >> 6) | 0x80) . chr(($value & 0x3f) | 0x80); } } else { $i++; }
$res .= $character; }
return $res . substr( $str, $i ); }
if ( $_GET["do"] == "shout" && $CURUSER["chatpost"] == 'yes' ) { $shout = iconv( "UTF-8", "UTF-8", urldecode( decode_unicode_url( $_GET["shout"] ) ) );
if ( $shout == "/empty" && get_user_class() >= UC_MODERATOR ) { mysql_query("TRUNCATE TABLE shoutbox"); $text = "Shouts have been deleted !"; $date=time(); mysql_query("INSERT INTO shoutbox (id, userid, username, date, text) VALUES (NULL, " . sqlesc('System') . ", " . sqlesc('0') . ", $date, " . sqlesc($text) . ")") or sqlerr(__FILE__, __LINE__); write_logc("Shoutbox deleted by $CURUSER[username]","5"); die(); header("Refresh: 0; url=shoutbox.php"); }
$sender = 0 + $CURUSER["id"];
if (!empty($shout)) { $shout = preg_replace("/\/me /", $CURUSER["username"]." ", $shout); mysql_query( "INSERT INTO shoutbox (date, text, userid) VALUES (".implode(", ", array_map("sqlesc", array(time(), $shout, $sender))).")" ); }
} else { /* if ($_GET["do"] == "delete" && get_user_class() >= UC_MODERATOR && is_valid_id($_GET["id"])) { $id = $_GET["id"];
mysql_query("DELETE FROM shoutbox WHERE id = $id") or sqlerr(__FILE__,__LINE__); } }*/ if($_GET['do']==='delete' && is_valid_id($_GET['id'])){ $id=0+$_GET['id']; $tmp=mysql_query('SELECT `userid` FROM `shoutbox` WHERE `id`='.$id) or sqlerr(__FILE__,__LINE__); if(mysql_num_rows($tmp)){ $owner=mysql_result($tmp,0); if($CURUSER['id']===$owner || $CURUSER['class']>=UC_MODERATOR) $tmp=mysql_query('DELETE FROM `shoutbox` WHERE `id`='.$id) or sqlerr(__FILE__,__LINE__); } } }
$res = mysql_query("SELECT * FROM shoutbox ORDER BY id DESC LIMIT 0, 30");
if ( mysql_num_rows( $res ) == 0 ) { die( "All shouts have been deleted." ); }
while ($arr = mysql_fetch_array($res)) { $user = mysql_query("SELECT id, username, class, donor, warned FROM users WHERE id=$arr[userid]") or print(mysql_error());
$user = mysql_fetch_array($user);
//$warn = $arr["warned"] == "yes"; if ($arr["warned"] == "yes"){ $warn = "<img src=pic/warned8.gif alt=Warned title=Warned />"; } if ($arr["donor"] == "yes"){ $vip = "<img src=pic/star.gif alt=VIP title=V.I.P. />"; }
$comment= format_comment( $arr["text"] );
if( get_user_class() >= UC_MODERATOR || $user["id"] == $CURUSER["id"]) { echo "<span onclick=\"deleteShout($arr[id]);\" style=\"cursor: pointer; color: red; font-weight: bold; \">X</span>"; }
echo "<font color=UC_USER>|".strftime("%H:%M",$arr["date"])."|</font>"; if( $user["username"] == NULL ) { echo "<font class='UC_POWER_USER'>SYSTEM</font> :"; } else { if($CURUSER["class"]<UC_ELITE) echo "<a style='text-decoration:none' href=\"userdetails.php?id=$arr[userid]\"[".$arr["username"]."] ';return false;\" ><font class=".clasa_useri($user['class']).">".$user["username"]."</font></a>$warn $vip : "; else echo "<a style='text-decoration:none' href=\"userdetails.php?id=$arr[userid]\"[".$arr["username"]."] ';return false;\" ><font class=".get_class_id($user['class']).">".$user["username"]."</font></a>$warn $vip : "; }
echo "$comment<br/>\n"; }
?>
|