Trivia In Chat Room

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Trivia In Chat Room

    anyone have the lavalair script for trivia in chat room with a bot that put`s questions and multiple users are allowed in that room and answer his question ? post it here plz

    #2
    anyone have the lavalair script for trivia in chat room with a bot that put`s questions and multiple users are allowed in that room and answer his question ? post it here plz [/b]
    its not the work of a bot,if you see the chat.php there you will find $rminfo variable,freaky row name,its fixed withe admincp/ownercp.add a new field like
    Code:
    quiz tinyint(1) NOT NULL DEFAULT'0',
    in ibwf_room add options in admincp.php and UPDATE sql in adminproc.php for quiz row and the SELECT the quiz row in chat.php within $rminfo variable
    the find $chatok=mysql_query("INSERT....................... .) like ravebabe's sql command here the chatmsg field will bear the answer of the quiz.now for trivia you can use trivia used in wapdesire script to get quiz questions and answers.when any chatter will post correct answer use codes like this
    Code:
    if($answer=='$chatmsg')
    {
    echo .getnick_uid($array value used for useid in chat.php). " is correct";}
    then SELECT the correct answer poster and UPDATE his/her quiz points

    Comment


      #3
      I can`t find any $rminfo in chat.php

      Comment


        #4
        its not the work of a bot,if you see the chat.php there you will find $rminfo variable,freaky row name,its fixed withe admincp/ownercp.add a new field like
        Code:
        quiz tinyint(1) NOT NULL DEFAULT'0',
        in ibwf_room add options in admincp.php and UPDATE sql in adminproc.php for quiz row and the SELECT the quiz row in chat.php within $rminfo variable
        the find $chatok=mysql_query("INSERT....................... .) like ravebabe's sql command here the chatmsg field will bear the answer of the quiz.now for trivia you can use trivia used in wapdesire script to get quiz questions and answers.when any chatter will post correct answer use codes like this
        Code:
        if($answer=='$chatmsg')
        {
        echo .getnick_uid($array value used for useid in chat.php). " is correct";}
        then SELECT the correct answer poster and UPDATE his/her quiz points[/b]
        can i have a complete tutorial or your chat sript w/ quiz bro? thanks!

        Comment


          #5
          updates pls

          Comment


            #6
            Originally posted by coolboiz1 View Post
            updates pls
            just search for chat.php here.,it's on wap.net.ph script..a simple sql for that..
            My Blog: http://jhommark.blogspot.com
            My Facebook: http://www.facebook.com/jhommark
            My Official Site: http://www.undergroundweb.tk
            My Community Site: http://undergroundwap.xtreemhost.com

            Comment


              #7
              Why not use trivia script ??
              PHP Code:
              <?php

              /*
              Script wml
              Chat/Forum
              by Shad0w
              */

              include("config.php");
              include(
              "core.php");

              header("Content-type: text/vnd.wap.wml");
              header("Cache-Control: no-store, no-cache, must-revalidate");

              echo(
              "<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
              echo 
              "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";

              ?>

              <wml>


              <?php

              $bcon 
              = connectdb();
              if (!
              $bcon)
              {
                  echo 
              "<card id=\"main\" title=\"$numesite (ERROR!)\">";
                  echo 
              "<p align=\"center\">";
                  echo 
              "<img src=\"images/exit.gif\" alt=\"*\"/><br/>";
                  echo 
              "Eroare, nu se poate conecta la baza d date!<br/><br/>";
                  echo 
              "Aceasta eroare apare de obicei cand care serverul isi va reveni in cateva secunde!Daca problema persista va rugam sa luati legatura cat mai curand posibil cu Shad0w<br/><br/>";
                  echo 
              "<b>Va multumim foarte mult pentru intelegere!</b>";
                  echo 
              "</p>";
                  echo 
              "</card>";
                  echo 
              "</wml>";
                  exit();
              }
              $brws = explode(" / ",$HTTP_USER_AGENT);
              $ubr = $brws[0];
              $uip = $REMOTE_ADDR;
              $joc = $_GET["joc"];
              $actiune = $_GET["actiune"];
              $action = $_GET["action"];

              $sid = $_GET["sid"];
              $page = $_GET["page"];
              $who = $_GET["who"];
              $pmid = $_GET["pmid"];
              $lol = $_GET["lol"];
              $uid = getuid_sid($sid);
              $r = rand(0,100000);
              $start = gettime();


              cleardata();

              if((
              $joc != "") && ($joc!="terms"))
              {
                  
              $uid = getuid_sid($sid);
                   if((
              islogged($sid)==FALSE)||($uid==0))
                  {
                    echo 
              "<card id=\"main\" title=\"$numesite\">";
                    echo 
              "<p align=\"center\">";
                    echo 
              "<img src=\"images/notok.gif\" alt=\"X\"/>Nu esti autentificat<br/>";
                    echo 
              "Sau sesiunea ta a expirat<br/><br/>";
                    echo 
              "»<a href=\"index.php\">Autentificare</a>«";
                    echo 
              "</p>";
                    echo 
              "</card>";
                    echo 
              "</wml>";
                    exit();
                  }
                  }

              if(
              isbanned($uid))
                  {
                    echo 
              "<card id=\"main\" title=\"$numesite\">";
                    echo 
              "<p align=\"center\">";
                    echo 
              "<img src=\"images/notok.gif\" alt=\"x\"/><br/>";
                    echo 
              "Esti <b>Banat(a)</b><br/>";
                    
              $banto = mysql_fetch_array(mysql_query("SELECT timeto, pnreas, exid FROM lib3rtymrc_penalties WHERE uid='".$uid."' AND penalty='1' OR uid='".$uid."' AND penalty='2'"));
                    
              $banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM lib3rtymrc_users WHERE id='".$uid."'"));
                    
              $remain = $banto[0]- time();
                    
              $rmsg = gettimemsg($remain);
                    echo 
              "Timp ramas pana la debanare: $rmsg<br/>";
                     
              $nick = getnick_uid($banto[2]);
                    echo 
              "By: $nick<br/>";
                    echo 
              "Motiv ban: $banres[0]";
                    echo 
              "</p>";
                    echo 
              "</card>";
                    echo 
              "</wml>";
                    exit();
                  }



              ///////////////////////////////////time
              $res = mysql_fetch_array(mysql_query("SELECT lastact FROM lib3rtymrc_users WHERE id='".$uid."'"));
              $lastact = $res[0];
              $atime = time() - $lastact;

              if(
              $atime<1800){
                  
              $res = mysql_fetch_array(mysql_query("SELECT otime, mtime FROM lib3rtymrc_users where id='".$uid."'"));
                  
              $otime = $res[0] + $atime;
                  
              $mtime = $res[1] + $atime;
                  
              $res = mysql_query("UPDATE lib3rtymrc_users SET otime='".$otime."', mtime='".$mtime."' where id='".$uid."'");
              }
              //////////////////////////////////////

               
              $timeto = 600;
                          
              $timenw = time();
                          
              $timeout = $timenw-$timeto;
                          
              $deleted = mysql_query("DELETE FROM trivia WHERE timp<".$timeout."");
              /////////////////////////////////////inceput camera trivia


               
              addtotrivia($uid);
               
              $timeto = 300;
                          
              $timenw = time();
                          
              $timeout = $timenw-$timeto;
                          
              $deleted = mysql_query("DELETE FROM trivia WHERE timp<".$timeout."");
              $nick = getnick_sid($sid);

              if(
              $joc=="trivia")
              {
               
              $numeutilizator = getnick_sid($sid);      
               echo 
              "<card id=\"main\" title=\"$numeutilizator@trivia\" ontimer=\"trivia.php?joc=trivia&amp;sid=$sid&amp;wap=$r\"><timer value=\"120\"/>";
              echo 
              "<p>";
                   
              $uid = getuid_sid($sid);
                   
              $whonick = getnick_uid($who);
                  
              $nick = getnick_sid($sid);
                  
              addonline(getuid_sid($sid),"Joaca trivia","trivia.php?joc=$joc&amp;timp=$r");
              ////////////  de aici incepe
              $cerere = @mysql_query("select `mesaj` from trivia where uid='".$uid."' order by id desc;");
              $anterior = @mysql_fetch_array($cerere);
              $mesaj=htmlspecialchars(stripslashes(trim($mesaj)));
              if(!empty(
              $mesaj) && $mesaj!=$anterior['mesaj'])
              {
              @
              mysql_query("SELECT uid FROM trivia");
              $chnick = getnick_uid($chat[0]);
              $whonick = getnick_uid($who);
              $chatok = mysql_query("INSERT INTO trivia SET  id=0, uid='".$uid."', mesaj='$mesaj', timp='".time()."', valid=0;");
              $mama_matii=mysql_fetch_array(mysql_query("SELECT chmsgs  FROM lib3rtymrc_users WHERE id='".$uid."'"));
              $totl = $mama_matii[0]+1;
              $msgst= mysql_query("UPDATE lib3rtymrc_users SET chmsgs='".$totl."' WHERE id='".$uid."'");
              } 
              $chats = mysql_query("SELECT `identificare`,`raspuns`,`timp` FROM trivia WHERE uid='' ORDER BY id DESC;");
              $trivie = @mysql_fetch_array($chats);
              $chat3 = @mysql_query("select * from lib3rtymrc_intrebari;");
              $numar = @mysql_num_rows($chat3);
              $wap = $trivie['identificare'];
              if(empty(
              $wap)) 
              $wap = rand(1,$numar);
              $cerere2 = @mysql_query("select * from lib3rtymrc_intrebari where id='$wap';");
              $cerere = @mysql_fetch_array($cerere2);
              $intrebare2 = $cerere['intrebare'];
              $webadv = strtolower($cerere['raspuns']);
              $mesaj = strtolower($mesaj);
              $dan = $trivie['raspuns'];
              $intrebare = $trivie['identificare'];
              $time = $trivie['timp'];
              $litere = strlen($webadv);
              $now = time();
              //$xfile = @file("1.txt");
              //$random_num = rand (0,count($xfile)-1);
              //$udata = explode("::",$xfile[$random_num]);
              if($intrebare) 
              {
              if((
              $now < $time + 100)&&(empty($dan))) 
              {
              if(
              preg_match("/$webadv/i","$mesaj")) 
              {

              $mama_matii=mysql_fetch_array(mysql_query("SELECT trivia FROM lib3rtymrc_users WHERE id='".$uid."'"));
              @
              mysql_query("update lib3rtymrc_users set trivia=".($mama_matii[0]+ "1")." where id='".$uid."'"); 
              $uid = getuid_sid($sid);
              $whonick = getnick_uid($who);
              $nick = getnick_sid($sid);
              echo 
              "<img src=\"images/ok.gif\" alt=\".\"/>";
              @
              mysql_query("INSERT INTO trivia SET  id=0, timp='".time()."',mesaj='Bravo $nick!Raspunsul era: $webadv!Ai castigat 1 punct Total:".($mama_matii[0]+ "1")." puncte!', valid=1;"); 

              @
              mysql_query("update trivia set raspuns='1' where identificare='$wap' and uid=''");
              }
              }else{
              if(empty(
              $dan)&&(!empty($intrebare)))
              $chat = mysql_query("INSERT INTO trivia SET  id=0, timp='".time()."', mesaj='Raspunsul era: $webadv!', identificare='0', raspuns='0', valid=1;");
              }
              }else{
              $chat = mysql_query("INSERT INTO trivia SET  id=0, timp='".time()."', mesaj='$intrebare2', identificare='$wap', raspuns='0', valid=1;");
              }
              /////////////////////////boot trivia inceput
              $num_msgs1=2;
              $sql = "SELECT id, uid, mesaj, timp FROM trivia WHERE valid='1' ORDER BY id desc limit $num_msgs1;";
              $posts = mysql_query($sql);
              while(
              $post = mysql_fetch_array($posts))
              {
              $unick = getnick_uid($post[1]);
              $usl = "";
              //$pst = parsemsg($post[2], $sid);
              $pst = htmlspecialchars($post[2]);
              echo 
              "<small>$pst</small><br/>";
                }
              echo 
              "<small>------</small><br/>";
              ////////////////////////////////boot trivia sfarsit //////////
              ///////////////////////////////////// meniu
                
              echo "<small><a href=\"#scrie\">scrie</a>|</small>";
                echo 
              "<small><a href=\"trivia.php?joc=trivia&amp;sid=$sid&amp;wap=$r\">reload</a></small><br/>";
                 
              $chatters=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_onlinetrivia"));
                 echo 
              "<small>conectati:<a href=\"trivia.php?action=conectati&amp;sid=$sid&amp;wap=$r\">[$chatters[0]]</a></small>";
                      
              $unreadinbox=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_private WHERE unread='1' AND touid='".$uid."'"));
                      
                      
              $pmtotl=mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_private WHERE touid='".$uid."'"));
                      
              $unrd="[".$unreadinbox[0]."]";
                      if (
              $unreadinbox[0]>0)
                      {
                  
                          
                      echo 
              "<small>Ai: <a href=\"posta.php?action=main&amp;sid=$sid\">$unrd</a> PMs</small>";
                      }
                          
                    
              //  echo " <br/>";

              ///////////////blocheaza pc inceput
              $browser = mysql_fetch_array(mysql_query("SELECT browserm FROM lib3rtymrc_users WHERE id='".$uid."'"));
              if(!
              isoprit($browser[0],$uid)) 
              {
              }else{
              if(
              istrashed($uid))
                  {
                
                  }else{

                  }
                      }    
              ////////////////////////////////////////////
               
              $num_msgs=12;
               
              $sql = "SELECT id, uid, mesaj, timp FROM trivia WHERE valid='0' ORDER BY id desc limit $num_msgs;";
                
              $posts = mysql_query($sql);
                while(
              $post = mysql_fetch_array($posts))
                {
                
                  
              $unick = getnick_uid($post[1]);
                  
              $dtot = date("H:i:s",$post[3]);
                  
              $nopl = mysql_fetch_array(mysql_query("SELECT sex FROM lib3rtymrc_users WHERE id='".$post[1]."'"));
                  if(
              $nopl[0]=='M')
                    {
                  
              $usex = "B";
                  }else if(
              $nopl[0]=='F'){
                  
              $usex = "F";
                  }else{
                  
              $usex = "<img src=\"images/unknown.gif\" alt=\".\"/>";
                     }
                  
              $sim = getsimbol($post[1]);
                  
              $usl = "$usex»<a href=\"index.php?action=viewuser&amp;sid=$sid&amp;who=$post[1]\">$sim$unick</a>-$dtot";
                  
              $pst = htmlspecialchars($post[2]);
                  echo 
              "<small><br/>$usl<br/> $pst <br/>-----</small>";
                 }
                 echo 
              "<br/>";
              $lib3rtymrc_intrebari = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM lib3rtymrc_intrebari"));
              //echo "<br/>";
              echo "<small><b>Intrebari:$lib3rtymrc_intrebari[0]</b></small><br/>";
              echo 
              "<small><a href=\"trivia.php?actiune=top&amp;sid=$sid&amp;wap=$r\">Top trivia</a>|</small>";
              //echo "<small><a href=\"index.php?action=setari&amp;sid=$sid\">setari</a>|</small>";
              echo "<small><a href=\"forum.php?action=forum&amp;sid=$sid\">forum</a>|</small>";
              echo 
              "<small><a href=\"index.php?action=main&amp;sid=$sid\">prim</a></small>";


              echo 
              "</p></card>";
              ////////////////aici meniul de scriere

              echo "<card id=\"scrie\" title=\"Scrie mesaj pe trivia\">";
              addonline(getuid_sid($sid),"Scrie mesaj pe trivia","");
              echo 
              "<p><input name=\"mesaj$r\"/><br/>";
              echo 
              "<small>»<anchor>scrie<go href=\"trivia.php?joc=trivia&amp;sid=$sid&amp;wap=$r\" method=\"post\">";
              echo 
              "<postfield name=\"mesaj\" value=\"$(mesaj$r)\"/></go></anchor></small>";
              echo 
              "<br/><br/><small>----</small><br/>";
              echo 
              "<small>«<a href=\"trivia.php?joc=trivia&amp;sid=$sid&amp;wap=$r\">Inapoi pe trivia</a></small></p></card>";
              }
              //////////////////////////////conectati
                
              else if ($action=="conectati")           
                    {
                      echo 
              "<card id=\"main\" title=\"Conectati chat\">";
                      echo 
              "<p align=\"left\">";
                      
              addonline(getuid_sid($sid),"Conectati trivia","trivia.php?joc=$joc&amp;wap=$r");
                      
              $inside=mysql_query("SELECT DISTINCT * FROM lib3rtymrc_onlinetrivia WHERE uid IS NOT NULL");
                      while(
              $ins=mysql_fetch_array($inside))
                      {

                       
              $nopl = mysql_fetch_array(mysql_query("SELECT sex FROM lib3rtymrc_users WHERE id='".$ins[1]."'"));
                        if(
              $nopl[0]=='M')
                        {
                        
              $usex = "<img src=\"images/male2.gif\" alt=\".\"/>";
                        }else if(
              $nopl[0]=='F'){
                        
              $usex = "<img src=\"images/female2.gif\" alt=\".\"/>";
                        }else{
                         
              $usex = "<img src=\"images/unknown.gif\" alt=\".\"/>";
                        }
                        
              $sim = getsimbol($ins[1]);
                        
              $unick = getnick_uid($ins[1]);
                        
              $userl = "<small>»$usex<a href=\"index.php?action=viewuser&amp;who=$ins[1]&amp;sid=$sid\">$sim$unick</a></small><br/>";
                        echo 
              "$userl";
                      }
                      echo 
              "<br/><small>-----<br/>";
                      echo 
              "«<a href=\"trivia.php?joc=trivia&amp;sid=$sid&amp;wap=$r\">inapoi la trivia</a><br/>";
                      echo 
              "»<a href=\"trivia.php?actiune=top&amp;sid=$sid&amp;wap=$r\">top trivia</a><br/>";
                      echo 
              "«<a href=\"index.php?action=main&amp;sid=$sid\">meniu prim</a><br/>";
                      
                      echo 
              "</small></p>";
                      echo 
              "</card>";
                    }
              //////////////////////////////////Top trivia

              else if($actiune=="top")
              {
                  
              addonline(getuid_sid($sid),"Vizualizeaza Top trivia","trivia.php?actiune=$actiune&amp;wap=$r");
                  echo 
              "<card id=\"main\" title=\"Top trivia\">";
                  echo 
              "<p align=\"center\">";
                  echo 
              "<b>Top trivia</b>";
                  echo 
              "</p>";
                   
               
                  
              //////ALL LISTS SCRIPT <<

                  
              if($page=="" || $page<=0)$page=1;
                  
              $num_items = regmemcount(); //changable
                  
              $items_per_page= 20;
                  
              $num_pages = ceil($num_items/$items_per_page);
                  if((
              $page>$num_pages)&&$page!=1)$page= $num_pages;
                  
              $limit_start = ($page-1)*$items_per_page;

                  
              //changable sql

                      
              $sql = "SELECT id, name, trivia FROM lib3rtymrc_users ORDER BY trivia DESC LIMIT $limit_start, $items_per_page";


                  echo 
              "<p>";
                  
              $items = mysql_query($sql);
                   
              //$cou =1;
                  
              $cou = $limit_start;
                  echo 
              mysql_error();
                  if(
              mysql_num_rows($items)>0)
                  {
                  while (
              $item = mysql_fetch_array($items))
                  {
                    
              $cou++;
                    
              $simbol = getsimbol($item[0]);
                    
              $lnk = "<small>$cou) <a href=\"index.php?action=viewuser&amp;who=$item[0]&amp;sid=$sid\"> $simbol$item[1]</a>:  $item[2] puncte</small>";
                    echo 
              "$lnk<br/>";
                
                  }
                  }
                  echo 
              "</p>";
                  echo 
              "<p align=\"left\">";
                  if(
              $page>1)
                  {
                    
              $ppage = $page-1;
                    echo 
              "<small>«<a href=\"trivia.php?actiune=top&amp;page=$ppage&amp;sid=$sid&amp;view=$view\">pagina anterioara</a></small><br/> ";
                 }
                  if(
              $page<$num_pages)
                  {
                    
              $npage = $page+1;
                    echo 
              "<small>»<a href=\"trivia.php?actiune=top&amp;page=$npage&amp;sid=$sid&amp;view=$view\">pagina urmatoare</a></small>";
                  }
                  echo 
              "<br/>$page/$num_pages<br/>";
                  if(
              $num_pages>2)
                  {
                    
              $rets = "Dute la pagina:<input name=\"pg\" format=\"*N\" size=\"3\"/>";
                      
              $rets .= "<anchor>[dute]";
                      
              $rets .= "<go href=\"trivia.php\" method=\"get\">";
                      
              $rets .= "<postfield name=\"actiune\" value=\"$actiune\"/>";
                      
              $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
                      
              $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
                      
              $rets .= "</go></anchor>";

                      echo 
              $rets;
                  }
                  echo 
              "</p>";
                 
              /////////// pana aici /////////
                
              echo "<p align=\"center\">";
                echo 
              "<small>«<a href=\"trivia.php?joc=trivia&amp;sid=$sid&amp;wap=$r\">inapoi la trivia</a></small><br/>";
                echo 
              "<small><a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
                echo 
              "Prim</a></small>";
                include(
              "syr.php");
                echo 
              "</p>";
                echo 
              "</card>";
              }
              ///////////////////////////// sfarsit trivia //////
              else{
                echo 
              "<card id=\"main\" title=\"$numesite\">";
                echo 
              "<p align=\"center\">";
                echo 
              "<small>Nu stiu cum ai ajuns aici,dar nu ai ce vedea<br/><br/>";
                echo 
              "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
                echo 
              "Prim</a></small>";
                echo 
              "</p></card>";
              }

              ?>

              </wml>
              whatmp3.name - search mp3 on mobile

              Comment


                #8
                He wants the trivia room..I've done it in my site..Just giving him instructions and make it with himself..
                My Blog: http://jhommark.blogspot.com
                My Facebook: http://www.facebook.com/jhommark
                My Official Site: http://www.undergroundweb.tk
                My Community Site: http://undergroundwap.xtreemhost.com

                Comment

                Working...
                X