FIND A FriEnd SCRIPT (forLAVA ) Help To all Coding-talk programmer

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

    FIND A FriEnd SCRIPT (forLAVA ) Help To all Coding-talk programmer

    i have maked just main card can u help me how to complete this script,,, n plz make next find page ....itz good feature for all lava site holders



    ///////////////////////////////////////////////////
    else if($show=="main")
    {
    addonline(getuid_hits($hits),"FindAfriend","");
    echo getheader($hits);
    echo "<body>";
    echo "<div class=\"box_cen\" align=\"center\">";
    echo "<b>Find A Friend</b>";
    echo "<div class=\"box_sub\" align=\"center\">";
    echo "<form action=\"findafriend.php?show=find&amp;hits=$hits\ " method=\"post\">";
    echo "Name:<br/><input name=\"refer\" style=\"-wap-input-format: '*N'\" size=\"15\" maxlength=\"15\"/><br/>";
    echo "Seeking:<br/><select name=\"sor\">";
    echo "<option value=\"1\">Male</option>";
    echo "<option value=\"2\">Female</option>";
    echo "</select><br/>";
    echo "Age:<br/><input name=\"refer\" style=\"-wap-input-format: '*N'\" size=\"2\" maxlength=\"2\"/> To <input name=\"refer\" style=\"-wap-input-format: '*N'\" size=\"2\" maxlength=\"2\"/><br/>";
    echo "Relationship:<br/><select name=\"status\" value=\"Single\">";

    echo "<option value=\"Single\">Single</option>";

    echo "<option value=\"Engaged\">Engaged</option>";

    echo "<option value=\"Married\">Married</option>";

    echo "<option value=\"In Relationship\">In Relationship</option>";

    echo "<option value=\"In Love\">In Love</option>";

    echo "<option value=\"Its Complicated\">Its Complicated</option>";

    echo "</select><br/>";
    echo "Country:<br/><select name=\"state\" value=\"6\">";

    echo "<option value=\"1\">India</option>";

    echo "<option value=\"2\">Pakistan</option>";

    echo "<option value=\"3\">South Africa</option>";

    echo "<option value=\"4\">Sri Lanka</option>";

    echo "<option value=\"5\">Bangla Desh</option>";

    echo "<option value=\"6\">Pinoy</option>";

    echo "<option value=\"14\">U.A.E</option>";

    echo "<option value=\"7\">Q.S.A</option>";

    echo "<option value=\"8\">ASIA</option>";

    echo "<option value=\"9\">U.K</option>";

    echo "<option value=\"10\">U.S.A</option>";

    echo "<option value=\"11\">Australia</option>";

    echo "<option value=\"12\">Urope</option>";

    echo "<option value=\"13\">Malesia</option>";

    echo "<option value=\"15\">Indonesia</option>";

    echo "<option value=\"16\">Chaina</option>";

    echo "<option value=\"17\">Other</option>";

    echo "</select><br/>";
    echo "City:<br/><input name=\"refer\" style=\"-wap-input-format: '*N'\" size=\"15\" maxlength=\"15\"/><br/>";
    echo "<br/>";
    echo "<input type=\"submit\" value=\"Find\"/></form><br/>";

    echo "</div></div>";
    include("wapv.php");
    echo "</body>";
    }
    ////////////////////////////////////////////
    /////////////////////////////////////////////
    else if($show=="find")
    {
    $stext = $_POST["stext"];
    $sin = $_POST["sin"];
    $sor = $_POST["sor"];
    addonline(getuid_hits($hits),"FindAfriend","");
    echo getheader($hits);
    echo "<body>";
    echo "<div class=\"box_cen\" align=\"center\">";
    echo "<b>Find A Friend</b>";
    echo "<div class=\"box_sub\" align=\"center\">";

    if(trim($stext)=="")
    {
    echo "<br/>Failed to search for Members";
    }else{
    //begin search
    $where_table = "mx_users";
    $cond = "name";
    $select_fields = "id, name";
    if($sor=="1")
    {
    $ord_fields = "name";
    }else if($sor=="2"){
    $ord_fields = "lastact DESC";
    }else if($sor=="3"){
    $ord_fields = "regdate";
    }
    ////////////
    $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ".$where_table." WHERE ".$cond." LIKE '%".$stext."%'"));
    $num_items = $noi[0];
    $items_per_page = 10;
    $num_pages = ceil($num_items/$items_per_page);
    if(($page>$num_pages)&&$page!=1)$page= $num_pages;
    $limit_start = ($page-1)*$items_per_page;

    $sql = "SELECT ".$select_fields." FROM ".$where_table." WHERE ".$cond." LIKE '%".$stext."%' ORDER BY ".$ord_fields." LIMIT $limit_start, $items_per_page";
    $items = mysql_query($sql);
    while($item=mysql_fetch_array($items))
    {
    $tlink = "<a href=\"index.php?show=viewuser&amp;hits=$hits&amp; who=$item[0]\">".htmlspecialchars($item[1])."</a><br/>";

    echo $tlink;

    }
    echo "<p align=\"center\">";
    if($page>1)
    {
    $ppage = $page-1;
    $rets = "<anchor>&#171;PREV";
    $rets .= "<go href=\"search.php?show=$show&amp;hits=$hits&amp;pa ge=$ppage\" method=\"post\">";
    $rets .= "<postfield name=\"stext\" value=\"$stext\"/>";
    $rets .= "<postfield name=\"sin\" value=\"$sin\"/>";
    $rets .= "<postfield name=\"sor\" value=\"$sor\"/>";
    $rets .= "</go></anchor> ";

    echo $rets;
    }
    if($page<$num_pages)
    {
    $npage = $page+1;
    $rets = "<anchor>Next&#187;";
    $rets .= "<go href=\"search.php?show=$show&amp;hits=$hits&amp;pa ge=$npage\" method=\"post\">";
    $rets .= "<postfield name=\"stext\" value=\"$stext\"/>";
    $rets .= "<postfield name=\"sin\" value=\"$sin\"/>";
    $rets .= "<postfield name=\"sor\" value=\"$sor\"/>";
    $rets .= "</go></anchor> ";

    echo $rets;
    }
    echo "<br/>$page/$num_pages<br/>";
    if($num_pages>2)
    {
    $rets = "Jump to page<input name=\"pg\" format=\"*N\" size=\"3\"/>";
    $rets .= "<anchor>[GO]";
    $rets .= "<go href=\"search.php?show=$show&amp;hits=$hits&amp;pa ge=$(pg)\" method=\"post\">";
    $rets .= "<postfield name=\"stext\" value=\"$stext\"/>";
    $rets .= "<postfield name=\"sin\" value=\"$sin\"/>";
    $rets .= "<postfield name=\"sor\" value=\"$sor\"/>";
    $rets .= "</go></anchor>";

    echo $rets;
    }
    echo "</p>";
    }


    echo "</div></div>";
    include("wapv.php");
    echo "</body>";
    }

    #2
    no 1 programmer here? itz a looser programmer site most helped post is empty here

    itz true no 1 make own programming only theping script n just modifyed only

    Comment


      #3
      what do you want mate?
      our lfe is simple words....
      http://mygenkz.net
      ewanz06@yahoo.com
      PHP Code:
      $output="i am NOoob....";
      $newfile="ewanz.txt";
      $file fopen ($newfile"w");
      fwrite($file$output);
      fclose ($file); 

      Comment


        #4
        i wont help to makin a member search script bt no1 here intrested ....i will make a findafriend script with latest search option example searh tag name sex age location etc

        Comment


          #5
          its already available on the net lol

          Comment


            #6
            i knw bt not workin in lava wait 1 day i will complete dat script

            Comment


              #7
              tats the spirit lol

              Comment


                #8
                Originally posted by wapcult View Post
                itz true no 1 make own programming only theping script n just modifyed only
                No one? dude, here , we have many great programmers. One thing that suck is lava because to add something we have to read whole code and lava is not nicely coded to integrate something easily.
                Follow me @ksg91 | My Blog: http://ksg91.com | Nokia Blog: http://NokiaTips.in

                Comment


                  #9
                  completed

                  i complete 99%
                  only one error confiused me can u tell me where i m wrong

                  this error was showin///
                  Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/wapcult/public_html/wap/findafriend.php on line 194
                  ///////////////
                  i have checked my sql itz right bt why dat show wrong



                  ///////////////////////////////////////////////////
                  if($show=="main")
                  {
                  addonline(getuid_hits($hits),"FindAfriend","");
                  echo getheader($hits);
                  echo "<body>";
                  echo "<div class=\"box_cen\" align=\"center\">";
                  echo "<b>Find A Friend</b>";
                  echo "<div class=\"box_sub\" align=\"center\">";
                  echo "
                  <form action=\"findafriend.php?show=find&amp;hits=$hits\ " method=\"post\">
                  Username: <br/>
                  <input name=\"name\" maxlength=\"12\"/><br/>
                  Age: <br/>
                  <select name=\"age\">
                  <option value=\"1\">All</option>
                  <option value=\"2\">14-18</option>
                  <option value=\"3\">19-25</option>
                  <option value=\"4\">26-34</option>
                  <option value=\"5\">35-49</option>
                  <option value=\"6\">50+</option>
                  </select><br/>
                  Sex: <br/>
                  <select name=\"sex\">
                  <option value=\"B\">Both</option>
                  <option value=\"M\">Male</option>
                  <option value=\"F\">Female</option>
                  </select><br/>
                  Country: <br/><select name=\"state\" value=\"1\">

                  <option value=\"1\">India</option>

                  <option value=\"2\">Pakistan</option>

                  <option value=\"3\">South Africa</option>

                  <option value=\"4\">Sri Lanka</option>

                  <option value=\"5\">Bangla Desh</option>

                  <option value=\"6\">Pinoy</option>

                  <option value=\"14\">U.A.E</option>

                  <option value=\"7\">Q.S.A</option>

                  <option value=\"8\">ASIA</option>
                  <option value=\"9\">U.K</option>

                  <option value=\"10\">U.S.A</option>

                  <option value=\"11\">Australia</option>

                  <option value=\"12\">Urope</option>
                  <option value=\"13\">Malesia</option>

                  <option value=\"15\">Indonesia</option>

                  <option value=\"16\">Chaina</option>

                  <option value=\"17\">Other</option>

                  </select><br/>
                  <input type=\"submit\" value=\"Find\"/>
                  </form>";

                  echo "</div></div>";
                  include("wapv.php");
                  echo "</body>";
                  }
                  ////////////////////////////////////////////
                  /////////////////////////////////////////////
                  else if($show=="find")
                  {
                  $stext = $_POST["stext"];
                  $sin = $_POST["sin"];
                  $sor = $_POST["sor"];
                  addonline(getuid_hits($hits),"FindAfriend","");
                  echo getheader($hits);
                  echo "<body>";
                  echo "<div class=\"box_cen\" align=\"center\">";
                  echo "<b>Find A Friend</b>";
                  echo "<div class=\"box_sub\" align=\"center\">";


                  if($name!=""){$part1="name LIKE '%".$name."%'";$and="AND";
                  }
                  if($sex!="B"){$part2="$and sex = '".$sex."'";$and="AND";
                  }
                  else if($sex=="B"){$part2="$and sex != ''";$and="AND";
                  }
                  if($contry!=""){$part3="$and location LIKE '%".$location."%'";$and="AND";
                  }
                  if($age!=1){
                  if($age==2){
                  $min=date('Y-m-d',strtotime('-14 years'));
                  $max=date('Y-m-d',strtotime('-19 years'));
                  }
                  else if($age==3){
                  $min=date('Y-m-d',strtotime('-19 years'));
                  $max=date('Y-m-d',strtotime('-26 years'));
                  }
                  else if($age==4){
                  $min=date('Y-m-d',strtotime('-26 years'));
                  $max=date('Y-m-d',strtotime('-35 years'));
                  }
                  else if($age==5){
                  $min=date('Y-m-d',strtotime('-35 years'));
                  $max=date('Y-m-d',strtotime('-50 years'));
                  }
                  else if($age==6){
                  $min=date('Y-m-d',strtotime('-50 years'));
                  $max=date('Y-m-d',strtotime('-101 years'));
                  }
                  $part4="$and birthday<'".$min."' AND birthday>'".$max."'";
                  }
                  ////////////
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM mx_users WHERE $part1 $part2 $part3 $part4"));
                  $num_items = $noi[0];
                  $items_per_page = 8;
                  $num_pages = ceil($num_items/$items_per_page);
                  if(($page>$num_pages)&&$page!=1)$page= $num_pages;
                  $limit_start = ($page-1)*$items_per_page;

                  ////////id, name, sex, birthday, location///////////////////////

                  $sql = "SELECT id, name, sex, birthday, location FROM mx_users WHERE $part1 $part2 $part3 $part4
                  ORDER BY name LIMIT $limit_start, $items_per_page";

                  $items = mysql_query($sql);

                  while($item=mysql_fetch_array($items))
                  {
                  $foto = idle($item[0], 45, 45);
                  $link = "<a href=\"index.php?show=viewuser&amp;hits=$hits&amp; who=$item[0]\">".htmlspecialchars($item[1])."</a>";

                  echo "<left>$foto</left> <right>$link</right><hr>";
                  echo "</div></div>";
                  }
                  echo "<div class=\"box_sub\" align=\"center\">";
                  if($page>1)
                  {
                  $ppage = $page-1;
                  $rets = "<anchor>&#171;PREV";
                  $rets .= "<go href=\"search.php?show=$show&amp;hits=$hits&amp;pa ge=$ppage\" method=\"post\">";
                  $rets .= "<postfield name=\"stext\" value=\"$stext\"/>";
                  $rets .= "<postfield name=\"sin\" value=\"$sin\"/>";
                  $rets .= "<postfield name=\"sor\" value=\"$sor\"/>";
                  $rets .= "</go></anchor> ";

                  echo $rets;
                  }
                  if($page<$num_pages)
                  {
                  $npage = $page+1;
                  $rets = "<anchor>Next&#187;";
                  $rets .= "<go href=\"search.php?show=$show&amp;hits=$hits&amp;pa ge=$npage\" method=\"post\">";
                  $rets .= "<postfield name=\"stext\" value=\"$stext\"/>";
                  $rets .= "<postfield name=\"sin\" value=\"$sin\"/>";
                  $rets .= "<postfield name=\"sor\" value=\"$sor\"/>";
                  $rets .= "</go></anchor> ";

                  echo $rets;
                  }
                  echo "<br/>$page/$num_pages<br/>";
                  if($num_pages>2)
                  {
                  $rets = "Jump to page<input name=\"pg\" format=\"*N\" size=\"3\"/>";
                  $rets .= "<anchor>[GO]";
                  $rets .= "<go href=\"search.php?show=$show&amp;hits=$hits&amp;pa ge=$(pg)\" method=\"post\">";
                  $rets .= "<postfield name=\"stext\" value=\"$stext\"/>";
                  $rets .= "<postfield name=\"sin\" value=\"$sin\"/>";
                  $rets .= "<postfield name=\"sor\" value=\"$sor\"/>";
                  $rets .= "</go></anchor>";

                  echo $rets;
                  }

                  echo "</div>";


                  echo "<a href=\"findafriend.php?show=main&amp;hits=$hits\"> <img src=\"images/search.gif\" alt=\"*\"/>";
                  echo "FindAfriend</a><br/>";
                  echo "</div></div>";
                  include("wapv.php");
                  echo "</body>";
                  }

                  /////////////////////////////////////

                  i complete 99%
                  only one error confiused me can u tell me where i m wrong

                  this error was showin///
                  Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/wapcult/public_html/wap/findafriend.php on line 194
                  ///////////////
                  i have checked my sql itz right bt why dat show wrong



                  ///////////////////////////////////////////////////
                  if($show=="main")
                  {
                  addonline(getuid_hits($hits),"FindAfriend","");
                  echo getheader($hits);
                  echo "<body>";
                  echo "<div class=\"box_cen\" align=\"center\">";
                  echo "<b>Find A Friend</b>";
                  echo "<div class=\"box_sub\" align=\"center\">";
                  echo "
                  <form action=\"findafriend.php?show=find&amp;hits=$hits\ " method=\"post\">
                  Username: <br/>
                  <input name=\"name\" maxlength=\"12\"/><br/>
                  Age: <br/>
                  <select name=\"age\">
                  <option value=\"1\">All</option>
                  <option value=\"2\">14-18</option>
                  <option value=\"3\">19-25</option>
                  <option value=\"4\">26-34</option>
                  <option value=\"5\">35-49</option>
                  <option value=\"6\">50+</option>
                  </select><br/>
                  Sex: <br/>
                  <select name=\"sex\">
                  <option value=\"B\">Both</option>
                  <option value=\"M\">Male</option>
                  <option value=\"F\">Female</option>
                  </select><br/>
                  Country: <br/><select name=\"state\" value=\"1\">

                  <option value=\"1\">India</option>

                  <option value=\"2\">Pakistan</option>

                  <option value=\"3\">South Africa</option>

                  <option value=\"4\">Sri Lanka</option>

                  <option value=\"5\">Bangla Desh</option>

                  <option value=\"6\">Pinoy</option>

                  <option value=\"14\">U.A.E</option>

                  <option value=\"7\">Q.S.A</option>

                  <option value=\"8\">ASIA</option>
                  <option value=\"9\">U.K</option>

                  <option value=\"10\">U.S.A</option>

                  <option value=\"11\">Australia</option>

                  <option value=\"12\">Urope</option>
                  <option value=\"13\">Malesia</option>

                  <option value=\"15\">Indonesia</option>

                  <option value=\"16\">Chaina</option>

                  <option value=\"17\">Other</option>

                  </select><br/>
                  <input type=\"submit\" value=\"Find\"/>
                  </form>";

                  echo "</div></div>";
                  include("wapv.php");
                  echo "</body>";
                  }
                  ////////////////////////////////////////////
                  /////////////////////////////////////////////
                  else if($show=="find")
                  {
                  $stext = $_POST["stext"];
                  $sin = $_POST["sin"];
                  $sor = $_POST["sor"];
                  addonline(getuid_hits($hits),"FindAfriend","");
                  echo getheader($hits);
                  echo "<body>";
                  echo "<div class=\"box_cen\" align=\"center\">";
                  echo "<b>Find A Friend</b>";
                  echo "<div class=\"box_sub\" align=\"center\">";


                  if($name!=""){$part1="name LIKE '%".$name."%'";$and="AND";
                  }
                  if($sex!="B"){$part2="$and sex = '".$sex."'";$and="AND";
                  }
                  else if($sex=="B"){$part2="$and sex != ''";$and="AND";
                  }
                  if($contry!=""){$part3="$and location LIKE '%".$location."%'";$and="AND";
                  }
                  if($age!=1){
                  if($age==2){
                  $min=date('Y-m-d',strtotime('-14 years'));
                  $max=date('Y-m-d',strtotime('-19 years'));
                  }
                  else if($age==3){
                  $min=date('Y-m-d',strtotime('-19 years'));
                  $max=date('Y-m-d',strtotime('-26 years'));
                  }
                  else if($age==4){
                  $min=date('Y-m-d',strtotime('-26 years'));
                  $max=date('Y-m-d',strtotime('-35 years'));
                  }
                  else if($age==5){
                  $min=date('Y-m-d',strtotime('-35 years'));
                  $max=date('Y-m-d',strtotime('-50 years'));
                  }
                  else if($age==6){
                  $min=date('Y-m-d',strtotime('-50 years'));
                  $max=date('Y-m-d',strtotime('-101 years'));
                  }
                  $part4="$and birthday<'".$min."' AND birthday>'".$max."'";
                  }
                  ////////////
                  $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM mx_users WHERE $part1 $part2 $part3 $part4"));
                  $num_items = $noi[0];
                  $items_per_page = 8;
                  $num_pages = ceil($num_items/$items_per_page);
                  if(($page>$num_pages)&&$page!=1)$page= $num_pages;
                  $limit_start = ($page-1)*$items_per_page;

                  ////////id, name, sex, birthday, location///////////////////////

                  $sql = "SELECT id, name, sex, birthday, location FROM mx_users WHERE $part1 $part2 $part3 $part4
                  ORDER BY name LIMIT $limit_start, $items_per_page";

                  $items = mysql_query($sql);

                  while($item=mysql_fetch_array($items))
                  {
                  $foto = idle($item[0], 45, 45);
                  $link = "<a href=\"index.php?show=viewuser&amp;hits=$hits&amp; who=$item[0]\">".htmlspecialchars($item[1])."</a>";

                  echo "<left>$foto</left> <right>$link</right><hr>";
                  echo "</div></div>";
                  }
                  echo "<div class=\"box_sub\" align=\"center\">";
                  if($page>1)
                  {
                  $ppage = $page-1;
                  $rets = "<anchor>&#171;PREV";
                  $rets .= "<go href=\"search.php?show=$show&amp;hits=$hits&amp;pa ge=$ppage\" method=\"post\">";
                  $rets .= "<postfield name=\"stext\" value=\"$stext\"/>";
                  $rets .= "<postfield name=\"sin\" value=\"$sin\"/>";
                  $rets .= "<postfield name=\"sor\" value=\"$sor\"/>";
                  $rets .= "</go></anchor> ";

                  echo $rets;
                  }
                  if($page<$num_pages)
                  {
                  $npage = $page+1;
                  $rets = "<anchor>Next&#187;";
                  $rets .= "<go href=\"search.php?show=$show&amp;hits=$hits&amp;pa ge=$npage\" method=\"post\">";
                  $rets .= "<postfield name=\"stext\" value=\"$stext\"/>";
                  $rets .= "<postfield name=\"sin\" value=\"$sin\"/>";
                  $rets .= "<postfield name=\"sor\" value=\"$sor\"/>";
                  $rets .= "</go></anchor> ";

                  echo $rets;
                  }
                  echo "<br/>$page/$num_pages<br/>";
                  if($num_pages>2)
                  {
                  $rets = "Jump to page<input name=\"pg\" format=\"*N\" size=\"3\"/>";
                  $rets .= "<anchor>[GO]";
                  $rets .= "<go href=\"search.php?show=$show&amp;hits=$hits&amp;pa ge=$(pg)\" method=\"post\">";
                  $rets .= "<postfield name=\"stext\" value=\"$stext\"/>";
                  $rets .= "<postfield name=\"sin\" value=\"$sin\"/>";
                  $rets .= "<postfield name=\"sor\" value=\"$sor\"/>";
                  $rets .= "</go></anchor>";

                  echo $rets;
                  }

                  echo "</div>";


                  echo "<a href=\"findafriend.php?show=main&amp;hits=$hits\"> <img src=\"images/search.gif\" alt=\"*\"/>";
                  echo "FindAfriend</a><br/>";
                  echo "</div></div>";
                  include("wapv.php");
                  echo "</body>";
                  }

                  /////////////////////////////////////

                  Comment

                  Working...
                  X