$nopl = "SELECT id, title, itemurl, uid, pudt, descarcat, descriere ,des ,comment, fileid FROM come4me_wapchat_categorii_download WHERE cid='".$cid."';
this is in comment
it is not working... wrong, showing comment counts ...pls...help
this is in comment
PHP Code:
else if ($action=="comments"){
$fileid = $_GET["fileid"];
$uid = getuid_sid($sid);
if($page=="" || $page<=0)$page=1;
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM iw_comup WHERE fileid='".$fileid."'"));
$num_items = $noi[0]; //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;
$sql = "SELECT fileid, commenter, comment, time, id FROM iw_comup WHERE fileid='".$fileid."' ORDER BY time DESC LIMIT $limit_start, $items_per_page";
////boxstart("File Comments");
$items = mysql_query($sql);
echo mysql_error();
if(mysql_num_rows($items)>0)
{
while ($item = mysql_fetch_array($items))
{
if(isonline($item[1]))
{
$iml = "<img src=\"http://coding-talk.com/images/onl.gif\" alt=\"+\"/>";
}else{
$iml = "<img src=\"http://coding-talk.com/images/ofl.gif\" alt=\"-\"/>";
}
$snick = getnick_uid($item[1]);
$lnk = "<a href=\"index.php?action=viewuser&who=$item[1]&sid=$sid\">$snick</a>";
$bs = date("d/m/y h:i:s A",$item[3] + addhours());
echo "$lnk<br/>";
if(ismod($uid))
{
$delnk = "<a href=\"share.php?action=delcmnt&sid=$sid&fileid=$item[4]\">[x]</a>";
}else{
$delnk = "";
}
$text = parsepm($item[2]);
echo "$text<br/>$bs $delnk<br/>";
}
}
echo "<p align=\"center\">";
if($page>1)
{
$ppage = $page-1;
echo "<a href=\"share.php?action=$action&page=$ppage&sid=$sid&fileid=$fileid\">«PREV</a> ";
}
if($page<$num_pages)
{
$npage = $page+1;
echo "<a href=\"share.php?action=$action&page=$npage&sid=$sid&fileid=$fileid\">Next»</a>";
}
echo "<br/>Page $page of $num_pages<br/>";
if($num_pages>2){
$rets = "<form action=\"share.php\" method=\"get\">Jump to page<input name=\"pg\" format=\"*N\" size=\"3\"/>";
$rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
$rets .= "<input type=\"hidden\" name=\"fileid\" value=\"$fileid\"/>";
$rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
$rets .= "<input id=\"inputButton\" type=\"submit\" value=\"Go\"/>";
$rets .= "</form>";
}
echo $rets;
echo "</p>";
////// UNTILL HERE >>
echo "<p align=\"center\">";
echo "<a href=\"share.php?action=addcmnt&sid=$sid&fileid=$fileid\">";
echo "Add your comment</a></p>";
}
////////////////////////////////////Post a comment(downloaders)////////////////////
$nopl = "SELECT id, title, itemurl, uid, pudt, descarcat, descriere ,des ,comment, fileid FROM come4me_wapchat_categorii_download WHERE cid='".$cid."';
echo "comments nopl[0]";
Comment