Avatar billede frudi92 Nybegynder
23. juni 2006 - 23:06 Der er 6 kommentarer

smileys til minichat

nu har jeg rodet med smileys hele tiden er der en der kan skrive det direkte ind på denne kode og sende til bage og smilies/eek.gif


<?
require("config.php");
require("funktioner.php");

$brugerinfo = brugerinfo($_COOKIE[minichat3_id]);
checksession($brugerinfo[sesid]);
?>
<HTML>
<HEAD>
<link rel="stylesheet" type="text/css" HREF="style.css">
</HEAD>
<BODY>
<script language="JavaScript">
    function skrivclear() {
        document.skrivfelt.text.value = document.skrivfelt.msg.value;
        document.skrivfelt.msg.value='';
        document.skrivfelt.msg.focus();
    }
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="5" CLASS="normal">
  <tr>
    <td>&nbsp;</td>
    <td width="200">
      <table width="700" border="1" cellspacing="0" cellpadding="0" bordercolor="#000000" align="center" CLASS="normal">
        <tr>
          <td bgcolor="#84B0DD" bordercolor="#84B0DD">
            <p>
              <?=Language("41");?>
              <b>
              <?=RoomNavn($brugerinfo[room]);?>
              </b> |
              <?=Language("42");?>
              <b>
              <?=$brugerinfo[nick];?>
              </b> |
              <?=Language("43");?>
              : <b>
              <?=CountOnlineUsers($brugerinfo[room]);?>
              </b> | <?=Language("148");?> : <b><?=StatusNavn($brugerinfo[status]);?></b>
              <?if ($brugerinfo[status] == 0) { print "(<a href='register_online.php' target='top'>".Language('149')."</a>)";}?></p>
          </td>
        </tr>
        <form method="post" action="top.php" target="top"  name="skrivfelt" onSubmit="return skrivclear();">
          <tr>
            <td bgcolor="#eeeeee" bordercolor="#eeeeee"><?=Language("44");?>:
              <? sendtouser($brugerinfo[id]);?>
            </td>
          </tr>
          <tr>
            <td bgcolor="#eeeeee" bordercolor="#eeeeee">
              <input type="hidden" name="action" value="skriv">
              <input type="hidden" name="text" value="">
              <input type="text" name="msg" size="50" maxlength="250">
              <input type="submit" value="Send" name="submit">
            </td>
          </tr>
        </form>
        <tr>
          <td bordercolor="#eeeeee" bgcolor="#eeeeee">
            <table border="0" align="left" CLASS="normal" width="83%">
              <tr>
                <td> <a href="bottom.php"><?=Language("45");?></a></td>
                <td> <a href="users_online.php" target="top"><?=Language("46");?></a></td>
                <? if ($brugerinfo[status] >= 1){?>
                <td> <a href="profile.php?action=edit" target="top"><?=Language("47");?></a></td>
                <? } ?>
                <td><a href="help.php" target="_blank"><?=Language("48");?></a></td>
                <? if ($brugerinfo[status] >= 3){?>
                <td> <a href="admin_kit.php" target="top">Admin kit</a></td>
                <? } ?>
                <td> <a href="logoff.php" target="_parent"><?=Language("49");?></a></td>
                <td>
                <?php
                ?>
                  <div align="right">
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
    <td width="180">&nbsp; </td>
  </tr>
</table>
</BODY>
Avatar billede iss Novice
23. juni 2006 - 23:10 #1
Det skal gøres i funktionen sendtouser() er mit gæt... Så det er ikke her der skal rettes.
Avatar billede frudi92 Nybegynder
23. juni 2006 - 23:17 #2
sikker er ikke godt nok:P
Avatar billede iss Novice
23. juni 2006 - 23:18 #3
Så må du jo selv rette det...
Avatar billede frudi92 Nybegynder
23. juni 2006 - 23:34 #4
rediger det hele til dit bud og send
Avatar billede iss Novice
23. juni 2006 - 23:48 #5
Du er godt nok tung at danse med, du har ikke postet den kode der skal rettes til før det kan lade sig gøre...
Avatar billede frudi92 Nybegynder
23. juni 2006 - 23:58 #6
<?
require("config.php");
require("funktioner.php");

