i remember sweetangel request this code long time ago.. and also some one ask abt this again last night here is the code... if u get ne error post ur readpm page ill fixit for u
Note : Showing Last 4 dialogs
Demo : Attached
Code:
////////////////////////////////////////////////////////// $pminfo = mysql_fetch_array(mysql_query("SELECT text, byuid, touid, reported, title, id FROM ibwf_private WHERE id='".$pmid."'")); print'<div class="sender">Dialog</div>'; $uid = getuid_sid($sid); if($page=="" || $page<=0)$page=1; $myid = getuid_sid($sid); $pms = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_private WHERE (byuid='".$pminfo[1]."' AND touid='".$pminfo[2]."') OR (byuid='".$pminfo[2]."' AND touid='".$pminfo[1]."') ORDER BY timesent")); echo mysql_error(); $num_items = $pms[0]; //changable $items_per_page= 4; $num_pages = ceil($num_items/$items_per_page); if($page>$num_pages)$page= $num_pages; $limit_start = ($page-1)*$items_per_page; if($num_items>0) { $pms = mysql_query("SELECT byuid, text, timesent, id FROM ibwf_private WHERE (byuid='".$pminfo[1]."' AND touid='".$pminfo[2]."') OR (byuid='".$pminfo[2]."' AND touid='".$pminfo[1]."') ORDER BY timesent LIMIT $limit_start, $items_per_page"); while($pm=mysql_fetch_array($pms)) { if(isonline($pm[0])) { $iml = ""; }else{ $iml = ""; } $tmopm = date("d m y - h:i:s",$pm[2]); $tmstamp = $pm[2]; $tremain = time()-$tmstamp; //$tmdt = date("d m Y - H:i:s", $tmstamp); $tmdt = gettimemsg($tremain)." ago"; $msg = " ".htmlspecialchars((strlen($pm[1])<25?$pm[1]:substr($pm[1], 0, 25))); $bylnk = "<a href=\"inbox.php?action=readpm&pmid=$pm[3]&sid=$sid\"><b>$msg</b></a> $tmdt"; echo $bylnk; echo "<br/>"; } } echo "<a href=\"inbox.php?action=dialog&sid=$sid&who=$pminfo[1]\">More.....</a><br/>";
Demo : Attached