Creates room with picture

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new 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
    PHP 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
    PHP Code:
    addonline($uid,"Chat in $rname ($mmsg)","chat.php?rid=$rid&amp;rpw=$rpw");
            
    //echo "<p>";
            
    echo popup($sid);
            echo 
    "<b>1 </b><a name=\"top\" id=\"top\" accesskey=\"1\" href=\"chat.php?action=say&amp;sid=$sid&amp;rid=$rid&amp;rpw=$rpw\">write</a><br/>"

    Comment


      #17
      something like this for outside the chatroom:
      Code:
              $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?&amp;rid=$room[0]&amp;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>";
      
                  }
                }
              }

      Comment


        #18
        something, this is the code ok, now we must fix
        PHP Code:
        $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 ..

        Comment


          #19
          I modified the code like this
          PHP Code:
          $rooms mysql_query("SELECT id, name, pass, pic FROM ibwf_rooms WHERE static='0'");
                  
          $co=0;
                  while (
          $roommysql_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?&amp;rid=$room[0]&amp;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,
          (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?

          Comment


            #20
            Originally posted by Leviathan73 View Post
            I modified the code like this
            PHP Code:
            $rooms mysql_query("SELECT id, name, pass, pic FROM ibwf_rooms WHERE static='0'");
                    
            $co=0;
                    while (
            $roommysql_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?&amp;rid=$room[0]&amp;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,
            (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......


            Code:
            $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?&amp;rid=$room[0]&amp;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>";
                        }
                      }
                    }
            Last edited by wapmetal; 12.11.09, 00:56. Reason: i got new idea!
            com site: http://vampist.net
            download site: http://wapdloads.net
            fb: http://www.facebook.com/pmplx

            Comment


              #21
              Originally posted by wapmetal View Post
              try this bro if it will work......


              Code:
              $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?&amp;rid=$room[0]&amp;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>";
                          }
                        }
                      }


              from select querry below u can also use this

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

              i havent try this and you must try it...
              i dont use lava anymore...
              com site: http://vampist.net
              download site: http://wapdloads.net
              fb: http://www.facebook.com/pmplx

              Comment


                #22
                why do u need to call pic from database for a second time?

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

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

                unnessary calls from database causes lag.

                also your coding says if there is a picture on the room then it is password protected?

                Comment


                  #23
                  just change:
                  $ilink = "<img src=\"../rwidc.php?id=$uid\" alt=\"*\"/>";
                  to what ever standard image you want

                  Comment


                    #24
                    you will need to add another input box on index.php?action=mkroom
                    eg:
                    echo "<input name=\"pic\" maxlength=\"255\" value=\"http://\"/>";

                    and then on genproc.php?action=mkroom

                    you will need to collect the POST varible (pic) an insert it into database along with the original sql update

                    eg:

                    , pic='".$pic."'

                    Comment


                      #25
                      I did this in the file index.php
                      [PHP]echo "<form action=\"genproc.php?action=pic&amp;pic='".$pic."' \" method=\"post\">";
                      echo "<form action=\"genproc.php?action=mkroom&amp;sid=$sid\" method=\"post\">";
                      echo "<form action=\"genproc.php?action=mkroom&amp;sid=$sid\" method=\"post\">";
                      echo "Add Image:<input name=\"pic\" maxlength=\"255\" value=\"http://\"/><br/>";[/PHP]
                      in the file chat.php done this
                      PHP Code:
                      $wapmetal mysql_fetch_array(mysql_query("SELECT pic FROM ibwf_rooms WHERE rid='".$room[0]."'"));
                              
                      $co=0;
                              while (
                      $roommysql_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?&amp;rid=$room[0]&amp;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>";
                                  }
                                }
                              } 
                      and when I create room leads me to login on the home..

                      Comment


                        #26
                        Originally posted by Leviathan73 View Post
                        I did this in the file index.php
                        [PHP]echo "<form action=\"genproc.php?action=pic&amp;pic='".$pic."' \" method=\"post\">";
                        echo "<form action=\"genproc.php?action=mkroom&amp;sid=$sid\" method=\"post\">";
                        echo "<form action=\"genproc.php?action=mkroom&amp;sid=$sid\" method=\"post\">";
                        echo "Add Image:<input name=\"pic\" maxlength=\"255\" value=\"http://\"/><br/>";[/PHP]
                        in the file chat.php done this
                        PHP Code:
                        $wapmetal mysql_fetch_array(mysql_query("SELECT pic FROM ibwf_rooms WHERE rid='".$room[0]."'"));
                                
                        $co=0;
                                while (
                        $roommysql_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?&amp;rid=$room[0]&amp;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>";
                                    }
                                  }
                                } 
                        and when I create room leads me to login on the home..
                        i cant understand...
                        com site: http://vampist.net
                        download site: http://wapdloads.net
                        fb: http://www.facebook.com/pmplx

                        Comment


                          #27
                          tnt

                          Originally posted by something else View Post
                          why do u need to call pic from database for a second time?

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

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

                          unnessary calls from database causes lag.

                          also your coding says if there is a picture on the room then it is password protected?

                          lol wots the BIg thing on this??
                          i just forgot to remove the 'pic'








                          i used this
                          $wapmetal = mysql_fetch_array(mysql_query("SELECT pic FROM ibwf_rooms WHERE rid='".$room[0]."'"));
                          cus i was pointing in the rid='".$room[0]."' so it will surely follow its order
                          lol
                          Last edited by wapmetal; 12.11.09, 12:17.
                          com site: http://vampist.net
                          download site: http://wapdloads.net
                          fb: http://www.facebook.com/pmplx

                          Comment


                            #28
                            yeah if u keep requesting from database it will cause you lag....
                            when u can request it at the same time .... both ways work but if you keep calling information every time you want a new variable from database you will end up with a very slow site
                            eg:


                            ------------------------
                            product | cost | stock
                            ------------------------
                            potatoes| 2.50 | 3000
                            ------------------------
                            oranges | 1.00 | 200
                            ------------------------
                            grapes | 1.70 | 500
                            ------------------------

                            ur coding first calls for the line say oranges in this case to see how many there is in stock...
                            (while your database has found oranges u could find cost out at same time.)

                            but instead your making the database re-find the line oranges for a second time to find out cost.


                            Thats why u can end up with a slow site if u make to many requests

                            So therefor requesting from this line:
                            $rooms = mysql_query("SELECT id, name, pass, pic FROM ibwf_rooms WHERE static='0'");

                            is quicker than requesting again for a second time here:

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

                            (even if pic wasnt in the top line)
                            Last edited by something else; 12.11.09, 17:31.

                            Comment


                              #29
                              I changed that
                              PHP Code:
                              $wapmetal mysql_fetch_array(mysql_query("SELECT pic FROM ibwf_rooms WHERE "));
                                      
                              $co=0;
                                      while (
                              $roommysql_fetch_array($rooms))
                                      {
                                
                                          
                              $co++;
                                        if(
                              canenter($room[0], $sid))
                                        
                                          {
                              $wapmetal mysql_fetch_array(mysql_query("SELECT pic FROM ibwf_rooms WHERE ")); 
                              but brings me to the login home..

                              Comment


                                #30
                                PHP Code:
                                        $rooms mysql_query("SELECT id, name, pass, pic FROM ibwf_rooms WHERE static='0'");
                                        
                                $co=0;
                                        while (
                                $roommysql_fetch_array($rooms))
                                        {
                                $ilink trim($room[3]);
                                  if(
                                $ilink=="")
                                  {
                                   
                                $ilink "<img src=\"default_image.gif\" 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?&amp;rid=$room[0]&amp;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>";

                                            }
                                          }
                                        } 
                                PHP Code:
                                    echo "<form action=\"genproc.php?action=mkroom&amp;sid=$sid\" method=\"post\">";
                                    echo 
                                "Room Name: <input name=\"rname\" maxlength=\"30\"><br/>";
                                    echo 
                                "Password: <input name=\"rpass\" style=\"-wap-input-format: '*x'\" maxlength=\"10\"><br/>";
                                    echo 
                                "Pic Url: <input name=\"pic\" maxlength=\"255\" value=\"http://\"/><br/>";
                                    echo 
                                "<input type=\"Submit\" name=\"Create\" Value=\"Create\"></form>"
                                PHP Code:
                                $pic mysql_escape_string($_POST["pic"]);
                                $pic htmlspecialchars($pic);
                                        
                                $res mysql_query("INSERT INTO ibwf_rooms SET name='".$rname."', pass='".$rpass."', censord='".$cns."', static='0', lastmsg='".time()."', pic='".$pic."'"); 
                                Last edited by something else; 12.11.09, 17:32.

                                Comment

                                Working...
                                X