Reffered user lists by user for lava

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

    Reffered user lists by user for lava

    plz i want this code if u have then plz copy paste here. i have reffred user no. in user profile. but i want lists of reffred users. i searched here but not found
    LoveForum.BiZ

    #2
    i had kindly clear ur private message data coz i cant send u PM here

    Comment


      #3
      Originally posted by xypex View Post
      i had kindly clear ur private message data coz i cant send u PM here
      i dont want as a private plz share with us.
      LoveForum.BiZ

      Comment


        #4
        PHP Code:
        profile:
        $count mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM refered WHERE referer='".$who."'"));
        echo 
        "<a href=\"page.php?&who=$who\">refered users: $count[0]</a>"
        PHP Code:
        in page.php
        $who
        $_GET["who"];
        $count mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM refered 

        WHERE referer='"
        .$who."'"));
        echo 
        "<b>Refered $count[0]</b><br/>"
         
            if(
        $page=="" || $page<=0)$page=1;
            
        $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM refered WHERE referer='".$who."'"));
            
        $num_items $noi[0]; //changable
            
        $items_per_page10;
            
        $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 FROM refered WHERE referer='".$who."' ORDER BY id DESC LIMIT $limit_start$items_per_page";



               
        $items mysql_query($sql);

            if(
        mysql_num_rows($items)>0)
            {
            while (
        $item mysql_fetch_array($items))
            {
        $unick getnick_uid($item[0]);
              echo 
        "• $item[0]<br/>";
            }
            }
           
            if(
        $page>1)
            {
              
        $ppage $page-1;
              echo 
        "<a 

        href=\"page.php?action=
        $action&amp;page=$ppage&amp;who=$who\">«PRE

        V</a> "
        ;
            }
            if(
        $page<$num_pages)
            {
              
        $npage $page+1;
              echo 
        "<a 

        href=\"page.php?action=
        $action&amp;page=$npage&amp;who=$who\">Next&#187

        ;</a>"
        ;
            }
            echo 
        "<br/>$page/$num_pages<br/>";
            if(
        $num_pages>2)
            {
                
        $rets "<form action=\"page.php\" method=\"get\">";
              
        $rets .= "Jump to page<input name=\"page\" format=\"*N\" 

        size=\"3\"/>"
        ;
                
        $rets .= "<input type=\"submit\" value=\"GO\"/>";
                
        $rets .= "<input type=\"hidden\" name=\"action\" 

        value=\"
        $action\"/>";
                
        $rets .= "<input type=\"hidden\" name=\"sid\" 

        value=\"
        $sid\"/>";
               
                
        $rets .= "</form>";


                echo 
        $rets;
            } 
        Last edited by xdosx; 17.02.11, 09:10.

        Comment


          #5
          In Profile

          $invt = mysql_fetch_array(mysql_query("SELECT invites FROM ibwf_users WHERE id='".$who."'"));

          echo "Reffered users:<a href=\"lists.php?action=refeared&amp;sid=$sid&amp; who=$who\"> <b>".$invt[0]."</b></a><br/><br/>";






          In list.php


          //////////////////////////////////Reffreal Users


          else if($action=="refeared")

          {

          addonline(getuid_sid($sid),"Viewing Reffreared Users","lists.php?action=$action");

          getshouts($sid);



          boxstart("Reffreared Users");
          $who= $_GET["who"];

          $invt = mysql_fetch_array(mysql_query("SELECT invites FROM ibwf_users WHERE id='".$who."'"));

          echo "<b>Reffered users:".$invt[0]."</b><br/>";



          if($page=="" || $page<=0)$page=1;
          $noi = mysql_fetch_array(mysql_query("SELECT invites FROM ibwf_users WHERE id='".$who."'"));
          $num_items = $noi[0]; //changable
          $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;

          //changable sql

          $sql = "SELECT invites FROM ibwf_users WHERE id='".$who."' ORDER BY invites DESC LIMIT $limit_start, $items_per_page";

          echo "<p>";

          $items = mysql_query($sql);

          if(mysql_num_rows($items)>0)
          {
          while ($item = mysql_fetch_array($items))
          {
          $unick = getnick_uid($item[0]);
          echo "• $item[0]<br/>";
          }
          }


          echo "</p>";

          echo "<p align=\"center\">";

          if($page>1)

          {

          $ppage = $page-1;

          echo "<a href=\"lists.php?action=refeared&amp;page=$ppage&a mp;sid=$sid&amp;view=$view\">&#171;Prev</a> ";

          }

          if($page<$num_pages)

          {

          $npage = $page+1;

          echo "<a href=\"lists.php?action=refeared&amp;page=$npage&a mp;sid=$sid&amp;view=$view\">Next&#187;</a>";

          }

          echo "<br/>$page/$num_pages<br/>";

          if($num_pages>2)

          {

          $rets = "Jump to page<form action=\"lists.php\" method=\"get\"><input id=\"inputText\" name=\"page\" format=\"*N\" size=\"3\"/>";

          $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";

          $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";

          $rets .= "<input id=\"inputButton\" type=\"submit\" value=\"Go\"/></form>";



          echo $rets;

          }

          echo "</p>";
          echo "<p align=\"center\">

          <a href=\"index.php?action=stats&amp;sid=$sid\">

          Site Stats</a><br/>

          </p>";

          }


          This is my code where is mistake there plz tell me. its not working
          LoveForum.BiZ

          Comment


            #6
            Mention the type of error u get....How to help without knowing the error msg...


            I'm Proud to be a Sri Lankan!

            Comment


              #7
              I m not getting list of refred users
              LoveForum.BiZ

              Comment


                #8
                Originally posted by bigboss View Post
                I m not getting list of refred users
                check your registration page..
                in ur ibwf_user insert invites int(100)

                in ur registration proccess
                if registration passed/ok put a code that will insert invites/referer into ibwf_user..

                in listing
                fetch from ibwf_users where invites=who or referer=who
                ///
                codes here
                ////

                u can check my site to get an idea.. here: pinoyworld.mobi
                Last edited by xdosx; 11.03.11, 18:33.

                Comment


                  #9
                  That code already there but i didnt face users nick i can face number of refered users of user in profile but not facing lists.
                  LoveForum.BiZ

                  Comment


                    #10
                    you can code it easily when you know how to code php
                    study the syntax of each script from lavalair. and you can get idea on how to create a unique features..

                    /wapstreet.net

                    Comment


                      #11
                      Wait I'll add it here.....

                      Added after 7 minutes:

                      I will add a working code here....give me few time
                      Last edited by nimeshka; 14.03.11, 12:40.


                      I'm Proud to be a Sri Lankan!

                      Comment


                        #12
                        Okk i m waiting for your reply.
                        LoveForum.BiZ

                        Comment


                          #13
                          Here it is...this will work 100% coz I used it very recently...
                          Use this in your lists.php or anywhere....You already have code to get the no of referred users no? So link this with that.

                          PHP Code:

                          if($action=="refers")
                          {
                              
                          addonline(getuid_sid($sid),"Reffered Users List","");
                              
                          $pstyle gettheme($sid);
                                echo 
                          xhtmlhead("Reffered List",$pstyle);
                              
                          //////ALL LISTS SCRIPT <<
                              
                          $who $_GET["who"];
                          $whoinfo getnick_uid($who);  

                              if(
                          $page=="" || $page<=0)$page=1;
                              
                          $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE refby='".$whoinfo."'"));
                              
                          $num_items $noi[0]; //changable
                              
                          $items_per_page10;
                              
                          $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, regdate FROM ibwf_users WHERE refby='".$whoinfo."' ORDER BY name  LIMIT $limit_start$items_per_page";

                              echo 
                          "<p>";
                              
                          $items mysql_query($sql);

                              if(
                          mysql_num_rows($items)>0)
                              {
                              while (
                          $item mysql_fetch_array($items))
                              {

                                
                          $lnk "<a href=\"index.php?action=viewuser&amp;who=$item[0]&amp;sid=$sid\">$item[1]</a>";

                           
                          $jdt date("d m y-H:i:s",$item[2]);

                               echo 
                          "$lnk - $jdt<br/>";
                              }
                              }
                              echo 
                          "</p>";
                              echo 
                          "<p align=\"center\">";
                              if(
                          $page>1)
                              {
                                
                          $ppage $page-1;
                                echo 
                          "<a href=\"lists.php?action=$action&amp;page=$ppage&amp;sid=$sid&amp;who=$who\">«Prev</a> ";
                              }
                              if(
                          $page<$num_pages)
                              {
                                
                          $npage $page+1;
                                echo 
                          "<a href=\"lists.php?action=$action&amp;page=$npage&amp;sid=$sid&amp;who=$who\">Next»</a>";
                              }
                              echo 
                          "<br/>$page/$num_pages<br/>";
                              if(
                          $num_pages>2)
                              {
                                  
                          $rets .= "<form action=\"lists.php\" method=\"get\">";
                                
                          $rets .= "Jump to page<input name=\"page\" format=\"*N\" size=\"3\"/><br/>";
                                  
                          $rets .= "<input type=\"submit\" value=\"GO\"/>";
                                  
                          $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
                                  
                          $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
                                  
                          $rets .= "<input type=\"hidden\" name=\"who\" value=\"$who\"/>";
                                  
                          $rets .= "</form>";

                                  echo 
                          $rets;
                              }
                              echo 
                          "</p>";
                             
                              echo 
                          "<p align=\"center\">";
                              echo 
                          "Use Your referal link to invite friends and increase your Referal Points.";
                            echo 
                          "</p>";


                            
                          ////// UNTILL HERE >>
                              
                          echo "<p align=\"center\">";
                              
                          $thid mysql_fetch_array(mysql_query("SELECT themeid FROM ibwf_users WHERE id='".$uid."'"));
                              
                          $themeimageset mysql_fetch_array(mysql_query("SELECT themedir FROM ibwf_iconset WHERE id='".$thid[0]."'"));
                              echo 
                          "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/themes/$themeimageset[0]/home.gif\" alt=\"*\"/>";
                          echo 
                          "Home</a>";
                          echo 
                          "<small>By NimEsHka</small>";
                            echo 
                          "</p>";
                            echo 
                          xhtmlfoot(); 
                          Change the sql fields according to ur referer field. I Use refby to insert the name of the referer directly in registration.


                          I'm Proud to be a Sri Lankan!

                          Comment


                            #14
                            not working for me
                            i used this code
                            in list.php
                            PHP Code:
                            //////////////////////////////////Reffreal Users


                            else if($action=="refeared")

                            {

                             
                            addonline(getuid_sid($sid),"Viewing Reffreared Users","lists.php?action=$action");

                                
                            getshouts($sid);



                            boxstart("Reffreared Users");

                             
                            //////ALL LISTS SCRIPT << 
                                
                            $who $_GET["who"]; 
                            $whoinfo getnick_uid($who);   

                                if(
                            $page=="" || $page<=0)$page=1
                                
                            $noi mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE invites='".$whoinfo."'")); 
                                
                            $num_items $noi[0]; //changable 
                                
                            $items_per_page10
                                
                            $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, regdate FROM ibwf_users WHERE invites='".$whoinfo."' ORDER BY name  LIMIT $limit_start$items_per_page"

                                echo 
                            "<p>"
                                
                            $items mysql_query($sql); 

                                if(
                            mysql_num_rows($items)>0
                                { 
                                while (
                            $item mysql_fetch_array($items)) 
                                { 

                                  
                            $lnk "<a href=\"index.php?action=viewuser&amp;who=$item[0]&amp;sid=$sid\">$item[1]</a>"

                             
                            $jdt date("d m y-H:i:s",$item[2]); 

                                 echo 
                            "$lnk - $jdt<br/>"
                                } 
                                } 
                                echo 
                            "</p>";
                                echo 
                            "<p align=\"center\">";

                                if(
                            $page>1)

                                {

                                  
                            $ppage $page-1;

                                  echo 
                            "<a href=\"lists.php?action=refeared&amp;page=$ppage&amp;sid=$sid&amp;view=$view\">«Prev</a> ";

                                }

                                if(
                            $page<$num_pages)

                                {

                                  
                            $npage $page+1;

                                  echo 
                            "<a href=\"lists.php?action=refeared&amp;page=$npage&amp;sid=$sid&amp;view=$view\">Next»</a>";

                                }

                                echo 
                            "<br/>$page/$num_pages<br/>";

                                if(
                            $num_pages>2)

                                {

                                 
                            $rets "Jump to page<form action=\"lists.php\" method=\"get\"><input id=\"inputText\" name=\"page\" format=\"*N\" size=\"3\"/>";

                                     
                            $rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";

                                    
                            $rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";

                                    
                            $rets .= "<input id=\"inputButton\" type=\"submit\" value=\"Go\"/></form>";



                                    echo 
                            $rets;

                                }

                                echo 
                            "</p>";
                                echo 
                            "<p align=\"center\">Use Your referal link to invite friends and increase your Referal Points.<br/>
                                <a href=\"index.php?action=stats&amp;sid=
                            $sid\">

                            Site Stats</a><br/>

                              </p>"
                            ;


                            in resister code
                            Code:
                            function register($name,$pass,$usex,$bday,$uloc,$rname,$ms,$email,$refer){
                            		$execms = mysql_query("SELECT * FROM ibwf_users WHERE name='".$name."';");
                            if (mysql_num_rows($execms)>0){
                            return 1;
                            }else{
                            $pass = md5(strtolower($pass));
                            $reg = mysql_query("INSERT INTO ibwf_users SET name='".$name."', pass='".$pass."', birthday='".$bday."', sex='".$usex."', location='".$uloc."', regdate='".time()."', 
                            email='".$email."', rname='".$rname."', ms='".$ms."' ");
                            }
                            if ($reg){
                            $uid = mysql_fetch_array(mysql_query("SELECT id FROM ibwf_users WHERE name='".$name."'"));
                            $msg = "LoveForum welcomes you! We are committed to provide you with unique services, like multimedia messaging, Free Downloading, Free gprs Tricks, Making New Friends and lots of other various tools for you to have 
                            fun. We know that you come to WAP after getting time from your busy schedule so we are always ready hear to provide you a friendly and fun filled environment to ease your tensions. For any queries please ask any member of Administration Team. Thanks![br/][small][i]Note: This is an automatically generated message, please do not reply.[/i][/small]";
                            $msg = mysql_escape_string($msg);
                            autopm($msg, $uid[0]);
                            
                             if (("$refer"=="$name") and (strlen($refer))>1){
                                  }else{
                                  $referid = mysql_fetch_array(mysql_query("SELECT id FROM ibwf_users WHERE name='".$refer."'"));
                                  $ugpl = mysql_fetch_array(mysql_query("SELECT plusses FROM ibwf_users WHERE id='".$referid[0]."'"));
                                  $inv = mysql_fetch_array(mysql_query("SELECT invites FROM ibwf_users WHERE id='".$referid[0]."'"));
                                  $ugpl = $ugpl[0] + 50;
                                  $inv = $inv[0] + 1;
                                  
                                  mysql_query("UPDATE ibwf_users SET plusses='".$ugpl."' WHERE id='".$referid[0]."'");
                                  mysql_query("UPDATE ibwf_users SET invites='".$inv."' WHERE id='".$referid[0]."'");
                            
                                  $msg1 = "$refer Refered $name";
                                  $msg1 = mysql_escape_string($msg1);
                                  autopm($msg1, "1");
                            $uid2 = mysql_fetch_array(mysql_query("SELECT id FROM ibwf_users WHERE name='".$refer."'"));
                                 
                             $msg2 = "[b]NOTIFICATION:[/b][br/]Congratulations! you have got 50 plusses for invite to $name in LoveForum. Thankx for help to LoveForum. :)[br/][small][i]p.s: this is an automated pm[/i][/small]";
                            
                            
                                  $msg2 = mysql_escape_string($msg2);
                                  autopm($msg2, $uid2[0]);
                                  }
                                  
                                  return 0;
                                }else{
                                  return 2;
                                  
                               
                            }
                            }
                            plz tell me what is mistake????
                            LoveForum.BiZ

                            Comment

                            Working...
                            X