Can't see the whole body of this page..Only the head View User's Photos
else if($action=="viewuserphoto")
{
addonline(getuid_sid($sid),"Viewing Users Photos","");
echo "<head>";
echo "<title>Users Photos</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<center>";
echo "<b>View User's Photos</b><br/><br/>";
echo "</center>";
echo "<center>";
$who = $_GET["who"];
$uid1 = getuid_sid($sid);
$nick = getnick_uid($who);
if($page=="" || $page<=0)$page=1;
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery WHERE uid='".$who."'"));
$num_items = $noi[0]; //changable
$items_per_page= 1;
$num_pages = ceil($num_items/$items_per_page);
if(($page>$num_pages)&&$page!=1)$page= $num_pages;
$limit_start = ($page-1)*$items_per_page;
//changable sql
$sql = "SELECT uid, id, imageurl, sex, descript FROM ibwf_usergallery WHERE uid='".$who."' ORDER BY time DESC LIMIT $limit_start, $items_per_page";
$items = mysql_query($sql);
echo mysql_error();
if(mysql_num_rows($items)>0)
{
while ($item = mysql_fetch_array($items))
{
$sql = "SELECT rating FROM ibwf_usergallery_rating WHERE imageid='".$item[1]."'";
$imginfo = mysql_query($sql);
echo mysql_error();
if(mysql_num_rows($imginfo)>0)
{
while ($imginfos = mysql_fetch_array($imginfo)){
$ratingtotal = $ratingtotal + $imginfos[0];}
}
if($totalcomments<1){$totalcomments=0;}
$norm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery_rating WHERE imageid='".$item[1]."'"));
if ($norm[0]>0){
$rating = ceil($ratingtotal/$norm[0]);
}else{$rating=0;}
$rated = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery_rating WHERE byuid='".$uid1."' and imageid ='".$item[1]."'"));
$totalcomments = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery_rating WHERE imageid ='".$item[1]."' and commentsyn ='Y'"));
$userinfo = mysql_fetch_array(mysql_query("SELECT name FROM ibwf_users WHERE id='".$item[0]."'"));
if(canratephoto($uid1, $item[0]) and ($rated[0]==0))
{
echo "<a href=\"gallery.php?action=rate&sid=$sid&wh oimage=$item[1]\">Rate Photo</a>";
}
if($uid1==$item[0])
{
echo "<a href=\"genproc.php?action=upavg&sid=$sid&a vsrc=$item[2]\">Use as Avatar</a>";
}
if(($uid1=="1") or ($uid1==$item[0]))
{
echo " / <a href=\"gallery.php?action=del&sid=$sid&who image=$item[1]\">Delete</a>";
}
echo "<br/><a href=\"$item[2]\"><img src=\"$item[2]\" alt=\"$userinfo[0]: $page\"/></a><br/>";
if($uid1==$item[0])
{
if(strlen($item[4])>1){
$edtlnk = "<a href=\"gallery.php?action=edtdescript&sid=$sid &whoimage=$item[1]\">*</a>";
}else{
$edtlnk = "<a href=\"gallery.php?action=edtdescript&sid=$sid &whoimage=$item[1]\">*Add Description*</a>";
}
echo "$item[4] $edtlnk<br/><br/>";
}
echo "Rating: $rating/10 (<a href=\"gallery.php?action=votes&sid=$sid&w hoimage=$item[1]\">$norm[0]</a> Votes)<br/><a href=\"gallery.php?action=comments&sid=$sid&am p;whoimage=$item[1]\">Comments</a>($totalcomments[0])";
echo "<br/>";
$ratingtotal = 0;
$sex = $item[3];
}
}
echo "</center>";
echo "<center>";
if($page>1)
{
$ppage = $page-1;
echo "<a href=\"gallery.php?action=$action&sid=$sid& ;page=$ppage&who=$who\">« Prev</a> ";
}
echo " $page/$num_pages ";
if($page<$num_pages)
{
$npage = $page+1;
echo "<a href=\"gallery.php?action=$action&sid=$sid& ;page=$npage&who=$who\">Next »</a>";
}
if($num_pages>2)
{
$rets = "<br/><form action=\"gallery.php\" method=\"get\">";
$rets .= "Jump to Photo:<input name=\"page\" format=\"*N\" size=\"3\"/><br/>";
$rets .= "<input type=\"submit\" value=\"GO\"/>";
$rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
$rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
$rets .= "<input type=\"hidden\" name=\"who\" value=\"$who\"/>";
$rets .= "<input type=\"hidden\" name=\"page\" value=\"$pg\"/>";
$rets .= "</form>";
echo $rets;
}
echo "<br/>";
echo "<a href=\"gallery.php?action=main&sid=$sid\">Gall ery</a><br/>";
if ($sex=="M"){
echo "<a href=\"gallery.php?action=males&sid=$sid\">Mal e Gallery</a>";
}else{
echo "<a href=\"gallery.php?action=females&sid=$sid\">F emale Gallery</a>";
}
echo "<br/>---<br/>";
echo "| <a href=\"inbox.php?action=main&sid=$sid\">Inbox</a> |";
echo " <a href=\"lists.php?action=buds&sid=$sid\">BuddyL ist</a> |";
echo " <a href=\"index.php?action=chat&sid=$sid\">Chatro oms</a> |";
echo " <a href=\"index.php?action=forumindx&sid=$sid\">F orums</a> |";
echo " <a href=\"index.php?action=main&sid=$sid\">Home</a> |";
echo "</center>";
echo "</body>";
echo "</html>";
exit();
}
else if($action=="viewuserphoto")
{
addonline(getuid_sid($sid),"Viewing Users Photos","");
echo "<head>";
echo "<title>Users Photos</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<body>";
echo "<center>";
echo "<b>View User's Photos</b><br/><br/>";
echo "</center>";
echo "<center>";
$who = $_GET["who"];
$uid1 = getuid_sid($sid);
$nick = getnick_uid($who);
if($page=="" || $page<=0)$page=1;
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery WHERE uid='".$who."'"));
$num_items = $noi[0]; //changable
$items_per_page= 1;
$num_pages = ceil($num_items/$items_per_page);
if(($page>$num_pages)&&$page!=1)$page= $num_pages;
$limit_start = ($page-1)*$items_per_page;
//changable sql
$sql = "SELECT uid, id, imageurl, sex, descript FROM ibwf_usergallery WHERE uid='".$who."' ORDER BY time DESC LIMIT $limit_start, $items_per_page";
$items = mysql_query($sql);
echo mysql_error();
if(mysql_num_rows($items)>0)
{
while ($item = mysql_fetch_array($items))
{
$sql = "SELECT rating FROM ibwf_usergallery_rating WHERE imageid='".$item[1]."'";
$imginfo = mysql_query($sql);
echo mysql_error();
if(mysql_num_rows($imginfo)>0)
{
while ($imginfos = mysql_fetch_array($imginfo)){
$ratingtotal = $ratingtotal + $imginfos[0];}
}
if($totalcomments<1){$totalcomments=0;}
$norm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery_rating WHERE imageid='".$item[1]."'"));
if ($norm[0]>0){
$rating = ceil($ratingtotal/$norm[0]);
}else{$rating=0;}
$rated = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery_rating WHERE byuid='".$uid1."' and imageid ='".$item[1]."'"));
$totalcomments = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_usergallery_rating WHERE imageid ='".$item[1]."' and commentsyn ='Y'"));
$userinfo = mysql_fetch_array(mysql_query("SELECT name FROM ibwf_users WHERE id='".$item[0]."'"));
if(canratephoto($uid1, $item[0]) and ($rated[0]==0))
{
echo "<a href=\"gallery.php?action=rate&sid=$sid&wh oimage=$item[1]\">Rate Photo</a>";
}
if($uid1==$item[0])
{
echo "<a href=\"genproc.php?action=upavg&sid=$sid&a vsrc=$item[2]\">Use as Avatar</a>";
}
if(($uid1=="1") or ($uid1==$item[0]))
{
echo " / <a href=\"gallery.php?action=del&sid=$sid&who image=$item[1]\">Delete</a>";
}
echo "<br/><a href=\"$item[2]\"><img src=\"$item[2]\" alt=\"$userinfo[0]: $page\"/></a><br/>";
if($uid1==$item[0])
{
if(strlen($item[4])>1){
$edtlnk = "<a href=\"gallery.php?action=edtdescript&sid=$sid &whoimage=$item[1]\">*</a>";
}else{
$edtlnk = "<a href=\"gallery.php?action=edtdescript&sid=$sid &whoimage=$item[1]\">*Add Description*</a>";
}
echo "$item[4] $edtlnk<br/><br/>";
}
echo "Rating: $rating/10 (<a href=\"gallery.php?action=votes&sid=$sid&w hoimage=$item[1]\">$norm[0]</a> Votes)<br/><a href=\"gallery.php?action=comments&sid=$sid&am p;whoimage=$item[1]\">Comments</a>($totalcomments[0])";
echo "<br/>";
$ratingtotal = 0;
$sex = $item[3];
}
}
echo "</center>";
echo "<center>";
if($page>1)
{
$ppage = $page-1;
echo "<a href=\"gallery.php?action=$action&sid=$sid& ;page=$ppage&who=$who\">« Prev</a> ";
}
echo " $page/$num_pages ";
if($page<$num_pages)
{
$npage = $page+1;
echo "<a href=\"gallery.php?action=$action&sid=$sid& ;page=$npage&who=$who\">Next »</a>";
}
if($num_pages>2)
{
$rets = "<br/><form action=\"gallery.php\" method=\"get\">";
$rets .= "Jump to Photo:<input name=\"page\" format=\"*N\" size=\"3\"/><br/>";
$rets .= "<input type=\"submit\" value=\"GO\"/>";
$rets .= "<input type=\"hidden\" name=\"action\" value=\"$action\"/>";
$rets .= "<input type=\"hidden\" name=\"sid\" value=\"$sid\"/>";
$rets .= "<input type=\"hidden\" name=\"who\" value=\"$who\"/>";
$rets .= "<input type=\"hidden\" name=\"page\" value=\"$pg\"/>";
$rets .= "</form>";
echo $rets;
}
echo "<br/>";
echo "<a href=\"gallery.php?action=main&sid=$sid\">Gall ery</a><br/>";
if ($sex=="M"){
echo "<a href=\"gallery.php?action=males&sid=$sid\">Mal e Gallery</a>";
}else{
echo "<a href=\"gallery.php?action=females&sid=$sid\">F emale Gallery</a>";
}
echo "<br/>---<br/>";
echo "| <a href=\"inbox.php?action=main&sid=$sid\">Inbox</a> |";
echo " <a href=\"lists.php?action=buds&sid=$sid\">BuddyL ist</a> |";
echo " <a href=\"index.php?action=chat&sid=$sid\">Chatro oms</a> |";
echo " <a href=\"index.php?action=forumindx&sid=$sid\">F orums</a> |";
echo " <a href=\"index.php?action=main&sid=$sid\">Home</a> |";
echo "</center>";
echo "</body>";
echo "</html>";
exit();
}
Comment