$brugerinfo = brugerinfo($_COOKIE[minichat3_id]);
if ($brugerinfo[kickby] != ""){
    if ($brugerinfo[kicktype] == 1){
        print "<h2>You were kicked by: $brugerinfo[kickby]</h2><br>\n";
        print "<h3>KickText: $brugerinfo[kicktext]</h3>";
    }
    if ($brugerinfo[kicktype] == 2){
        print "<h2>You were banned by: $brugerinfo[kickby]</h2><br>\n";
        print "<h3>KickText: $brugerinfo[kicktext]</h3>";
    }
    exit;
}
checksession($brugerinfo[sesid]);
Skaer_txt($_COOKIE[minichat3_id]);
Skaer_txt($brugerinfo[room]);
?>
<?
if ($_GET[action] == "changeroom"){
    if ($brugerinfo[room] != $_GET[newroom]){
        ChangeRoom($brugerinfo[id],$_GET[newroom]);
    }
    else {
        WriteToRemote("",$brugerinfo[id],"".Language("50")."");
    }
}
elseif ($_GET[action] == "take_credits"){
    $credit = format($_GET[credit]);
    $res_credit = mysql_query("SELECT * FROM minichat3_givecredits where id='$credit'");
    $row_credit = mysql_fetch_array($res_credit);
    if ($brugerinfo[status] >= 1){
        if ($row_credit[giveto] == 0){
            mysql_query("UPDATE minichat3_givecredits SET giveto='$brugerinfo[uid]' where id='$credit'");
            $takefrominfo = unikinfo($row_credit[takefrom]);
            WriteToChat($brugerinfo[room],"System","","".Language("51")." <b>".$takefrominfo[nick]."</b> [".Language("52").": ".$row_credit[amount]."] ".Language("53")." <b>".$brugerinfo[nick]."</b>");
            mysql_query("UPDATE minichat3 SET credits=credits-'$row_credit[amount]' where id='$takefrominfo[id]'");
            mysql_query("UPDATE minichat3 SET credits=credits+'$row_credit[amount]' where id='$brugerinfo[uid]'");
        }
        else {
            WriteToRemote("",$brugerinfo[id],"".Language("54")."!");
        }
    }
    else {
        WriteToRemote("",$brugerinfo[id],"".Language("55")."!");
    }
}
elseif ($_POST[action] == "skriv"){
    $text = format($_POST[text]);
    if ($brugerinfo[mute] == 1){
        WriteToRemote("",$brugerinfo[id],"".Language("56")."!");
    }
    elseif ($text != "" && $text != " "){
        if ($text == "?"){
            include("help.php");
            exit;
        }
        elseif ($_POST[sendto] == "System"){
            if ($brugerinfo[status] == 3){
                WriteToChat($brugerinfo[room],"System","","$text");
            }
            else {
                WriteToRemote("",$brugerinfo[id],"".Language("57")."!");
            }
        }
        elseif ($_POST[sendto] > 1){
            $remoteinfo = brugerinfo($_POST[sendto]);
            if ($remoteinfo[id] > 1 && $remoteinfo[kicktype] == 0){
                if ($brugerinfo[status] > 1){
                    if (substr($text,0,5) == "/kick"){
                        $text2 = substr($text,5);
                        Kick($brugerinfo[id],$_POST[sendto],$text2);
                        header("Location: top.php");
                        $admin_done = 1;
                    }
                    elseif (substr($text,0,4) == "/ban"){
                        $text2 = substr($text,4);
                        Ban($brugerinfo[id],$_POST[sendto],$text2);
                        header("Location: top.php");
                        $admin_done = 1;
                    }
                    elseif (substr($text,0,5) == "/mute"){
                        $text2 = substr($text,5);
                        Mute($brugerinfo[id],$_POST[sendto],$text2);
                        $admin_done = 1;
                    }
                }
                if ($admin_done == 0){
                    if ($text == "help" || $text == "?"){
                        include("help.php");
                    }
                    elseif ($text == "/ignore"){
                        Ignore($brugerinfo[id],$_POST[sendto]);
                    }
                    else {
                        WriteToRemote($brugerinfo[id],$remoteinfo[id],$text);
                    }
                }
            }
            else {
                WriteToRemote("",$brugerinfo[id],"".Language("58")."!");
            }
        }
        elseif (substr($text,0,9) == "/chatinfo"){
            ShowChatInformation($brugerinfo[id]);
            header("Location: top.php");
        }
        elseif (substr($text,0,9) == "/roomname"){
            if ($brugerinfo[status] >= 3){
                $newroom = substr($text,10);
                ChangeRoomName($brugerinfo[id],$brugerinfo[room],$newroom);
            }
            header("Location: top.php");
        }
        elseif (substr($text,0,9) == "/subject "){
            if ($brugerinfo[status] >= 3){
                $emne = substr($text,9);
                ChangeRoomEmne($brugerinfo[id],$brugerinfo[room],$emne);
            }
            header("Location: top.php");
        }
        elseif (substr($text,0,5) == "/nick"){
            $newnick = substr($text,6);
            ChangeNick($brugerinfo[id],$newnick);
            header("Location: top.php");
        }
        elseif (substr($text,0,11) == "/textcolor "){
            $newcolor = substr($text,11);
            ChangeColor($brugerinfo[id],"text_color",$newcolor);
            header("Location: top.php");
        }
        elseif (substr($text,0,11) == "/namecolor "){
            $newcolor = substr($text,11);
            ChangeColor($brugerinfo[id],"name_color",$newcolor);
            header("Location: top.php");
        }
        elseif (substr($text,0,12) == "/restartchat"){
            RestartChat($brugerinfo[id],$brugerinfo[room]);
            header("Location: top.php");
        }
        elseif (substr($text,0,5) == "/mode"){
            $newmode = substr($text,6);
            Mode($brugerinfo[id],$newmode);
            header("Location: top.php");
        }
        elseif (substr($text,0,6) == "/give "){
            $text = substr($text,6);
            GiveCredits($brugerinfo[id],$text);
            header("Location: top.php");
        }
        elseif (substr($text,0,4) == "/me "){
            $text = substr($text,4);
            WriteEmoteToChat($brugerinfo[id],$text);
            header("Location: top.php");
        }
        elseif (substr($text,0,7) == "/think "){
            $text = substr($text,7);
            WriteEmoteToChat($brugerinfo[id]," . o O ( ".$text." ) ");
            header("Location: top.php");
        }
        else {
            WriteToChat($brugerinfo[room],$brugerinfo[nick],$brugerinfo[id],$text);
        }
        AddChatline($brugerinfo[id],$text);
    }
    header("Location: top.php");
}
?>
<HTML>
<HEAD>
<link rel="stylesheet" type="text/css" HREF="style.css">
<META HTTP-EQUIV="Refresh" CONTENT="6; URL=top.php">
</HEAD>
<BODY>
<br>
<div CLASS="alm-txt">
  <table width="100%" border="0" cellspacing="0" cellpadding="5">
    <tr valign="top">
      <td>&nbsp; </td>
      <td width="700">
        <table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolor="#000000" align="right" CLASS="alm-text">
          <tr>
            <td bgcolor="#84B0DD" bordercolor="#84B0DD">
              <div align="center"><b>
                <?=RoomNavn($brugerinfo[room]);?>
                (<?=RoomEmne($brugerinfo[room]);?>)</b></div>
            </td>
          </tr>
          <?
