Creates room with picture

Started on the old forum in November 2009 · view the original in the archive · old links redirect here

41 replies · 2,321 views · started 17 years ago · 1 min read

TL;DR · summary of 41 replies
  • - The code needs to be fixed so that when creating a new room, it displays an image above the room name.
  • - Adding another input box for pic in index.php?action=mkroom and collecting it in genproc.php?action=mkroom is suggested as a solution.
  • - There are two unresolved issues: one about images not loading properly and the other about multiple rooms showing duplicate pictures.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

7 participants
Leviathan73 Senior · 260 posts #1

Hi friends! chat, create room I put in this code

echo "add image:<input name=\"imgo\" maxlength=\"200\"/><br/>";

, so that it creates room with picture. Do you know the code to add here?

addonline($uid,"Chat in $rname ($mmsg)","chat.php?rid=$rid&rpw=$rpw");
        //echo "<p>";
        echo popup($sid);
        echo "<b>1 </b><a name=\"top\" id=\"top\" accesskey=\"1\" href=\"chat.php?action=say&sid=$sid&rid=$rid&rpw=$rpw\">write</a><br/>";

I would like the image above to write.. thanks for the reply.😊

something else Fellow · 2,296 posts #2

Depends on where the picture is going?

Is it being set as background image ..... is the picture being set as a topic or heading for the room or is the picture being entered into chat text?

riderz Lead · 975 posts #3

something else i think he want it ontop of the page before ecverything i think he want it to be

[the Image] say / refresh options

i think he want it like that


Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

riderz Lead · 975 posts #5

or how bout in the chat menu before u enter the chatroom then it show the pic next to the chatroom name


Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

riderz Lead · 975 posts #8

i think he want to upload diff pics all the time mabe when he delete the chatroom he want to add another pic


Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

Leviathan73 Senior · 260 posts #9

the image has no background, it is a normal image. you give that name to the room opened, and you put a picture of the room. I put this in the file index.php

echo "<form action=\"genproc.php?action=mkroom&sid=$sid\" method=\"post\">";
        echo "<form action=\"genproc.php?action=mkroom&sid=$sid\" method=\"post\">";
        echo "Add Image:<input name=\"imgo\" maxlength=\"200\"/><br/>";
        echo "Name Room: <input name=\"rname\" maxlength=\"30\"><br/>";
        echo "Password: <input name=\"rpass\" style=\"-wap-input-format: '*x'\" maxlength=\"10\"><br/>";
        echo "<input type=\"Submit\" name=\"Create\" Value=\"Create\"></form>";
        echo "</p>";
something else Fellow · 2,296 posts #10

so add an extra row to your chat rooms sql and insert the url into the new row 🙂 then call it from the sql where ever your going to have the pic 🙂

Leviathan73 Senior · 260 posts #11

The table should be this ibwf_chat to add as I set? I preferred to add pictures from your phone, no PC 🙁

something else Fellow · 2,296 posts #12

if you want it like this:

[pic1] roomname 1 [pic2] roomname 2

then use ibwf_rooms sql

also same thing if u want the pic inside the room 🙂

have something like: pic varchar(255) default=""

Leviathan73 Senior · 260 posts #13

ok thanks, so when I open new room, I put the image there is mandatory from pc?😐

something else Fellow · 2,296 posts #14

no u could either use uploaders or use a picture url picture url is probably easier to code. or you could just have preselected pictures with a dropdown box 🙂

riderz Lead · 975 posts #15

i think this could look nice im gona make a code like the shoutbox to add next to the room if members wona display the images there will be option to switch it on or off so it will be up to the member if they wona display the images next to the room


Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

Leviathan73 Senior · 260 posts #16

Let me give an example .. community in the script or wapdesire Laval, in settings you can customize the mini wap site, and you can insert an image via URL. and I would do the same thing when I open a new private room. In the Users folder, there is the file index.php with this code

