Location: PHPKode > scripts > Hot or Not Clone > hotornot/mainpage.php
<script language="JavaScript">
function popupWindow(id,phid,username){
	if(id==1)
	{
	window.open('emailfriend.php?username='+username,'03','top=10,left=10,width=450,height=275,resizable=no,scrollbars=yes,menubar=no');
	}
	else if(id==2)
	{
	window.open('reportabuse.php?username='+username,'03','top=10,left=10,width=450,height=275,resizable=no,scrollbars=yes,menubar=no');
	}
	else if(id==3)
	{
	window.open('postcomment.php?phid='+phid,'03','top=10,left=10,width=450,height=275,resizable=no,scrollbars=yes,menubar=no');
	}
	else if(id==4)
	{
	window.open('viewcomments.php?phid='+phid,'03','top=10,left=10,width=450,height=275,resizable=no,scrollbars=yes,menubar=no');
	}
	
}
</script>
<?
$numcomments=0;
$nomember=false;
$case=0;
if(empty($username))
{
	$sql="select * from members,photos where members.username=photos.username and active=1 and approved='Y' ORDER BY RAND() LIMIT 1";
}
else
{
	$sql="select * from members where username='$username' and active=1";	
	$case=1;
}

$res=mysql_query($sql);
if($obj=mysql_fetch_object($res))
{
	$username=$obj->username;
	$himessage="Hi I am $obj->fname $obj->lname";
	$aboutme=$obj->about;
}
else
{
	$nomember=true;
	$msg="No Pictures Exist!";
	if($case==1)$msg="No member exists with that username";
}
if(!$nomember)
{
	$sql="select * from photos where username='$username' and approved='Y' order by upldate desc";
	$res=mysql_query($sql);
	$num=0;
	if(mysql_num_rows($res)!=0)
	{
		$rnum=rand(0,mysql_num_rows($res)-1);
	}
	else
	{
		$nomember=true;
		$msg="No Pictures Exist for that username!";
	}
	
	while($obj=mysql_fetch_object($res))
	{
		if($obj->url=="")
		{
			$dpic="<img border=0 src='pics/$obj->filename'>";
		}
		else
		{
			$dpic="<img src='$obj->url'>";		
		}
		if((empty($phid)&&($num==$rnum))||($phid==$obj->photosid))
		{
			$photoid=$obj->photosid;
			$pic=$dpic;
			$allpics=$allpics."<b>".($num+1)."</b>&nbsp;";
			$numcomments=getNumComments($photoid);
		}
		else
		{
			$allpics=$allpics."<a href='index.php?username=$username&phid=$obj->photosid'>".($num+1)."</a>&nbsp;";
		}
		$num++;
	}
}

?>
<table width="100%" border="0" align="left" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="7%" height="239" align="center" valign="top"> <div align="center"><br>
        <br>
        <br>
      </div></td>
    <td width="93%" align="left" valign="top">
	<br>
	<?
	if(!$nomember)
	{
	?>
	  <table width="95%" height="10" border="0" cellpadding="0" cellspacing="0" class="mytable">
        <tr> 
          <td><div align="center"> 
              <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
                <form name="myform"  method="post" action="index.php" >
                  <input type="hidden" name="photoid" value="<? print $photoid; ?>">
                  <tr valign="middle" > 
                    <td height="25"  align="center" width=10 class="header">&nbsp;</td>
                    <td height="25" colspan="3" align="left" class="header"><? print $himessage;?></td>
                    <td height="25" align="center" class="header"> <input type="button" value="Skip this Image" name="B1" class="mybutton" onClick="javascript:location.href='index.php';"> 
                    </td>
                  </tr>
                  <tr valign="middle" > 
                    <td height="19" align="center" class="normal">&nbsp;</td>
                    <td height="19" colspan="4" align="left" class="normal" ><? print $aboutme;?></td>
                  </tr>
                  <tr valign="middle" > 
                    <td height="19" align="center">&nbsp;</td>
                    <td height="19" colspan="4" align="center" ><? print $pic;?></td>
                  </tr>
                  <?
				  if($num>1)
				  {
				  ?>
                  <tr valign="middle" > 
                    <td height="19" align="center">&nbsp;</td>
                    <td height="19" colspan="4" align="center" class="normal" ><? print getRating($photoid);?></td>
                  </tr>
                  <tr valign="middle" > 
                    <td height="19" align="center">&nbsp;</td>
                    <td height="19" colspan="3" align="left" class="normal" >Other 
                      Pictures of this user: <? print $allpics;?></td>
                    <td height="19" align="center" class="normal" >&nbsp;</td>
                  </tr>
                  <?
				  }
				  ?>
                  <tr valign="middle" class="normal"> 
                    <td height="19" align="center">&nbsp;</td>
                    <td height="19" colspan="4" align="center" > 
                      <?
						if((strpos($ratingcookie,"*$photoid*")===false))
						{
						?>
                      <table width="90%" height="45%" cellpadding="0" cellspacing="0" class="mytable">
                        <tr> 
                          <td><div align="center"> 
                              <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
                                <tr  class="normal" > 
                                  <td height="20" rowspan="2" align="center" class="header" >Rate 
                                    my looks..</td>
                                  <td width="7%" align="center" valign="middle" >1</td>
                                  <td width="7%" align="center" valign="middle" >2</td>
                                  <td width="7%" align="center" valign="middle" >3</td>
                                  <td width="7%" align="center" valign="middle" >4</td>
                                  <td width="7%" align="center" valign="middle" >5</td>
                                  <td width="7%" align="center" valign="middle" >6</td>
                                  <td width="7%" align="center" valign="middle" >7</td>
                                  <td width="7%" align="center" valign="middle" >8</td>
                                  <td width="7%" align="center" valign="middle" >9</td>
                                  <td width="7%" align="center" valign="middle" >10</td>
                                </tr>
                                <tr class="normal"  > 
                                  <td width="7%" align="center" valign="middle" ><B><FONT color=#003366 size=1> 
                                    <INPUT 
                        onclick=this.form.submit() type=radio value=1 name=vote>
                                    </FONT></B></td>
                                  <td width="7%" align="center" valign="middle" ><B><FONT color=#003366 size=1> 
                                    <INPUT 
                        onclick=this.form.submit() type=radio value=2 name=vote>
                                    </FONT></B></td>
                                  <td width="7%" align="center" valign="middle" ><B><FONT color=#003366 size=1> 
                                    <INPUT 
                        onclick=this.form.submit() type=radio value=3 name=vote>
                                    </FONT></B></td>
                                  <td width="7%" align="center" valign="middle"><B><FONT color=#003366 size=1> 
                                    <INPUT 
                        onclick=this.form.submit() type=radio value=4 name=vote>
                                    </FONT></B></td>
                                  <td width="7%" align="center" valign="middle" ><B><FONT color=#003366 size=1> 
                                    <INPUT 
                        onclick=this.form.submit() type=radio value=5 name=vote>
                                    </FONT></B></td>
                                  <td width="7%" align="center" valign="middle" ><B><FONT color=#003366 size=1> 
                                    <INPUT 
                        onclick=this.form.submit() type=radio value=6 name=vote>
                                    </FONT></B></td>
                                  <td width="7%" align="center" valign="middle" ><B><FONT color=#003366 size=1> 
                                    <INPUT 
                        onclick=this.form.submit() type=radio value=7 name=vote>
                                    </FONT></B></td>
                                  <td width="7%" align="center" valign="middle" ><B><FONT color=#003366 size=1> 
                                    <INPUT 
                        onclick=this.form.submit() type=radio value=8 name=vote>
                                    </FONT></B></td>
                                  <td width="7%" align="center" valign="middle" ><B><FONT color=#003366 size=1> 
                                    <INPUT 
                        onclick=this.form.submit() type=radio value=9 name=vote>
                                    </FONT></B></td>
                                  <td width="7%" align="center" valign="middle" ><B><FONT color=#003366 size=1> 
                                    <INPUT 
                        onclick=this.form.submit() type=radio value=10 name=vote>
                                    </FONT></B></td>
                                </tr>
                              </table>
                            </div></td>
                        </tr>
                      </table>
                      <?
					  }
					  else
					  {
					  	print "You have already rated this!";
					  }
					  ?>
                    </td>
                  </tr>
                  <tr valign="middle" > 
                    <td height="19" align="center" width=10>&nbsp;</td>
                    <td width="25%" height="25" align="center" ><a href="index.php?cmd=20&username=<? print $username; ?>">View 
                      my Profile</a></td>
                    <td width="25%" height="25" align="center" ><a href="index.php?cmd=19&username=<? print $username; ?>">Send 
                      a message</a></td>
                    <td width="25%" height="25" align="center" ><a href="javascript:popupWindow(1,0,'<? print $username; ?>');">Email 
                      a friend</a></td>
                    <td width="25%" height="25" align="center" ><a href="javascript:popupWindow(2,0,'<? print $username; ?>');">Report 
                      Abuse</a></td>
                  </tr>
                  <tr valign="middle" > 
                    <td height="19" align="center" width=10>&nbsp;</td>
                    <td height="25" colspan="2" align="center" ><a href="index.php?cmd=12&phid=<? print $photoid; ?>">Post 
                      a Comment</a><a href="index.php?cmd=19&username=<? print $username; ?>"></a></td>
                    <td height="25" colspan="2" align="center" ><a href="javascript:popupWindow(4,<? print $photoid; ?>,'');">View 
                      Comments posted(<? print $numcomments;?>) </a></td>
                  </tr>
                </form>
              </table>
            </div></td>
        </tr>
      </table>
	  <?
	  }
	  else
	  {
	  ?>
      <table width="95%" height="10" border="0" cellpadding="0" cellspacing="0" class="mytable">
        <tr> 
          <td><div align="center"> 
              <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
                <form name="myform"  method="post" action="index.php" >
                  <input type="hidden" name="photoid2" value="<? print $photoid; ?>">
                  <tr > 
                    <td width="98%" height="19" class="header"><? print $msg;?></td>
                  </tr>
                </form>
              </table>
            </div></td>
        </tr>
      </table>
	  <?
	  }
	  ?>
      <br>
    </td>
  </tr>
</table>
Return current item: Hot or Not Clone