$res_chat = mysql_query("SELECT * FROM minichat3_txt_".$brugerinfo[id]." order by id DESC");
while ($row_chat = mysql_fetch_array($res_chat)){
// Fejl($brugerinfo[ignore_list].",".$row_chat[fra_id]."");
if (!strstr($brugerinfo[ignore_list], "$row_chat[fra_id],") || $row_chat[fra] == "System"){
    if ($row_chat[fra] != "System") {
        $row_chat[msg] = ereg_replace($brugerinfo[nick],"<font color='FF9900'><b>$brugerinfo[nick]</b></font>",$row_chat[msg]);
    }
?>
          <tr>
            <td bgcolor="#eeeeee" bordercolor="#eeeeee" onMouseOver="style.backgroundColor='#dddddd';" onMouseOut="style.backgroundColor='#eeeeee';">
              <?
      if ($row_chat[fra] == "System"){
        if ($row_chat[type] == 1){
            print "<div CLASS='private'><b>($row_chat[fra] -> $row_chat[til]):</b> $row_chat[msg]</div>\n";
        }
        else {
            print "<div CLASS='system'><b>$row_chat[fra]:</b> $row_chat[msg]</div>\n";
        }
    }
    else {
        if ($row_chat[type] == 1){
            print "<div CLASS='private'><b>($row_chat[fra] -> $row_chat[til]):</b> $row_chat[msg]</div>\n";
        }
        elseif ($row_chat[type] == 2){
            print "<div CLASS='emote'><i><b>$row_chat[fra] </b> $row_chat[msg]</i></div>\n";
        }
        else {
            print "<div CLASS='normal'><b><font color=".$row_chat[name_color].">$row_chat[fra]:</font></b> <font color=".$row_chat[text_color].">$row_chat[msg]</font></div>\n";
        }
    }?>
            </td>
          </tr>
          <?
}
}
?>
        </table>
      </td>
      <td width="180">
        <table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolor="#000000" CLASS="alm-text">
          <tr>
            <td bordercolor="#84B0DD" bgcolor="#84B0DD">
              <div align="center"><b><?=Language("39");?></b></div>
            </td>
          </tr>
        <?    $res_rooms = mysql_query("SELECT * FROM minichat3_rooms order by navn ASC");
            while ($row_rooms = mysql_fetch_array($res_rooms)){
                $res_tal = mysql_query("SELECT * FROM minichat3_sessions where room='$row_rooms[id]' and kicktype='0'");
                $tal = mysql_num_rows($res_tal);?>
          <tr bgcolor="#eeeeee" bordercolor="#eeeeee" onMouseOver="style.backgroundColor='#dddddd';" onMouseOut="style.backgroundColor='#eeeeee';" CLASS="normal">
            <td><a href="top.php?action=changeroom&newroom=<?=$row_rooms[id];?>"><?=$row_rooms[navn];?> (<?=$tal;?>)</a></td>
          </tr>
        <? } ?>
        </table>
        <br>
    <?    $res_count_vote = mysql_query("SELECT * FROM minichat3_vote_ses where open='1'");
        if (mysql_num_rows($res_count_vote)){?>
        <form action="vote.php" method="post" target="_self">
        <table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolor="#000000" class="alm-text">
          <tr>
            <td bordercolor="#84B0DD" bgcolor="#84B0DD">
                <div align="center"><b><?=Language("120");?></b></div>
            </td>
          </tr>
            <?
                $res_vote = mysql_query("SELECT * FROM minichat3_vote_ses where open='1' order by id DESC LIMIT 1");
                $row_vote = mysql_fetch_array($res_vote);
            ?>
          <tr bgcolor="#eeeeee" bordercolor="#eeeeee" onMouseOver="style.backgroundColor='#dddddd';" onMouseOut="style.backgroundColor='#eeeeee';" class="normal">
              <td>
                  <?=$row_vote[spm];?>
              </td>
          </tr>
                <?
                $res_user_vote = mysql_query("SELECT * FROM minichat3_votes where voteid='$row_vote[id]' and user='$brugerinfo[uid]'");
                if (mysql_num_rows($res_user_vote) == 0 && $brugerinfo[status] >= 1){
                    $i = 1;
                    while ($i <= 3){
                        $svar_id = "vote".$i;?>
          <tr bgcolor="#eeeeee" bordercolor="#eeeeee" onMouseOver="style.backgroundColor='#dddddd';" onMouseOut="style.backgroundColor='#eeeeee';" class="normal">
            <td>
                <table width=100% CLASS="normal">
                    <tr>
                       
                    <td width="94%">
                      <?=$row_vote[$svar_id];?>
                    </td>
                       
                    <td width="6%">
                      <input type="radio" name="vote" value="<?=$i;?>">
                        </td>
                    <tr>
                   
                </table>
            </td>
          </tr>
        <? $i++;}?>
          <tr bgcolor="#eeeeee" bordercolor="#eeeeee" onMouseOver="style.backgroundColor='#dddddd';" onMouseOut="style.backgroundColor='#eeeeee';" class="normal">
              <td>
                <div align="center">
                  <input type="hidden" name="vote_id" value="<?=$row_vote[id];?>">
                  <input type="submit" value="<?=Language("121");?>">
                </div>
              </td>
          </tr>
                <?
                }
                else {
                    $i = 1;
                    while ($i <= 3){
                        $svar_id = "vote".$i;
?>
          <tr bgcolor="#eeeeee" bordercolor="#eeeeee" onMouseOver="style.backgroundColor='#dddddd';" onMouseOut="style.backgroundColor='#eeeeee';" class="normal">
            <td>
                <table width=100% CLASS="normal">
                    <tr>
                       
                    <td width="94%">
                      <?=$row_vote[$svar_id];?>
                    </td>
                       
                    <td width="6%">
                      <?=CountVotes($row_vote[id],$i);?>
                        </td>
                    <tr>
                   
                </table>
            </td>
          </tr>
                        <?
                        $i++;
                    }
                }
                ?>

        </table>
        </form>
    <? } ?>
      </td>
    </tr>
  </table>
    <td bgcolor="#84B0DD" bordercolor="#84B0DD">
      <div align="center"><b>©2006 hage-lund</b></div>
 
</div>
</BODY>
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester