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 🙁
Reffered user lists by user for lava
Started on the old forum in February 2011 · view the original in the archive · old links redirect here
xypex wrote: 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.
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>";
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_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 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&page=$ppage&who=$who\">«PRE
V</a> ";
}
if($page<$num_pages)
{
$npage = $page+1;
echo "<a
href=\"page.php?action=$action&page=$npage&who=$who\">Next»
;</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;
}
Meet New FACES and Gain More FRIENDS!!! http://www.facesnfriends.com%208%29
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&sid=$sid&who=$who"> ".$invt[0]."</a>
";
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 "Reffered users:".$invt[0]." ";
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 " ";
$items = mysql_query($sql);
if(mysql_num_rows($items)>0)
{
while ($item = mysql_fetch_array($items))
{
$unick = getnick_uid($item[0]); echo "• $item[0] "; } }
echo "
";
echo "
";
if($page>1)
{
$ppage = $page-1;
echo "<a href=\"lists.php?action=refeared&page=$ppage&sid=$sid&view=$view\">«Prev</a> ";
}
if($page<$num_pages)
{
$npage = $page+1;
echo "<a href=\"lists.php?action=refeared&page=$npage&sid=$sid&view=$view\">Next»</a>";
}
echo "
$page/$num_pages ";
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 "
"; echo "
<a href=\"index.php?action=stats&sid=$sid\">
Site Stats</a>
";
}
This is my code where is mistake there plz tell me. its not working 🙁
Mention the type of error u get....How to help without knowing the error msg...
I'm Proud to be a Sri Lankan!
bigboss wrote: 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
Meet New FACES and Gain More FRIENDS!!! http://www.facesnfriends.com%208%29
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.
Wait I'll add it here.....
Added after 7 minutes:
I will add a working code here....give me few time
I'm Proud to be a Sri Lankan!
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.
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_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 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&who=$item[0]&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&page=$ppage&sid=$sid&who=$who\">«Prev</a> ";
}
if($page<$num_pages)
{
$npage = $page+1;
echo "<a href=\"lists.php?action=$action&page=$npage&sid=$sid&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&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!
not working for me 🙁 i used this code 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");
//////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_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 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&who=$item[0]&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&page=$ppage&sid=$sid&view=$view\">«Prev</a> ";
}
if($page<$num_pages)
{
$npage = $page+1;
echo "<a href=\"lists.php?action=refeared&page=$npage&sid=$sid&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&sid=$sid\">
Site Stats</a><br/>
</p>";
}
in resister 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????