Als je nu in de chat zit heb je dus een vakje waar je tekst in moet typen en dan op enter klikken (vrij normaal dacht ik)
Nu heb ik naast het vakje aan de ene kant een kleurcode balk, waar je op kan klikken om je tekstkleur te kiezen.
Aan de andere kant zit een vraagteken, als je daar op klikt verschijnt er een popup met de smilies en tags voor bold tekst enz
Die smilies kun je gebruiken door op de desbetreffende smilie te klikken dan verschijnt bijv

je de popop sluiten om verder tekst in het tekstvakje te typen, dat vind ik dus niet zo handig. Ik wil die smilies gewoon op de zelfde pagina als het tekstvak.
Dat lukt ook wel, alleen als ik er dan op klik komt er niks in het tekstvak, dus hij weet het tekstvak schijnbaar niet meer te vinden?
Ik twijvel of iemand snapt wat ik bedoel lol denk dat het script aangepast moet worden hoe krijg ik voorelkaar wat ik wil?

- Code: Selecteer alles
<?
/* ------------------------------------------------------------------
This library allows to transform text codes to graphical smilies.
It is called by 'chat/input.php3'.
------------------------------------------------------------------ */
// The table below define smilies code and associated gif names, width and height.
// You can add your own collection of smilies inside but be aware that codes may
// need to be slashed in some way because they are used as POSIX 1003.2 regular
// expressions (see the Check4Smilies function below). Moreover these codes are
// case sensitives.
$SmiliesTbl = Array(
"_o_" => array("worship.gif", "15", "15"),
"K)" => array("kiss.gif", "19", "19"),
":o" => array("redface.gif", "17", "17"),
"dork)" => array("dork.gif", "19", "17"),
"blush" => array("blush.gif", "17", "17"),
"cen)" => array("censored.gif", "19", "17"),
"h)" => array("heart.gif", "23", "18"),
"cool)" => array("smoke.gif", "21", "15"),
":\)" => array("smile1.gif", "15", "15"),
":D" => array("smile2.gif", "15", "15"),
":O" => array("oooh.gif", "17", "17"),
":\(" => array("smile4.gif", "15", "15"),
";\)" => array("smile5.gif", "15", "15"),
":p" => array("smile6.gif", "15", "15"),
"8\)" => array("smile7.gif", "15", "15"),
":\[" => array("smile8.gif", "15", "15"),
"OL" => array("love.gif", "16", "16"),
":P" => array("puh2.gif", "17", "17"),
":9" => array("yummie.gif", "17", "17"),
"love)" => array("lovee.gif", "25", "16")
);
$MaxWidth = "50"; // Set the maximum width among similes
$MaxHeight = "15"; // Set the maximum height among similes
// ---- DO NOT MODIFY BELOW ----
// Slashes ' and " characters
function SpecialSlash(&$Str)
{
return str_replace("\"",""",str_replace("'","\\'",$Str));
}
// Replace smilies code by gif URLs in messages
function Check4Smilies(&$string,&$Table)
{
$tmp_tbl = split("<a href|</a>", " ".$string." ");
$i = "0";
for (reset($tmp_tbl); $substring=current($tmp_tbl); next($tmp_tbl))
{
// $substring is one of the trailing spaces added above -> do nothing
if($substring == " ")
{
}
// $substring is not an HTTP link -> do the work for smilies
elseif (($i % 2) == "0")
{
while(list($key, $prop) = each($Table))
{
$substring = ereg_replace($key, " <IMG SRC=\"images/smilies/$prop[0]\" WIDTH=$prop[1] HEIGHT=$prop[2] ALT=\"".str_replace("\"",""", stripslashes($key))."\"> ", $substring);
};
$tmp_tbl[$i] = $substring;
}
// $substring is an HTTP link -> just restore HTML tags for links
else
{
$tmp_tbl[$i] = "<a href".$substring."</a>";
}
$i++;
};
$string = trim(join("",$tmp_tbl));
unset($tmp_tbl);
}
// Display smilies in the help popup and in the tutorials
function DisplaySmilies(&$ToDisplay,&$Table,&$TblSize,$Target)
{
global $MaxWidth, $MaxHeight;
$i = 0;
$Str1 = "";
$Str2 = "";
$PerLines = floor(600/$MaxWidth);
while(list($key, $prop) = each($Table))
{
$i++;
if ($Target == "help") $Str1 .= "\t\t<TD ALIGN=\"CENTER\" WIDTH=$MaxWidth HEIGHT=$MaxHeight><A HREF=\"#\" onClick=\"smiley2Input('".SpecialSlash($key)."'); return false\"><IMG SRC=\"images/smilies/$prop[0]\" WIDTH=$prop[1] HEIGHT=$prop[2] BORDER=0 ALT=\"".str_replace("\"",""", stripslashes($key))."\"></A></TD>\n";
else $Str1 .= "\t\t<TD ALIGN=CENTER WIDTH=$MaxWidth HEIGHT=$MaxHeight><IMG SRC=\"images/smilies/$prop[0]\" WIDTH=$prop[1] HEIGHT=$prop[2] BORDER=0 ALT=\"".str_replace("\"",""", stripslashes($key))."\"></TD>\n";
$Str2 .= "\t\t<TD ALIGN=\"CENTER\" NOWRAP>".stripslashes($key)."</TD>\n";
if (is_integer($i/$PerLines) || $i == $TblSize)
{
$ToDisplay[] = $Str1;
$ToDisplay[] = $Str2;
$Str1 = "";
$Str2 = "";
};
};
};
?>