database_query($sqlpi) or $em .= $database->database_error(); $row = $database->database_fetch_row($queryc); $hcpuid=$row[0]; $hcpuname=$row[1]; $isapproved=$row[2]; $entrydate=$row[3]; $sqlcu="SELECT `se_users`.`user_photo`, `se_users`.`user_blocklist`, `se_users`.`user_invisible` FROM `se_users` WHERE `se_users`.`user_id` = ".$hcpuid." LIMIT 1"; $querycu=$database->database_query($sqlcu) or $em .= $database->database_error(); $row = $database->database_fetch_row($querycu); $uimg=$row[0]; $ubl=$row[1]; $uinv=$row[2]; if($uimg != "") { $uipi = pathinfo($uimg); $uiname=$uipi['filename']; $uiext=$uipi['extension']; $udir = (((int)($hcpuid/1000))*1000)+1000; $theudir=$_SERVER["DOCUMENT_ROOT"]."/uploads_user/".$udir."/".$hcpuid."/"; $uthumb=$theudir.$uiname."_thumb.".$uiext; if(file_exists($uthumb)) { $uphoto="/uploads_user/".$udir."/".$hcpuid."/".$uiname."_thumb.".$uiext; } else { $ufull=$theudir.$uiname.".".$uiext; if(file_exists($ufull)) { $uphoto="/uploads_user/".$udir."/".$hcpuid."/".$uiname.".".$uiext; } else { $uphoto="/images/nophoto.png"; } } // } else { $uphoto="/images/nophoto.png"; } $sqlc="SELECT Count(`hc_comment`.`hc_cid`) as `cpid` FROM `hc_comment` WHERE `hc_comment`.`hc_imgid` = ".$hc_pid; $queryc=$database->database_query($sqlc) or $em .= $database->database_error(); $thecount = $database->database_result($queryc,0); if($thecount > 0) { $sqld="SELECT `hc_comment`.`hc_cid`, `hc_comment`.`hc_imgid`, `hc_comment`.`hc_uid`, `hc_comment`.`hc_uname`, `hc_comment`.`hc_comment`, `hc_comment`.`hc_thedate` FROM `hc_comment` WHERE `hc_comment`.`hc_imgid` = ".$hc_pid; $queryd=$database->database_query($sqld) or $em .= $database->database_error(); while ($row = $database->database_fetch_assoc($queryd)) { $sqle="SELECT `se_users`.`user_photo`, `se_users`.`user_blocklist`, `se_users`.`user_invisible` FROM `se_users` WHERE `se_users`.`user_id` = ".$row["hc_uid"]." LIMIT 1"; $querye=$database->database_query($sqle) or $em .= $database->database_error(); $u = $database->database_fetch_row($querye); $uimg=$u[0]; $ubl=$u[1]; $uinv=$u[2]; if($uimg != "") { $uipi = pathinfo($uimg); $uiname=$uipi['filename']; $uiext=$uipi['extension']; $udir = (((int)($row["hc_uid"]/1000))*1000)+1000; $theudir=$_SERVER["DOCUMENT_ROOT"]."/uploads_user/".$udir."/".$row["hc_uid"]."/"; $uthumb=$theudir.$uiname."_thumb.".$uiext; if(file_exists($uthumb)) { $iuphoto="/uploads_user/".$udir."/".$row["hc_uid"]."/".$uiname."_thumb.".$uiext; } else { $ufull=$theudir.$uiname.".".$uiext; if(file_exists($ufull)) { $iuphoto="/uploads_user/".$udir."/".$row["hc_uid"]."/".$uiname.".".$uiext; } else { $iuphoto="/images/nophoto.png"; } } } else { $iuphoto="/images/nophoto.png"; } if($row["hc_uid"] != $_POST["theuid"] && $_POST["theuid"] != '21092' && $_POST["theuid"] != '8' && $_POST["theuid"] != '9') { $hc_icomments .='
'.$row["hc_thedate"].'
'.stripslashes($row["hc_comment"]).'
'; } else { $hc_icomments .='
'.$row["hc_thedate"].'
'.stripslashes($row["hc_comment"]).'
'; } } // end while } // end count gt 0 else { } $somestuff=""; if($_POST["theuid"]=="21092" || $_POST["theuid"]=="9" || $_POST["theuid"]=="8") { $therej=""; $theappr=""; if($isapproved=="no") { $therej='checked="checked"'; } if($isapproved=="yes"){ $theappr='checked="checked"'; } $somestuff='
Approve Reject
'; } $arr = array ('error'=>$em,'uphoto'=>$uphoto,'uname'=>$hcpuname,'entrydate'=>$entrydate,'ccount'=>$thecount,'allcomments'=>$hc_icomments,'somestuff'=>$somestuff); echo json_encode($arr); ?>