<?php

if (!defined("mxMainFileLoaded")) die ("You can't access this file directly...");
$module_name = basename(dirname(__FILE__));
include("modules/$module_name/funktions.php");

global $prefix;

include("header.php");

$fromuser = $_GET['fromuser'];
?>
  <table width="85%" border="0" align="center" cellpadding="0" cellspacing="0" >
    <!--DWLayoutTable-->
    <tr>
      <td height="40" align="center" valign="center"><?php echo "<a href=\"modules.php?name=Userinfo&uname=".$fromuser."\">[Zum Profil von ".$fromuser."]</a>"; ?></td>
    </tr>
  </table>

<table width="88%" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="1%"><img src="images/designbox/box2_tl.gif" width="18" height="9" /></td>
    <td background="images/designbox/box_t.gif"><img src="images/designbox/box_t.gif" width="28" height="9"></td>
    <td width="1%"><img src="images/designbox/box2_tr.gif" width="9" height="9" /></td>
  </tr>
  <tr>
    <td valign="top" background="images/designbox/box2_ml.gif" ><img src="images/designbox/box2_ml.gif" width="18" height="10" /></td>
    <td width="88%" bgcolor="#EFEFEF">
<?php
echo "<table width=\"85%\" border=\"0\" align=\"center\"><tr><td align=\"center\" width=\"450\" valign=\"top\">";
echo "<table width=\"85%\" height=\"35\" style=\"border-bottom: 1px solid black;\"><tr><td width=\"85%\"><center><b>Alben von: ".$fromuser."</b></center></td></tr></table>";

		$pics_numA = 0;
        $resultC = sql_query("SELECT Count(gid) FROM `".$prefix."_user_pics` WHERE `user` = '".$fromuser."' AND `album` = 'bilder';");
        list($pics_numA) = sql_fetch_row($resultC);

		echo "<table width=\"450\" height=\"100\" background=\"modules/$module_name/media/images/selectalbum.gif\"><tr><td width=\"85%\" align=\"center\">";
		echo "<a style=\"font-size: 16px; font-weight:bold\" href=\"modules.php?name=$module_name&file=viewalbum&fromuser=".$fromuser."&albumname=Bilder\">Bilder ( Standard )&nbsp;&nbsp;-&nbsp;&nbsp; Bilder: ".$pics_numA."</a>";
		echo "</td></tr></table>";


		$resultA = sql_query("SELECT album , kennwort FROM `".$prefix."_user_pics_alben` WHERE `from` = '".$fromuser."'");
		if (!$resultA)
		{
		echo "<center>Hauptfoto nicht gefunden.</center>";
		}
		while($alben = sql_fetch_assoc($resultA))
		{
		// Fotos ermitteln
        $pics_num = 0;
        $resultB = sql_query("SELECT Count(gid) FROM `".$prefix."_user_pics` WHERE `user` = '".$fromuser."' AND `album` = '".$alben['album']."';");
        list($pics_num) = sql_fetch_row($resultB);

		if (!empty($alben['kennwort']))
		{
		$link = "modules.php?name=$module_name&file=passworteingabe&fromuser=".$fromuser."&albumname=".$alben['album']."";
		$passwortbild = "<img src=\"modules/$module_name/media/images/login.gif\">";
		}
		else
		{
		$link = "modules.php?name=$module_name&file=viewalbum&fromuser=".$fromuser."&albumname=".$alben['album']."";
		$passwortbild = "";
		}

		echo "<table width=\"450\" height=\"100\" background=\"modules/$module_name/media/images/selectalbum.gif\"><tr><td width=\"85%\" align=\"center\">";
		echo "<a style=\"font-size: 16px; font-weight:bold\" href=\"".$link."\">".$alben['album']."&nbsp;&nbsp;-&nbsp;&nbsp; Bilder: ".$pics_num."".$passwortbild."</a>";
		echo "</td></tr></table>";

		}



echo "</td>";
echo "</tr></table>";
?>
    </td>
    <td background="images/designbox/box_mr.gif" ><img src="images/designbox/box_mr.gif" width="9" height="19" /></td>
  </tr>
  <tr>
    <td><img src="images/designbox/box2_bl.gif" width="18" height="9" /></td>
    <td background="images/designbox/box_b.gif"><img src="images/designbox/box_b.gif" width="28" height="9" /></td>
    <td><img src="images/designbox/box_br.gif" width="9" height="9" /></td>
  </tr>
</table>

  <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" >
    <!--DWLayoutTable-->
    <tr>
      <td height="40" align="center" valign="center"><?php echo $copyright; echo $version; ?></td>
    </tr>
  </table>
<?php
include("footer.php");





?>