hello all i have maked a mutual frnd list all is ok bt when i click next page.. datz not show plz check n post watz wrong there..
/////////////////////////////////////////////////////////////////////////////////////////
else if($show=="main")
{
$who = $_GET["who"];
addonline(getuid_hits($hits),"$whonick's
mutual friends","");
echo getheader($hits);
echo "<body>";
echo "<div class=\"box_cen\" align=\"left\">";
$whonick = getnick_uid($who);
echo "<b>$whonick's Mutual Friends</b>";
echo "<div class=\"box_cen\" align=\"center\">";
$mybuds = getnbuds($who);
echo "$mybuds Friends</a><br/>";
//////ALL LISTS SCRIPT <<
if($page=="" || $page<=0)$page=1;
$num_items = getnbuds($uid); //changable
$items_per_page= 5;
$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
a.name, b.place, b.userid FROM mx_users a
INNER JOIN mx_online b ON a.id = b.userid
GROUP BY 1,2
LIMIT $limit_start, $items_per_page
";
*/
$sql = "SELECT a.lastact, a.name, a.id, b.uid, b.tid, b.reqdt FROM mx_users a INNER JOIN mx_buddies b ON (a.id = b.uid) OR (a.id=b.tid) WHERE (b.uid='".$who."' OR b.tid='".$who."') AND b.agreed='1' AND a.id!='".$uid."' GROUP BY 1,2 ORDER BY a.lastact DESC LIMIT $limit_start, $items_per_page";
echo "<div class=\"box_sub\" align=\"left\">";
$items = mysql_query($sql);
echo mysql_error();
if(mysql_num_rows($items)>0)
{
while ($item = mysql_fetch_array($items))
{
$online = mysql_fetch_array(mysql_query("SELECT sex, uicon FROM mx_users WHERE id='".$item[2]."'"));
if($online[1]=="")
{
$seximg = "";
}else{
$seximg = "<img src=\"$online[1]\" alt=\"*\"/>";
}
if(isonline($item[2])==1)
{
$iml = "• <img src=\"images/onl.gif\" alt=\"+\"/>Online!";
$uact = "• WHERE: ";
$plc = mysql_fetch_array(mysql_query("SELECT place FROM mx_online WHERE userid='".$item[2]."'"));
$uact .= $plc[0];
}else if(isonline($item[2])==2)
{
$iml = "• <img src=\"images/onl.gif\" alt=\"+\"/>Idle!";
$uact = "• Last Active: ";
$ladt = date("d m y-H:i:s", $item[0]);
$uact .= $ladt;
}else{
$iml = "• <img src=\"images/ofl.gif\" alt=\"-\"/>Offline!";
$uact = "• Last Active: ";
$ladt = date("d m y-H:i:s", $item[0]);
$uact .= $ladt;
}
$foto = idle($item[2], 45, 45);
$cname = cname($item[2]);
if(($cname == "000000")||($cname == "")){ $texto = "";
$textc = ""; }else{ $texto = "<font color=\"$cname\">";
$textc = "</font>"; }
$lnk = "<a href=\"prov.php?show=viewuser&who=$item[2]&hits=$hits\">$texto$item[1]$textc</a>";
echo "$lnk<br/>";
echo "<a href=\"$avlink\">$foto</a><br/>";
echo "<small>";
echo "$iml<br/>";
$bs = date("d m y-H:i:s",$item[5]);
echo "• friends Since: $bs<br/>";
echo "$uact<br/>";
$ctext = ctext($item[2]);
if(($ctext == "000000")||($ctext == "")){ $texto = "";
$textc = ""; }else{ $texto = "<font color=\"$ctext\">";
$textc = "</font>"; }
$pm = "<a href=\"inbox.php?show=sendpms&who=$item[2]&hits=$hits\">SendPM</a>";
$nopl = mysql_fetch_array(mysql_query("SELECT sex, birthday FROM mx_users WHERE id='".$item[2]."'"));
$uage = getage($nopl[1]);
if($nopl[0]=='M')
{
$usex = "M";
}else if($nopl[0]=='F'){
$usex = "F";
}else{
$usex = "H";
}
$sym = mysql_fetch_array(mysql_query("SELECT state FROM mx_users WHERE id='".$item[2]."'"));
if($sym[0]=='1') {
$open = "India";
}else if($sym[0]=='2') {
$open = "Pakistan";
}else if($sym[0]=='3') {
$open = "South Africa";
}else if($sym[0]=='4') {
$open = "Sri Lanka";
}else if($sym[0]=='5') {
$open = "Bangla Desh";
}else if($sym[0]=='6') {
$open = "Pinoy";
}else if($sym[0]=='7') {
$open = "U.A.E";
}else if($sym[0]=='8') {
$open = "Q.S.A";
}else if($sym[0]=='9') {
$open = "ASIA";
}else if($sym[0]=='10') {
$open = "U.K";
}else if($sym[0]=='11') {
$open = "U.S.A";
}else if($sym[0]=='12') {
$open = "Australia";
}else if($sym[0]=='13') {
$open = "Urope";
}else if($sym[0]=='14') {
$open = "Malesia";
}else if($sym[0]=='15') {
$open = "Indonesia";
}else if($sym[0]=='16') {
$open = "Chaina";
}else if($sym[0]=='17') {
$open = "Other";
}else{
$open = "India";
}
$inf1 = mysql_fetch_array(mysql_query("SELECT country, city, street, phoneno, realname, budsonly, sitedscr FROM mx_xinfo WHERE id='".$item[2]."'"));
if(($uid==$who))
{
$rln = $inf1[2];
$str = $inf1[3];
$phn = $inf1[4];
}
$info=mysql_fetch_array(mysql_query("SELECT * FROM mx_users WHERE id='".$item[2]."'"));
$exp_bday=explode("-",$info[birthday]);
$month=$exp_bday[1];
$day=$exp_bday[2];
$year=explode("-",$exp_bday[0]);
$year=$year[0];
$get1=date(m);
$get2=$month-$get1;
$get3=date(d);
$get4=$day-$get3;
$get5=date(Y);
$get6=$year-$get5;
$birthday=date("D, j.m.Y",strtotime("$get2 months $get4 days $get6 years"));
$birth = "".$birthday."";
$nopl = mysql_fetch_array(mysql_query("SELECT sex, birthday FROM mx_users WHERE id='".$item[2]."'"));
$uage = getage($nopl[1]);
$nopl = mysql_fetch_array(mysql_query("SELECT signature FROM mx_users WHERE id='".$item[2]."'"));
$ctext = ctext($who);
if(($ctext == "000000")||($ctext == "")){ $texto = "";
$textc = ""; }else{ $texto = "<font color=\"$ctext\">";
$textc = "</font>"; }
$sign = parsepm($nopl[0], $hits);
if($sign=="") {
$sign = "".$texto."N o n e !$textc";
}else{
$sign = "$texto$sign$textc";
}
$inf1 = mysql_fetch_array(mysql_query("SELECT likes, deslikes, habitsb, habitsg, favsport, favmusic, moretext FROM mx_xinfo WHERE uid='".$item[2]."'"));
$like = "Likes: ".parsemsg($inf1[0])."";
$dislike = "Dislikes: ".parsemsg($inf1[1])."";
$address = mysql_fetch_array(mysql_query("SELECT location FROM mx_users WHERE id='".$item[2]."'"));
$alamat = $address[0];
if($alamat=="") {
$alamat = "N o N e !";
}else{
$alamat = "$alamat";
}
$city = "City:$alamat";
$status = mysql_fetch_array(mysql_query("SELECT status FROM mx_users WHERE id='".$item[2]."'"));
$mairred = "Relationship:$status[0]";
$zerm = mysql_fetch_array(mysql_query("SELECT zerm FROM mx_users WHERE id='".$item[2]."'"));
if($zerm[0]==0)
{
$zerm = "Normal";
}else if($zerm[0]==1)
{
$zerm = "Brown V.I.P!";
}else if($zerm[0]==2)
{
$zerm = "Silver V.I.P!";
}else if($zerm[0]==3)
{
$zerm = "Gold V.I.P!";
}else if($zerm[0]==4)
{
$zerm = "Wap Donator!";
}
$zerm = "$zerm";
$prem = "".getstatus($item[2])."";
echo "$zerm-$prem<br/>$mairred<br/>";
$uid = getuid_hits($hits);
if(budres($uid, $item[2])==0)
{
$budd = "<a href=\"genproc.php?show=bud&who=$item[2]&hits=$hits&todo=add\">Add as Friend</a>";
}else if(budres($uid, $item[2])==1)
{
$budd = "Request In Progress";
}else if(budres($uid, $item[2])==2)
{
$budd = "<a href=\"genproc.php?show=bud&who=$item[2]&hits=$hits&todo=del\">Delete Friend</a>";
}
echo "ASL: $birth - $usex - $open<br/>$city<br/>$like<br/>$dislike<br/>About Me: $sign<br/>";
echo "$budd<br/>$pm<br/>";
echo "• Says for friends: ";
$bmsg = parsemsg(getbudmsg($item[2]), $hits);
echo "$texto$bmsg$textc<br/>";
echo "</small><hr>";
}
}
$budm = parsemsg(getbudmsg($uid), $hits);
if($budm == "")
{
$msg = "N o n e !";
}else{
$msg = "$budm";
}
echo "<b>$whonick's Msg To Friends!</b><br/>";
echo "<br/>• $msg<br/><hr>";
echo "<center>";
if($page>1)
{
$ppage = $page-1;
echo "<a href=\"mutual.php?show=main&page=$ppage&hi ts=$hits&view=$view\">«PREV</a> ";
}
if($page<$num_pages)
{
$npage = $page+1;
echo "<a href=\"mutual.php?show=main&page=$npage&hi ts=$hits&view=$view\">Next»</a>";
}
echo "<br/>Page $page of $num_pages<br/>";
if($num_pages>2)
{
$rets = "<form action=\"mutual.php\" method=\"get\">";
$rets .= "Page<input name=\"pg\" format=\"*N\" size=\"3\"/>";
$rets .= "<input type=\"hidden\" name=\"show\" value=\"$show\"/>";
$rets .= "<input type=\"hidden\" name=\"view\" value=\"$view\"/>";
$rets .= "<input type=\"hidden\" name=\"hits\" value=\"$hits\"/>";
$rets .= "<input type=\"submit\" value=\"[GO]\"/></form>";
echo $rets;
}
echo "</center></div>";
include("wapv.php");
echo "</body>";
}
////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////
else if($show=="main")
{
$who = $_GET["who"];
addonline(getuid_hits($hits),"$whonick's
mutual friends","");
echo getheader($hits);
echo "<body>";
echo "<div class=\"box_cen\" align=\"left\">";
$whonick = getnick_uid($who);
echo "<b>$whonick's Mutual Friends</b>";
echo "<div class=\"box_cen\" align=\"center\">";
$mybuds = getnbuds($who);
echo "$mybuds Friends</a><br/>";
//////ALL LISTS SCRIPT <<
if($page=="" || $page<=0)$page=1;
$num_items = getnbuds($uid); //changable
$items_per_page= 5;
$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
a.name, b.place, b.userid FROM mx_users a
INNER JOIN mx_online b ON a.id = b.userid
GROUP BY 1,2
LIMIT $limit_start, $items_per_page
";
*/
$sql = "SELECT a.lastact, a.name, a.id, b.uid, b.tid, b.reqdt FROM mx_users a INNER JOIN mx_buddies b ON (a.id = b.uid) OR (a.id=b.tid) WHERE (b.uid='".$who."' OR b.tid='".$who."') AND b.agreed='1' AND a.id!='".$uid."' GROUP BY 1,2 ORDER BY a.lastact DESC LIMIT $limit_start, $items_per_page";
echo "<div class=\"box_sub\" align=\"left\">";
$items = mysql_query($sql);
echo mysql_error();
if(mysql_num_rows($items)>0)
{
while ($item = mysql_fetch_array($items))
{
$online = mysql_fetch_array(mysql_query("SELECT sex, uicon FROM mx_users WHERE id='".$item[2]."'"));
if($online[1]=="")
{
$seximg = "";
}else{
$seximg = "<img src=\"$online[1]\" alt=\"*\"/>";
}
if(isonline($item[2])==1)
{
$iml = "• <img src=\"images/onl.gif\" alt=\"+\"/>Online!";
$uact = "• WHERE: ";
$plc = mysql_fetch_array(mysql_query("SELECT place FROM mx_online WHERE userid='".$item[2]."'"));
$uact .= $plc[0];
}else if(isonline($item[2])==2)
{
$iml = "• <img src=\"images/onl.gif\" alt=\"+\"/>Idle!";
$uact = "• Last Active: ";
$ladt = date("d m y-H:i:s", $item[0]);
$uact .= $ladt;
}else{
$iml = "• <img src=\"images/ofl.gif\" alt=\"-\"/>Offline!";
$uact = "• Last Active: ";
$ladt = date("d m y-H:i:s", $item[0]);
$uact .= $ladt;
}
$foto = idle($item[2], 45, 45);
$cname = cname($item[2]);
if(($cname == "000000")||($cname == "")){ $texto = "";
$textc = ""; }else{ $texto = "<font color=\"$cname\">";
$textc = "</font>"; }
$lnk = "<a href=\"prov.php?show=viewuser&who=$item[2]&hits=$hits\">$texto$item[1]$textc</a>";
echo "$lnk<br/>";
echo "<a href=\"$avlink\">$foto</a><br/>";
echo "<small>";
echo "$iml<br/>";
$bs = date("d m y-H:i:s",$item[5]);
echo "• friends Since: $bs<br/>";
echo "$uact<br/>";
$ctext = ctext($item[2]);
if(($ctext == "000000")||($ctext == "")){ $texto = "";
$textc = ""; }else{ $texto = "<font color=\"$ctext\">";
$textc = "</font>"; }
$pm = "<a href=\"inbox.php?show=sendpms&who=$item[2]&hits=$hits\">SendPM</a>";
$nopl = mysql_fetch_array(mysql_query("SELECT sex, birthday FROM mx_users WHERE id='".$item[2]."'"));
$uage = getage($nopl[1]);
if($nopl[0]=='M')
{
$usex = "M";
}else if($nopl[0]=='F'){
$usex = "F";
}else{
$usex = "H";
}
$sym = mysql_fetch_array(mysql_query("SELECT state FROM mx_users WHERE id='".$item[2]."'"));
if($sym[0]=='1') {
$open = "India";
}else if($sym[0]=='2') {
$open = "Pakistan";
}else if($sym[0]=='3') {
$open = "South Africa";
}else if($sym[0]=='4') {
$open = "Sri Lanka";
}else if($sym[0]=='5') {
$open = "Bangla Desh";
}else if($sym[0]=='6') {
$open = "Pinoy";
}else if($sym[0]=='7') {
$open = "U.A.E";
}else if($sym[0]=='8') {
$open = "Q.S.A";
}else if($sym[0]=='9') {
$open = "ASIA";
}else if($sym[0]=='10') {
$open = "U.K";
}else if($sym[0]=='11') {
$open = "U.S.A";
}else if($sym[0]=='12') {
$open = "Australia";
}else if($sym[0]=='13') {
$open = "Urope";
}else if($sym[0]=='14') {
$open = "Malesia";
}else if($sym[0]=='15') {
$open = "Indonesia";
}else if($sym[0]=='16') {
$open = "Chaina";
}else if($sym[0]=='17') {
$open = "Other";
}else{
$open = "India";
}
$inf1 = mysql_fetch_array(mysql_query("SELECT country, city, street, phoneno, realname, budsonly, sitedscr FROM mx_xinfo WHERE id='".$item[2]."'"));
if(($uid==$who))
{
$rln = $inf1[2];
$str = $inf1[3];
$phn = $inf1[4];
}
$info=mysql_fetch_array(mysql_query("SELECT * FROM mx_users WHERE id='".$item[2]."'"));
$exp_bday=explode("-",$info[birthday]);
$month=$exp_bday[1];
$day=$exp_bday[2];
$year=explode("-",$exp_bday[0]);
$year=$year[0];
$get1=date(m);
$get2=$month-$get1;
$get3=date(d);
$get4=$day-$get3;
$get5=date(Y);
$get6=$year-$get5;
$birthday=date("D, j.m.Y",strtotime("$get2 months $get4 days $get6 years"));
$birth = "".$birthday."";
$nopl = mysql_fetch_array(mysql_query("SELECT sex, birthday FROM mx_users WHERE id='".$item[2]."'"));
$uage = getage($nopl[1]);
$nopl = mysql_fetch_array(mysql_query("SELECT signature FROM mx_users WHERE id='".$item[2]."'"));
$ctext = ctext($who);
if(($ctext == "000000")||($ctext == "")){ $texto = "";
$textc = ""; }else{ $texto = "<font color=\"$ctext\">";
$textc = "</font>"; }
$sign = parsepm($nopl[0], $hits);
if($sign=="") {
$sign = "".$texto."N o n e !$textc";
}else{
$sign = "$texto$sign$textc";
}
$inf1 = mysql_fetch_array(mysql_query("SELECT likes, deslikes, habitsb, habitsg, favsport, favmusic, moretext FROM mx_xinfo WHERE uid='".$item[2]."'"));
$like = "Likes: ".parsemsg($inf1[0])."";
$dislike = "Dislikes: ".parsemsg($inf1[1])."";
$address = mysql_fetch_array(mysql_query("SELECT location FROM mx_users WHERE id='".$item[2]."'"));
$alamat = $address[0];
if($alamat=="") {
$alamat = "N o N e !";
}else{
$alamat = "$alamat";
}
$city = "City:$alamat";
$status = mysql_fetch_array(mysql_query("SELECT status FROM mx_users WHERE id='".$item[2]."'"));
$mairred = "Relationship:$status[0]";
$zerm = mysql_fetch_array(mysql_query("SELECT zerm FROM mx_users WHERE id='".$item[2]."'"));
if($zerm[0]==0)
{
$zerm = "Normal";
}else if($zerm[0]==1)
{
$zerm = "Brown V.I.P!";
}else if($zerm[0]==2)
{
$zerm = "Silver V.I.P!";
}else if($zerm[0]==3)
{
$zerm = "Gold V.I.P!";
}else if($zerm[0]==4)
{
$zerm = "Wap Donator!";
}
$zerm = "$zerm";
$prem = "".getstatus($item[2])."";
echo "$zerm-$prem<br/>$mairred<br/>";
$uid = getuid_hits($hits);
if(budres($uid, $item[2])==0)
{
$budd = "<a href=\"genproc.php?show=bud&who=$item[2]&hits=$hits&todo=add\">Add as Friend</a>";
}else if(budres($uid, $item[2])==1)
{
$budd = "Request In Progress";
}else if(budres($uid, $item[2])==2)
{
$budd = "<a href=\"genproc.php?show=bud&who=$item[2]&hits=$hits&todo=del\">Delete Friend</a>";
}
echo "ASL: $birth - $usex - $open<br/>$city<br/>$like<br/>$dislike<br/>About Me: $sign<br/>";
echo "$budd<br/>$pm<br/>";
echo "• Says for friends: ";
$bmsg = parsemsg(getbudmsg($item[2]), $hits);
echo "$texto$bmsg$textc<br/>";
echo "</small><hr>";
}
}
$budm = parsemsg(getbudmsg($uid), $hits);
if($budm == "")
{
$msg = "N o n e !";
}else{
$msg = "$budm";
}
echo "<b>$whonick's Msg To Friends!</b><br/>";
echo "<br/>• $msg<br/><hr>";
echo "<center>";
if($page>1)
{
$ppage = $page-1;
echo "<a href=\"mutual.php?show=main&page=$ppage&hi ts=$hits&view=$view\">«PREV</a> ";
}
if($page<$num_pages)
{
$npage = $page+1;
echo "<a href=\"mutual.php?show=main&page=$npage&hi ts=$hits&view=$view\">Next»</a>";
}
echo "<br/>Page $page of $num_pages<br/>";
if($num_pages>2)
{
$rets = "<form action=\"mutual.php\" method=\"get\">";
$rets .= "Page<input name=\"pg\" format=\"*N\" size=\"3\"/>";
$rets .= "<input type=\"hidden\" name=\"show\" value=\"$show\"/>";
$rets .= "<input type=\"hidden\" name=\"view\" value=\"$view\"/>";
$rets .= "<input type=\"hidden\" name=\"hits\" value=\"$hits\"/>";
$rets .= "<input type=\"submit\" value=\"[GO]\"/></form>";
echo $rets;
}
echo "</center></div>";
include("wapv.php");
echo "</body>";
}
////////////////////////////////////////////////////////////////////////////////////////
Comment