<?php
include("includes/site_info.php");
include('session_handler.inc');

$WUserID = $_REQUEST['uID'];
$member_query=mysql_query("SELECT mem_username FROM members WHERE mem_userid = '$WUserID' limit 1",$link) or die(mysql_error());
$member_count = mysql_num_rows($member_query);
if ($member_count == 0) {
?>

<div id="top_panel" class="darkpink_row_back">
	<?php include ("panel_top_main.php"); ?>
</div>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="5" class="white_back_t_xb">
          <tr>
          <td><div class="light_orang_h">
              <div style="background-color:#FF0000; width:10px; height:10px; float:left; margin-top:3px; margin-right:5px;"><img src="images/spacer.gif" width="10" height="10" /></div>
              Album </div>
            <div class="dot_line"><img src="images/spacer.gif" width="1" height="1" /></div>
            <div class="solid_line"><img src="images/spacer.gif" width="1" height="1" /></div></td>
        </tr>
      <tr>
          <td align="center"><div class="padding_10">Can't find a photo to view.</div></td>
        </tr>
      </table></td>
  </tr>
</table>
<?php
	die;
}
$member = mysql_fetch_object($member_query);
$WUsername = $member->mem_username;

if ($_REQUEST['app']) { $app = $_REQUEST['app']; }
else { $app = 0; die;}
if ($_REQUEST['pic']) { $pic = $_REQUEST['pic']; }
else { $pic = 0; die;}
if ($app=="blog") {
$photoitem_query=mysql_query("SELECT blg_picture as picture, blg_ext as ext FROM blogs WHERE blg_userid = '$WUserID' AND blg_approved='Y' AND blg_id='$pic' LIMIT 1") or die(mysql_error());
$photoitem_TOTAL = mysql_num_rows($photoitem_query);
}
if ($app=="article") {
$photoitem_query=mysql_query("SELECT art_picture as picture, art_ext as ext FROM articles WHERE art_userid = '$WUserID' AND art_approved='Y' AND art_id='$pic' Limit 1") or die(mysql_error());
$photoitem_TOTAL = mysql_num_rows($photoitem_query);
}

?>
			<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="5" class="white_back_t_xb">
            
<?php if ($photoitem_TOTAL > 0){ 
		while ($photo = mysql_fetch_object($photoitem_query) ) {

?>
            
            <tr class="solid_line_separator">
              <td align="center">
				<img src="<?=$SITE_MAIN_WWW_ROOT?>/members/<?=$WUsername?>/<?=$app?>/<?=$photo->picture?>.<?=$photo->ext?>" class="img_b_p3" border="0">
                       </td>
            </tr>
		  <?php }
		  } else {
?>
            
        <tr class="solid_line_separator">
          <td align="center"><div class="padding_10">Can't find a photo to view.</div></td>
        </tr>
<?php
	die;
}
?>
            <tr>
              <td>&nbsp;</td>
            </tr>
          </table></td>
  </tr>
</table>
