<?php
/**
 * This file is part of
 * pragmaMx - Web Content Management System.
 * Copyright by pragmaMx Developer Team - http://www.pragmamx.org
 *
 * pragmaMx is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * $Revision: 1.8.2.6 $
 * $Author: vittatus $
 * $Date: 2008/10/06 22:35:37 $
 *
 * this file based on:
 * Mitglieder Fotoalbum
 * Copyright ©2008 by Markus Wahl
 * Buy-Version - http://www.weelife.de/
 */
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'];


$fromuseruid_ignore = sql_fetch_array(sql_query("SELECT uid FROM `".$prefix."_users` WHERE `uname` = '".$fromuser."'"));

		$ignoreout = sql_fetch_array(sql_query("SELECT id FROM `".$prefix."_users_ignorelist` WHERE `uid` = '".$fromuseruid_ignore['uid']."' AND `ignoreid` = '".$cookie[0]."'"));

		if(!empty($ignoreout))
		{
		echo "<br><br><br>";
		echo "<center>".$fromuser." Hat Dich in seiner Ignoreliste. <br><br><br><br>Du darfst seine Fotos nicht einsehen.<br><br><br></center>";
		include("footer.php");
		die();
		}
?>

<style type="text/css">
<!--
table{}
table.album{background:<? echo $GLOBALS['bgcolor6']; ?> url('modules/user_pics/media/images/albumauswahl.gif');}
table.album:hover{background:<? echo $GLOBALS['bgcolor6']; ?> url('modules/user_pics/media/images/albumauswahl_hover.gif');
}
//-->
</style>
  <table width="95%" 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="98%" 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="98%" bgcolor="<?php echo $GLOBALS['bgcolor6'];?>">
<?php
echo "<table width=\"100%\" border=\"0\" align=\"center\"><tr><td align=\"center\" width=\"850\" valign=\"top\">";
echo "<table width=\"100%\" height=\"35\" style=\"border-bottom: 1px solid black;\"><tr><td width=\"100%\"><center><b>Alben von: ".$fromuser."</b></center></td></tr></table><br><br>";

		$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=\"850\" height=\"125\" class=\"album\" style=\"cursor: pointer\" onclick=\"location.href='modules.php?name=$module_name&file=viewalbum&fromuser=".$fromuser."&albumname=Bilder'\"><tr>";
		echo "<td width=\"165\" align=\"center\">&nbsp;</td><td width=\"635\"><table width=\"100%\"><tr><td width=\"100%\"><a style=\"font-size: 40px;\" href=\"modules.php?name=$module_name&file=viewalbum&fromuser=".$fromuser."&albumname=Bilder\">Bilder ( Standard )</a></td></tr>";
		echo "<tr><td>".$pics_numA." Bilder in diesem Album</td></tr></table>";
		echo "</td></tr></table><br><br>";


		$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 = "";
		}

		if($alben['album'] == "Fakecheck") {
		$fakestatus = sql_fetch_array(sql_query("SELECT fake FROM `".$prefix."_users` WHERE `uname` = '".$fromuser."'"));
		if($fakestatus['fake'] != "2") {
		echo "";
		} else {

		echo "<table width=\"850\" height=\"125\" class=\"album\" style=\"cursor: pointer\" onclick=\"location.href='".$link."'\"><tr>";
		echo "<td width=\"165\" align=\"center\">&nbsp;</td><td width=\"635\"><table width=\"100%\"><tr><td width=\"100%\"><a style=\"font-size: 40px;\" href=\"".$link."\">".$alben['album']."</a></td></tr>";
		echo "<tr><td>".$pics_num." Bilder in diesem Album ".$passwortbild."</td></tr></table>";
		echo "</td></tr></table><br><br>";

		}
		} else {

		echo "<table width=\"850\" height=\"125\" class=\"album\" style=\"cursor: pointer\" onclick=\"location.href='".$link."'\"><tr>";
		echo "<td width=\"165\" align=\"center\">&nbsp;</td><td width=\"635\"><table width=\"100%\"><tr><td width=\"100%\"><a style=\"font-size: 40px;\" href=\"".$link."\">".$alben['album']."</a></td></tr>";
		echo "<tr><td>".$pics_num." Bilder in diesem Album ".$passwortbild."</td></tr></table>";
		echo "</td></tr></table><br><br>";

		}


		}



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");





?>