Location: PHPKode > scripts > Hot or Not Clone > hotornot/control/comments.php
<?

include("../config.php");
include("checksession.php");
include("functions.php");
	$thumbheight=getSetting("THUMBHEIGHT");
	$thumbwidth=getSetting("THUMBWIDTH");

 if(!empty($mode))$appr='Y';else $appr='N';
$sql="select * from comments,photos where comments.photosid=photos.photosid and comments.approved='$appr' order by postdate";
$result = mysql_query($sql);
$count=mysql_num_rows($result);

$size=20;
$page="comments.php?mode=$mode";

if(!isset($startindex))$startindex=0;
if($count!=0)$sindex=$startindex+1;else $sindex=0;
if(($startindex+$size)<$count)$eindex=$startindex+$size;else $eindex=$count;

if($startindex>0)$links=$links."<a href='$page&startindex=".($startindex-$size)."$catextra'>Previous $size</a>";else $links=$links."Previous $size";
$links=$links. " | ";
if(($startindex+$size)<$count)$links=$links."<a href='$page&startindex=".($startindex+$size)."$catextra'>Next $size</a>";else $links=$links."Next $size";

$ph="$sindex-$eindex of $count";
$sql=$sql. " limit $startindex,$size";
	
?>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link rel="stylesheet" href="stylesheet.css" type="text/css">

<title>Control Panel</title>
<script language="JavaScript">
function popupWindow(id){
window.open('viewprofile.php?username='+id,'03','top=10,left=10,width=550,height=375,resizable=yes,scrollbars=yes,menubar=no');
}
</script>
</head>
<script language="JavaScript">
 <?php
    if(isset($error))
    {
    if($error=="lo")print("alert('Your old password is wrong!');");
	}
    ?>
</script>
</head>

<body leftmargin="0" rightmargin="0" bottommargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#FCFAF7" text="#000000" >

<div align="left"> 
  <table border="0" cellpadding="0" cellspacing="0" width="100%" height="41">
    <tr> 
      <td width="150%" bgcolor="#000000" height="1"></td>
    </tr>
    <tr > 
      <td width="100%" align="left" valign="bottom" bgcolor="#FFFFFF" class="topheader"  > 
        Control Panel </td>
    </tr>
  </table>
</div>

<div align="left"> 
  <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td width="20%" valign="top"> 
        <? include("sidelinks.php"); ?>
      </td>
      <td width="80%" valign="top" align="center"><br>
        <table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr> 
            <td><div align="center"> 
                <table width="100%" height="10" border="0" cellpadding="0" cellspacing="0" class="mytable">
                  <tr> 
                    <td > <div align="center"> 
                        <table width="100%" border="0" align="center" bordercolor="#000080">
                          <tr class="header"> 
                            <td colspan="4"><? if(!empty($mode)) print "Approved "; else print "Unapproved ";?> Comments</td>
                          </tr>
                          <tr class="normal">
                            <td width="30%"><strong>Picture</strong></td>
                            <td><strong>Comment</strong></td>
                            <td width="20%"><strong>Commenter</strong></td>
                            <td width="20%"><strong>Options</strong></td>
                          </tr>						  
                          <?
						  $res=mysql_query($sql);
						  while($obj=mysql_fetch_object($res))
						  {
					  		if($obj->url=="")
							{
								$img="<a target='_blank' href='../pics/$obj->filename'><img border=0 height=$thumbheight width=$thumbwidth src='../pics/$obj->filename'></a>";
							}
							else
							{
								$img="<a target='_blank' href='$obj->url'><img height=$thumbheight width=$thumbwidth src='$obj->url'></a>";		
							}

						  $username=$obj->username;
						  $id=$obj->commentsid;
						  $comment=$obj->comment;						  
						  $commenter=$obj->byusername;
						  ?>

                          <tr valign="top" class="normal"> 
                            <td width="20%" align="center"><? print $img; ?></td>
                            <td width="30%"><? print $comment; ?></td>
                            <td width="20%">  
                              <a href="javascript:popupWindow('<? print $commenter; ?>');"><? print $commenter; ?></a></td>
                            <td width="20%"><? if(empty($mode)) { ?><a href="approvecomment.php?id=<? print $id; ?>">Approve</a>&nbsp;|&nbsp;<? } ?><a href="deletecomment.php?id=<? print $id; ?>&mode=<? print $mode;?>">Delete</a></td>
                          </tr>
						  <?
						  }
						  if($count!=0)
						  {
						  ?>
                          <tr valign="top" class="normal"> 
                            <td colspan="2" align="left"><? print $links; ?></td>
                            <td width="20%"><? print $ph; ?> </td>
                          </tr>
						  <?
						  }
						  ?>
                        </table>
                      </div></td>
                  </tr>
                </table>
              </div></td>
          </tr>
        </table></td>
    </tr>
	
  </table>
</div>
</body>

</html>
Return current item: Hot or Not Clone