Hello Coders,
I need my buddylist to display online friends with their profile photos. Kindly assist me, the code for the buddylist is here.
I will be very grateful if you help me with this.
I have a full working Demo. Check it here www.ossy.wc.lt
I
I need my buddylist to display online friends with their profile photos. Kindly assist me, the code for the buddylist is here.
PHP Code:
<?php
echo ('<?xml version="1.0"?>');
include("../core.php");
$siid=sntz($_GET['sid']);
$page=sntz($_GET['page']);
$action=sntz($_GET['action']);
checkvalue($action);
$who=sntz($_GET['who']);
if($who!='')checkvalue($who);
if($siid!='')checkvalue($siid);
if($page!='')checkvalue($page);
$type = sntz($_GET["type"]);
connectdb();
if(logged($siid)==0){ head_tag("ERROR !!","Morning_Sky");echo '<body><br/><div><img src="../images/slogo.png" alt="FC"/><br/><br/>YOU ARE NOT LOGGED IN OR YOUR SESSION HAS BEEN EXPIRED.<br/>YOU MUST BE LOGGED IN TO SEE THIS PAGE.<br/><br/><a href="index.php">»Login Here</a><br/><br/></div><div class="maaz">©2015-2030 UNIVERSAL GROUP</div></body></html>';mysql_close();exit();}
$ud=getuid2($siid);$nick=getnick($ud);$nickk=getni ck($who);
cleardata($ud);
$theme=gettheme($ud);
if($theme==""){$theme="defaults";}
$time=time();
$online=getonline();
canlog(ip(),browser($_SERVER["HTTP_USER_AGENT"]),$ud);
update($ud);$nick=getnick($ud);$acount=gettotalbud ($ud);$mcount=getmbuds($ud);$fcount=getfbuds($ud);
$unr=getunread($ud);$ob=getonlinebud($ud,$time);$c h=chatonline();
$pop=mysql_fetch_array(mysql_query("select * from popups437 where toid='".$ud."' and unread='1' order by id desc limit 1"));
if($pop==true){
$pnick=getsnick($pop[3]);$pmsg=getsmilies(getbbcode(htmlspecialchars($pop[2],ENT_QUOTES),$siid),$ud);$putime=humanTiming($pop[6]);
echo '<div class="sam1"><b>Popup</b></div>';
echo '<div class="s7"><a href="pf.php?opt=info&who='.$pop[3].'&sid='.$siid.'"><b>'.$pnick.'</b></a> : ';
echo ''.$pmsg.'<br/><b>Sent : '.$putime.' ago</b><br/>';mysql_query("update popups437 set unread='0' where id='".$pop[0]."'");
echo '<form action="inboxproc.php?action=sendpopup&who='.$ pop[3].'&sid='.$siid.'" method="post"><textarea name="ppptext" maxlength="1000"/></textarea><br/><input type="submit" name="sendp" value="REPLY"> | <a href="inboxproc.php?action=rptpop&pmid='.$pop[0].'&sid='.$siid.'"><b>Report It</b></a></form></div>';}
$smds=mysql_fetch_array(mysql_query("select smds,pv from users437 where uid='".$ud."'"));
mtcalert($ud,$siid);ialert($ud,$siid);
head_tag("Friends@Universal",$theme);
echo '<body><table id="sm2"><tr><td><a href="./inbox.php?action=main2&sid='.$siid.'"> Inbox-('.$unr.')</a></td>
<td><a href="./buds.php?action=main&sid='.$siid.'">Friends-('.$ob.')</a></td>
<td><a href="./chat.php?action=main&sid='.$siid.'">Chat-('.$ch.')</a></td>
<td><a href="./lists.php?action=10pv&sid='.$siid.'&who='. $ud.'">Views-('.$smds[1].')</a></td>
</tr></table>';
error_reporting(0);
echo '<div><img src="../images/bdy.gif" alt=""><b> <u>MY FRIENDS</u></b></div>';
$topic=mysql_fetch_array(mysql_query("select id,name,uid from forumtopics437 order by rand() limit 1"));
$utopi=getutopics($topic[2], $siid);
$tnick=getsnick($topic[2]);
//random topic
echo '<div class="s6"><div class="sam"><hr><i><small>~~Random Universal topic~~</small></i><hr></div><ul>';
echo '<li><hr><img src="../images/forum/Ranked.jpeg" alt=""/> <u>Number</u> <font style="font-size:20px;">'.$topic[0].'</font></li>';
echo '<li><img src="http://wapego.com/iconai/bullet_feed.png" alt="*"><font style="font-size:18px;"><a href="forums.php?action=viewtpc&tid='.$topic[0].'&sid='.$siid.'">'.$topic[1].'</a></font><img src="http://wapego.com/iconai/bullet_feed.png" alt="*"></li>';
echo '<li><img src="http://love254.waplux.com/files/52735/Forumss.png" alt="*"><font style="font-size:20px;"><a href="pf.php?opt=info&sid='.$siid.'&who='. $topic[2].'">'.$tnick.'</a></font></li>';
echo '<li><font style="font-size:18px;">'.$utopi.'</font></li>';
echo '<li><i><small>~~Enjoy universal forums~~</small></i></li><hr>';
echo '</ul></div>';
echo '</div><div class="sam3"><a href="lists.php?action=pending&sid='.$siid.'"><hr> <img src="../images/friendrequests.png" alt=""/> <u>Requests</u></a> | <a href="buds.php?action=budmood&sid='.$siid.'"><img src="http://wapego.com/images/new_icons/site_settings_16x16.png" alt=""/><u>Change Status</u></a><hr></div><div class="sam1"><a href="buds.php?action=popdlg&sid='.$siid.'">Popup Dialogue</a></div><div class="sam3"><a href="buds.php?action=pmall&sid='.$siid.'"><hr><i> ~~Send a msg to ur friends~~</i></br><hr></a></div></br><i><small>~~Sending a message to your friends will cost you cash of 250~~</small></i></br>';
$budys=mysql_fetch_array(mysql_query("select mood from budmood437 where uid='".$ud."'"));
if($smds[0]==2)$sayss=getsmilies1(getbbcode(htmlspecialchars( $budys[0],ENT_QUOTES),$siid),$ud);else $sayss=getsmilies(getbbcode(htmlspecialchars($budy s[0],ENT_QUOTES),$siid),$ud);
// friends status
echo '<div class="s5"><img src="http://love254.waplux.com/files/52735/Forumss.png" alt=""/><i><small>Your official friends status~~~~~</small></i><ul>';
echo '<li>'.$sayss.'</li></ul></div>';
if($action=="main"){
head_tag("Friends",$theme);
echo '<body>';
if($type=="boys"){$mycount=$mcount;
echo '<table id="sm2"><tr>';
echo '<td><a href="buds.php?action=main&sid='.$siid.'">Online-('.$ob.')</a></td>';
echo '<td><a href="buds.php?action=main&sid='.$siid.'&type=all" >All-('.$acount.')</a></td>';
echo '<td><b>Boys-('.$mcount.')</b></td>';
echo '<td><a href="buds.php?action=main&sid='.$siid.'&type=girl s">Girls-('.$fcount.')</a></td>';
echo '</tr></table>';}
else if($type=="girls"){$mycount=$fcount;
echo '<table id="sm2"><tr>';
echo '<td><a href="buds.php?action=main&sid='.$siid.'">Online-('.$ob.')</a></td>';
echo '<td><a href="buds.php?action=main&sid='.$siid.'&type=all" >All-('.$acount.')</a></td>';
echo '<td><a href="buds.php?action=main&sid='.$siid.'&type=boys ">Boys-('.$mcount.')</a></td>';
echo '<td><b>Girls-('.$fcount.')</b></td>';
echo '</tr></table>';}
else if($type=="all"){$mycount=$acount;
echo '<table id="sm2"><tr>';
echo '<td><a href="buds.php?action=main&sid='.$siid.'">Online-('.$ob.')</a></td>';
echo '<td><b>All-('.$acount.')</b></td>';
echo '<td><a href="buds.php?action=main&sid='.$siid.'&type=boys ">Boys-('.$mcount.')</a></td>';
echo '<td><a href="buds.php?action=main&sid='.$siid.'&type=girl s">Girls-('.$fcount.')</a></td>';
echo '</tr></table>';}
else {$mycount=$ob;
echo '<table id="sm2"><tr>';
echo '<td><b>Online-('.$ob.')</b></td>';
echo '<td><a href="buds.php?action=main&sid='.$siid.'&type=all" >All-('.$acount.')</a></td>';
echo '<td><a href="buds.php?action=main&sid='.$siid.'&type=boys ">Boys-('.$mcount.')</a></td>';
echo '<td><a href="buds.php?action=main&sid='.$siid.'&type=girl s">Girls-('.$fcount.')</a></td>';
echo '</tr></table>'; }
if($page=="" || $page<=0)$page=1;
$num_items = $mycount; //changable
$items_per_page= 5;
$num_pages = ceil($num_items/$items_per_page);
if($page>$num_pages)$page= $num_pages;
$limit_start = ($page-1)*$items_per_page;
if($type=="boys") {$sql="select uid,tid,ttime,date,tsx from buds437 where uid='".$ud."'and tsx='Male' and agreed='1' order by ttime desc limit ".$limit_start.", ".$items_per_page."";
addonline($ud,$time,"Viewing Friends : <b>Boys</b>");}
else if($type=="girls") {$sql="select uid,tid,ttime,date,tsx from buds437 where uid='".$ud."'and tsx='Female' and agreed='1' order by ttime desc limit ".$limit_start.", ".$items_per_page."";
addonline($ud,$time,"Viewing Friends : <b>Girls</b>");}
else if($type=="all"){$sql="select uid,tid,ttime,date,tsx from buds437 where uid='".$ud."' and agreed='1' order by ttime desc limit ".$limit_start.", ".$items_per_page."";
addonline($ud,$time,"Viewing <b>All</b> Friends");}
else{$ltime=$time-10800;
$sql="select uid,tid,ttime,date,tsx from buds437 where uid='".$ud."' and ttime>'".$ltime."' and agreed='1' order by ttime desc limit ".$limit_start.", ".$items_per_page."";
addonline($ud,$time,"Viewing <b>Online</b> Friends");}
$items=mysql_query($sql) OR die(mysql_error());
$colors = array('s2','s3','s4','s5','s6','s7','s8');$ac=1;
if(mysql_num_rows($items)>0){
while($item=mysql_fetch_array($items)){
$bnick=getsnick($item[1]);
$bmd=mysql_fetch_array(mysql_query("select mood from budmood437 where uid='".$item[1]."'"));
if($smds[0]==2)$sign=getsmilies1(getbbcode(htmlspecialchars($ bmd[0],ENT_QUOTES),$siid),$ud);else $sign=getsmilies(getbbcode(htmlspecialchars($bmd[0],ENT_QUOTES),$siid),$ud);
$atime=humanTiming($item[2]);
$pl=mysql_fetch_array(mysql_query("select place from online437 where uid='".$item[1]."'"));
$plz=mysql_fetch_array(mysql_query("select lsat from users437 where uid='".$item[1]."'"));
$sx=mysql_fetch_array(mysql_query("select sex from users437 where uid='".$item[1]."'"));
if($sx[0]=="Male")
$sx = '<img src="../images/m.gif" alt="male">';else $sx = '<img src="../images/f.gif" alt="female">';
if(isonline($item[1])==1){$sts= '-(<font color="green">ON</font>)';$ost='<b>Where :</b> '.$pl[0].'';}
else {$sts= '-(<font color="red">OFF</font>)';$ost='<b>Last Seen :</b> '.$plz[0].'';}
$mxc=$ac%7;$ac++;$mxcl=$colors[$mxc];
echo '<div class="'.$mxcl.'">';
echo ''.$sx.' <a href="pf.php?opt=info&who='.$item[1].'&sid='.$siid.'"><b>'.$bnick.'</b>'.$sts.'</a><br/>';
echo '<b><u>Active :</u></b> <font style="font-size:20px;">'.$atime.'</font> ago<br/>';
if($bmd[0]!="") echo '<div class="sam2"><hr><b><img src="http://love254.waplux.com/files/52735/Forumss.png" alt=""/><font style="font-size:20px;">|St@tus Updated </font><img src="../images/ok.gif" alt=""/>|</b><hr></div><ul><hr><li>'.$sign.'</li>';
echo '<li><red><u><font style="font-size:20px;">'.$ost.'</font></u></red></li>';
$tibud=gettotalbud($item[1]);
echo '<li><b>My Friends :</b> <u><font style="font-size:20px;"><a href="buds.php?action=ufrndz&sid='.$siid.'& ;who='.$item[1].'">'.$tibud.'</a></font></u></li>';
echo '<li><b>Since :</b> <u><font style="font-size:20px;">'.$item[3].'</font></u></li>';
echo '<li><i><small> Tell your friends to update their friend status, in order to have a good view of your friendsList</small></i></li>';
echo '<hr></ul></div>';
echo '<table id="sm2"><tr><td><a href="inbox.php?action=sendpm&who='.$item[1].'&sid='.$siid.'">Msg</a></td><td><a href="inbox.php?action=sendpopup&who='.$item[1].'&sid='.$siid.'">Popup</a></td><td><a href="mshop.php?action=gifts&who='.$item[1].'&sid='.$siid.'">Send Gift</a></td><td><a href="inbox.php?action=sendmms&who='.$item[1].'&sid='.$siid.'">File</a></td></tr></table>';
}} else{
if($type=="boys") $$cxb='Male';
else if($type=="girls") $$cxb='Female';
else if($type=="all") $$cxb='';
else $cxb='Online';
echo '<ul><li><b>You</b> have no '.$cxb.' Friends.</li></ul>';
}
if($type=="all")$boin='all';else if($type=="boys")$boin='boys';else if($type=="girls")$boin='girls';else $boin='';
if($page>1 || $page==$num_pages)
{
$ppage = $page-1;
$cen1='<a href="./buds.php?action='.$action.'&page='.$ppage.'&sid='. $siid.'&type='.$boin.'">Prev</a>';
}
if($page!=1)$cen2=''.$page.'/'.$num_pages.'';else $cen2=''.$num_pages.' Pages';
if($page<=$num_pages)
{$npage = $page+1;
if($page<$num_pages)
$cen3='<a href="./buds.php?action='.$action.'&page='.$npage.'&sid='. $siid.'&type='.$boin.'">Next</a>';else $cen3='Next';
if($num_pages>1)
echo '<p class="left">'.$cen1.'</p><p class="center">'.$cen2.'</p><p class="right">'.$cen3.'</p>';}
if($num_pages>1){$myv=$page-1;
$rets = '<form action="./buds.php" method="get">';
$rets .= '<input name="page" format="*N" size="3" value="'.$myv.'">';
$rets .= '<input type="hidden" name="action" value="'.$action.'">';
$rets .= '<input type="hidden" name="sid" value="'.$siid.'">';
$rets .= '<input type="hidden" name="type" value="'.$boin.'">';
$rets .= '<input type="submit" name="Submit" value="visit"></form>';
echo ''.$rets.'';
}
}
////////////////////////
else if($action=="ufrndz"){
head_tag("Friends",$theme);
echo '<body>';
$uacount=gettotalbud($who);$uob=getonlinebud($who) ;$umcount=getmbuds($who);$ufcount=getfbuds($who);
if($type=="boys"){$mycount=$umcount;
echo '<table id="sm2"><tr>';
echo '<td><a href="buds.php?action=ufrndz&sid='.$siid.'"&who='. $who.'">Online-('.$uob.')</a></td>';
echo '<td><a href="buds.php?action=ufrndz&sid='.$siid.'&who='.$ who.'&type=all">All-('.$uacount.')</a></td>';
echo '<td><b>Boys-('.$umcount.')</b></td>';
echo '<td><a href="buds.php?action=ufrndz&sid='.$siid.'&who='.$ who.'&type=girls">Girls-('.$ufcount.')</a></td>';
echo '</tr></table>';}
else if($type=="girls"){$mycount=$ufcount;
echo '<table id="sm2"><tr>';
echo '<td><a href="buds.php?action=ufrndz&sid='.$siid.'&who='.$ who.'">Online-('.$uob.')</a></td>';
echo '<td><a href="buds.php?action=ufrndz&sid='.$siid.'&who='.$ who.'&type=all">All-('.$uacount.')</a></td>';
echo '<td><a href="buds.php?action=ufrndz&sid='.$siid.'&who='.$ who.'&type=boys">Boys-('.$umcount.')</a></td>';
echo '<td><b>Girls-('.$ufcount.')</b></td>';
echo '</tr></table>';}
else if($type=="all"){$mycount=$uacount;
echo '<table id="sm2"><tr>';
echo '<td><a href="buds.php?action=ufrndz&sid='.$siid.'&who='.$ who.'">Online-('.$uob.')</a></td>';
echo '<td><b>All-('.$acount.')</b></td>';
echo '<td><a href="buds.php?action=ufrndz&sid='.$siid.'&who='.$ who.'&type=boys">Boys-('.$umcount.')</a></td>';
echo '<td><a href="buds.php?action=ufrndz&sid='.$siid.'&who='.$ who.'&type=girls">Girls-('.$ufcount.')</a></td>';
echo '</tr></table>';}
else {$mycount=$uob;
echo '<table id="sm2"><tr>';
echo '<td><b>Online-('.$uob.')</b></td>';
echo '<td><a href="buds.php?action=ufrndz&sid='.$siid.'&who='.$ who.'&type=all">All-('.$uacount.')</a></td>';
echo '<td><a href="buds.php?action=ufrndz&sid='.$siid.'&who='.$ who.'&type=boys">Boys-('.$umcount.')</a></td>';
echo '<td><a href="buds.php?action=ufrndz&sid='.$siid.'&who='.$ who.'&type=girls">Girls-('.$ufcount.')</a></td>';
echo '</tr></table>'; }
if($page=="" || $page<=0)$page=1;
$num_items = $mycount; //changable
$items_per_page= 5;
$num_pages = ceil($num_items/$items_per_page);
if($page>$num_pages)$page= $num_pages;
$limit_start = ($page-1)*$items_per_page;
if($type=="boys") {$sql="select uid,tid,ttime,date,tsx from buds437 where uid='".$who."'and tsx='Male' and agreed='1' order by ttime desc limit ".$limit_start.", ".$items_per_page."";
addonline($ud,$time,"Viewing ".$nickk." : Friends-<b>(Boys)</b>");}
else if($type=="girls") {$sql="select uid,tid,ttime,date,tsx from buds437 where uid='".$who."'and tsx='Female' and agreed='1' order by ttime desc limit ".$limit_start.", ".$items_per_page."";
addonline($ud,$time,"Viewing ".$nickk." : Friends-<b>(Girls)</b>");}
else if($type=="all"){$sql="select uid,tid,ttime,date,tsx from buds437 where uid='".$who."' and agreed='1' order by ttime desc limit ".$limit_start.", ".$items_per_page."";
addonline($ud,$time,"Viewing ".$nickk." : <b>All</b> Friends");}
else{$ltime=$time-10800;
$sql="select uid,tid,ttime,date,tsx from buds437 where uid='".$who."' and ttime>'".$ltime."' and agreed='1' order by ttime desc limit ".$limit_start.", ".$items_per_page."";
addonline($ud,$time,"Viewing ".$nickk." : <b>Online</b> Friends");}
$items=mysql_query($sql) OR die(mysql_error());
$colors = array('s2','s3','s4','s5','s6','s7','s8');$ac=1;
if(@mysql_num_rows($items)>0){
while($item=mysql_fetch_array($items)){
$bnick=getsnick($item[1]);
$bmd=mysql_fetch_array(mysql_query("select mood from budmood437 where uid='".$item[1]."'"));
if($smds[0]==2)$sign=getsmilies1(getbbcode(htmlspecialchars($ bmd[0],ENT_QUOTES),$siid),$ud);else $sign=getsmilies(getbbcode(htmlspecialchars($bmd[0],ENT_QUOTES),$siid),$ud);
$atime=humanTiming($item[2]);
$pl=mysql_fetch_array(mysql_query("select place from online437 where uid='".$item[1]."'"));
$sx=mysql_fetch_array(mysql_query("select sex from users437 where uid='".$item[1]."'"));
if($sx[0]=="Male")
$sx = '<img src="../images/m.gif" alt="male">';else $sx = '<img src="../images/f.gif" alt="female">';
if(isonline($item[1])==1){$sts= '-(<font color="green">ON</font>)';$ost='<b>Where :</b> '.$pl[0].'';}
else {$sts= '-(<font color="red">OFF</font>)';$ost='<b>Last Seen :</b> '.$pl[0].'';}
$mxc=$ac%7;$ac++;$mxcl=$colors[$mxc];
echo '<div class="'.$mxcl.'">';
echo ''.$sx.' <a href="pf.php?opt=info&who='.$item[1].'&sid='.$siid.'"><b>'.$bnick.'</b>'.$sts.'</a><br/>';
echo '<b>Active :</b> '.$atime.' ago<br/>';
if($bmd[0]!="") echo '<b>Signature :</b> '.$sign.'<br/>';
echo ''.$ost.'<br/>';
$tibud=gettotalbud($item[1]);
echo '<b>My Friends :</b> <a href="buds.php?action=ufrndz&sid='.$siid.'& ;who='.$item[1].'">'.$tibud.'</a><br/>';
echo '<b>Since :</b> '.$item[3].'';
echo '</div>';
echo '<table id="sm2"><tr><td><a href="inbox.php?action=sendpm&who='.$item[1].'&sid='.$siid.'">Msg</a></td><td><a href="inbox.php?action=sendpopup&who='.$item[1].'&sid='.$siid.'">Popup</a></td><td><a href="mshop.php?action=gifts&who='.$item[1].'&sid='.$siid.'">Send Gift</a></td><td><a href="inbox.php?action=sendmms&who='.$item[1].'&sid='.$siid.'">File</a></td></tr></table>';
}} else{
$wbnick=getsnick($who);
if($type=="boys") $$cxb='Male';
else if($type=="girls") $$cxb='Female';
else if($type=="all") $$cxb='';
else $cxb='Online';
echo '<ul><li><b>'.$wbnick.'</b> have no '.$cxb.' Friends.</li></ul>';
}
if($type=="all")$boin='all';else if($type=="boys")$boin='boys';else if($type=="girls")$boin='girls';else $boin='';
if($page>1 || $page==$num_pages)
{
$ppage = $page-1;
$cen1='<a href="./buds.php?action='.$action.'&page='.$ppage.'&sid='. $siid.'&type='.$boin.'">Prev</a>';
}
if($page!=1)$cen2=''.$page.'/'.$num_pages.'';else $cen2=''.$num_pages.' Pages';
if($page<=$num_pages)
{$npage = $page+1;
if($page<$num_pages)
$cen3='<a href="./buds.php?action='.$action.'&page='.$npage.'&sid='. $siid.'&type='.$boin.'">Next</a>';else $cen3='Next';
if($num_pages>1)
echo '<p class="left">'.$cen1.'</p><p class="center">'.$cen2.'</p><p class="right">'.$cen3.'</p>';}
if($num_pages>1){$myv=$page-1;
$rets = '<form action="./buds.php" method="get">';
$rets .= '<input name="page" format="*N" size="3" value="'.$myv.'">';
$rets .= '<input type="hidden" name="action" value="'.$action.'">';
$rets .= '<input type="hidden" name="sid" value="'.$siid.'">';
$rets .= '<input type="hidden" name="type" value="'.$boin.'">';
$rets .= '<input type="submit" name="Submit" value="visit"></form>';
echo ''.$rets.'';
}
}
else if($action=="budmood"){head_tag("Updating Buddy Mood",$theme);addonline($ud,$time,"Updating Buddy Mood");
echo '<body><div>Update Your Mood</div><br/><br/>';
echo '<p align="center"><form action="genproc.php?action=upbmsg&sid='.$siid. '" method="post">Text:<input name="bmsg" maxlength="700" value=""/><br/><input type="submit" name="bmd" value="Save"/></form><br/>';}
else if($action=="pmall"){head_tag("Pm All Buds",$theme);addonline($ud,$time,"Sending pm to Buddies");
echo '<body><div>Pm All Buddies</div><br/><br/>';
$pls=mysql_fetch_array(mysql_query("select plusses from users437 where uid='".$ud."'"));
if($pls[0]<50){ echo '<p align="center"><img src="../images/error.gif" alt="x"/>Min 50 plusses required To Mass Pm<br/></p>';}
else{echo '<p align="center"><form action="genproc.php?action=dopm&sid='.$siid.'" method="post">Text:<input name="pmsg" maxlength="1000" value=""/><br/><input type="submit" name="pbd" value="Send"/></form><br/>';}echo '<center><a href="buds.php?action=main&sid='.$siid.'">Back</a><br/></center>';}
else if($action=="popdlg"){head_tag("Viewing Popup Dialog",$theme);addonline($ud,$time,"Viewing Popup Dialog");
$count=mysql_fetch_array(mysql_query("select COUNT(*) from popups437 where byid='".$ud."' or toid='".$ud."'"));
if($page==""||$page<=0)$page=1;
$num_items=$count[0];
$items_per_page=10;
$num_pages=ceil($num_items/$items_per_page);
if($num_pages==0)$num_pages=$page;
if(($page>$num_pages)&&$page!=1)$page=$num_pages;
$limit_start=($page-1)*$items_per_page;
$sql="select * from popups437 where byid='".$ud."' or toid='".$ud."' order by id DESC limit ".$limit_start.",".$items_per_page."";
$items=mysql_query($sql) OR die(mysql_error());
$colors = array('s2','s3','s4','s5','s6','s7','s8');$ac=1;
if(mysql_num_rows($items)>0)
{
while($item=mysql_fetch_array($items)){
if(isonline($item[3])==1)$oxc='<p><img src="../images/on.gif" alt="+"/>';else $oxc='<img src="../images/off.gif" alt="-"/>';
$popnick=getsnick($item[3]);
$popmsg=getsmilies(getbbcode(htmlspecialchars($ite m[2],ENT_QUOTES),$siid),$ud);
$mxc=$ac%7;$ac++;$mxcl=$colors[$mxc];
echo '<div class="'.$mxcl.'">';
echo ''.$oxc.'<a href="pf.php?opt=info&who='.$item[3].'&sid='.$siid.'">'.$popnick.'</a> '.$item[1].'<br/>'.$popmsg.'</div>';
}}
else echo '<center>No Popup Dialog<br/>--------------</center>';
if($page>1 || $page==$num_pages)
{
$ppage = $page-1;
$cen1='<a href="./buds.php?action='.$action.'&page='.$ppage.'&sid='. $siid.'&">Prev</a>';
}
if($page!=1)$cen2=''.$page.'/'.$num_pages.'';else $cen2=''.$num_pages.' Pages';
if($page<=$num_pages)
{$npage = $page+1;
if($page<$num_pages)
$cen3='<a href="./buds.php?action='.$action.'&page='.$npage.'&sid='. $siid.'">Next</a>';else $cen3='Next';
echo '<p class="left">'.$cen1.'</p><p class="center">'.$cen2.'</p><p class="right">'.$cen3.'</p>';}
if($num_pages>1){$myv=$page-1;
$rets = '<form action="./buds.php" method="get">';
$rets .= '<input name="page" format="*N" size="3" value="'.$myv.'">';
$rets .= '<input type="hidden" name="action" value="'.$action.'">';
$rets .= '<input type="hidden" name="sid" value="'.$siid.'">';
$rets .= '<input type="submit" name="Submit" value="visit"></form>';
echo ''.$rets.'';
}
echo '<p align="center">';if($unr==0){echo '<br/><br/><a href="rwdpm.php?action=pdlg&sid='.$siid.'">Dow nload</a><br/>only first 50 messages<br/>';}echo '<a href="buds.php?action=main&sid='.$siid.'">[Back]</a></p>';}
else { head_tag("ERROR",$theme);echo '<center>WRONG ACTION PERFORMED</center>';}
foot_tag($ud,$siid,1,1,1,1,1,1,1);
mysql_close();exit();
?>
I will be very grateful if you help me with this.
I have a full working Demo. Check it here www.ossy.wc.lt
I
Comment