$ilink = trim($upinfo[0]);
  if($ilink=="")
  {
   $ilink = "<img src=\"../rwidc.php?id=$uid\" alt=\"*\"/>";
  }else{
   $ilink = "<img src=\"$upinfo[0]\" alt=\"*\"/>";
  }
  $msg = trim($upinfo[1]);
  if($msg=="")
  {

but if I put the file chat.php same code gives me error. then we must add the code here

addonline($uid,"Chat in $rname ($mmsg)","chat.php?rid=$rid&rpw=$rpw");
        //echo "<p>";
        echo popup($sid);
        echo "<b>1 </b><a name=\"top\" id=\"top\" accesskey=\"1\" href=\"chat.php?action=say&sid=$sid&rid=$rid&rpw=$rpw\">write</a><br/>";
something else Fellow · 2,296 posts #17

something like this for outside the chatroom:

        $rooms = mysql_query("SELECT id, name, pass, pic FROM ibwf_rooms WHERE static='0'");
        $co=0;
        while ($room= mysql_fetch_array($rooms))
        {
$ilink = trim($room[3]);
  if($ilink=="")
  {
   $ilink = "<img src=\"../rwidc.php?id=$uid\" alt=\"*\"/>";
  }else{
   $ilink = "<img src=\"$ilink\" alt=\"*\"/>";
  }
            $co++;
          if(canenter($room[0], $sid))
          {
            $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_chonline WHERE rid='".$room[0]."'"));
            if($room[2]=="")
            {
              echo "$ilink <a href=\"chat.php?&rid=$room[0]&sid=$sid\">".htmlspecialchars($room[1])."($noi[0])</a><br/>";
            }else{
              echo htmlspecialchars($room[1]);
              echo "$ilink <form action=\"chat.php\" method=\"get\">";
              echo "<br/><input format=\"*x\" name=\"rpw\" maxlength=\"10\"/><br/>";
              echo "<input type=\"submit\" value=\"GO\"/>";
              echo "<input type=\"hidden\" name=\"rid\" value=\"$room[0]\"/>";
              echo "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
              echo "</form>";

            }
          }
        }
Leviathan73 Senior · 260 posts #18

something, this is the code ok, now we must fix

$ilink = "<img src=\"../rwidc.php?id=$uid\" alt=\"*\"/>";

this picture I do not want, and then the name of the room is next door and I want it under the image, and then no one sees how many employees are there in the room. I tried to change, but there it made ..

Leviathan73 Senior · 260 posts #19

I modified the code like this

$rooms = mysql_query("SELECT id, name, pass, pic FROM ibwf_rooms WHERE static='0'");
        $co=0;
        while ($room= mysql_fetch_array($rooms))
        {
$ilink = trim($room[3]);
  if($ilink=="")
  {
   $ilink = "<img src=\"$ilink\" alt=\"*\"/><br/>";
  
            $co++;
          if(canenter($room[0], $sid))
          
            {
              echo "$ilink <a href=\"chat.php?&rid=$room[0]&sid=$sid\">".htmlspecialchars($room[1])."</a><br/>";
            }else{
              echo htmlspecialchars($room[1]);
              echo "$ilink <form action=\"chat.php\" method=\"get\">";
              echo "<br/><input format=\"*x\" name=\"rpw\" maxlength=\"10\"/><br/>";
              echo "<input type=\"submit\" value=\"GO\"/>";
              echo "<input type=\"hidden\" name=\"rid\" value=\"$room[0]\"/>";
              echo "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
              echo "</form>";
            }
          }
        }

but there are two problems: the first is when I get a picture, External image (may be gone) (universal3000.altervista.org/chat_universal2/uploaded/files/love.gif) you see, the image is loaded. The second problem is that when I open another private room, trim my name two bedrooms with double photo that is not seen. Would be the other room that I had opened before. how to resolve these two problems?😐

wapmetal Lead · 609 posts #20

Leviathan73 wrote: I modified the code like this

$rooms = mysql_query("SELECT id, name, pass, pic FROM ibwf_rooms WHERE static='0'");
        $co=0;
        while ($room= mysql_fetch_array($rooms))
        {
$ilink = trim($room[3]);
  if($ilink=="")
  {
   $ilink = "<img src=\"$ilink\" alt=\"*\"/><br/>";
  
            $co++;
          if(canenter($room[0], $sid))
          
            {
              echo "$ilink <a href=\"chat.php?&rid=$room[0]&sid=$sid\">".htmlspecialchars($room[1])."</a><br/>";
            }else{
              echo htmlspecialchars($room[1]);
              echo "$ilink <form action=\"chat.php\" method=\"get\">";
              echo "<br/><input format=\"*x\" name=\"rpw\" maxlength=\"10\"/><br/>";
              echo "<input type=\"submit\" value=\"GO\"/>";
              echo "<input type=\"hidden\" name=\"rid\" value=\"$room[0]\"/>";
              echo "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
              echo "</form>";
            }
          }
        }

but there are two problems: the first is when I get a picture, External image (may be gone) (universal3000.altervista.org/chat_universal2/uploaded/files/love.gif) you see, the image is loaded. The second problem is that when I open another private room, trim my name two bedrooms with double photo that is not seen. Would be the other room that I had opened before. how to resolve these two problems?😐

try this bro if it will work......

$rooms = mysql_query("SELECT id, name, pass, pic FROM ibwf_rooms WHERE static='0'");
        $co=0;
        while ($room= mysql_fetch_array($rooms))
        {

  
            $co++;
          if(canenter($room[0], $sid))
          
            {

$wapmetal = mysql_fetch_array(mysql_query("SELECT pic FROM ibwf_rooms WHERE rid='".$room[0]."'"));

  if($wapmetal=="")
  {
   $wapmetal = "<img src=\"$wapmetal\" alt=\"*\"/><br/>";

              echo "$wapmetal <a href=\"chat.php?&rid=$room[0]&sid=$sid\">".htmlspecialchars($room[1])."</a><br/>";
            }else{
              echo htmlspecialchars($room[1]);
              echo "<form action=\"chat.php\" method=\"get\">";
              echo "<br/><input format=\"*x\" name=\"rpw\" maxlength=\"10\"/><br/>";
              echo "<input type=\"submit\" value=\"GO\"/>";
              echo "<input type=\"hidden\" name=\"rid\" value=\"$room[0]\"/>";
              echo "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
              echo "</form>";
            }
          }
        }

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close