Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Yuna Scatari Edition (YSE) (http://www.bvlist.com/forumdisplay.php?f=22)
-   -   WYSIWYG and shoutbox (http://www.bvlist.com/showthread.php?t=2039)

marirds 17th February 2009 23:48

WYSIWYG and shoutbox
 
1 Attachment(s)
Can you guys help me tweak my shoutbox ? Look in the picture attached..
Thanks in advance

wMan 21st February 2009 15:26

tweak it how and maybe a bigger picture or even the code for us to help u

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 hexdecsubstr$str$i 2) );

$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"urldecodedecode_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 $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 ) == )
{
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. />";
}


$commentformat_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";
}

?>



All times are GMT +2. The time now is 03:35.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.