Simple Machines Community Forum

General Community => Scripting Help => Topic started by: wooki3 on February 16, 2012, 09:14:57 PM

Title: need some help with a custom chat
Post by: wooki3 on February 16, 2012, 09:14:57 PM
so ive been working on a custom chat for my buddies site, ive currently got it so that it uses the ssi to check if the user is allow in the chat but is there a way to call up the persons username so that they dont have to type it before sending a msg?
this is wat i have and i want to try to get rid of the username field and have it so that the script pulls the current users smf username instead

<?php require("SSI.php"); ?>
<html><body>
<?php
if ($context['user']['is_admin'])
{
echo'
<div>
<form action="/newstuff/staffchat/postchat.php" name="add" onsubmit="return validateForm()" method="post">
<font color=white>UserName: </font><input type="text" name="name" /><br>
<font color=white>Message: </font><input type="text" name="msg" size=65 /><br>
<input type="submit" /></form>
</div>'
;
}
else {
echo '<font color=white>You Must Be Staff To Post Messages In Chat</font>'; }
?>


</body></html>


so i managed to figure it out but thanks for trying to help