<?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");

$albumname = $_GET['albumname'];
$fromuser = $_GET['fromuser'];
$kennwort = $_POST['kennwort'];

$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 diese Fotos nicht sehen.<br><br><br></center>";
		include("footer.php");
		die();
		}


		$resultB = sql_query("SELECT album , kennwort FROM `".$prefix."_user_pics_alben` WHERE `from` = '".$fromuser."' AND `album` = '".$albumname."'");
		if (!$resultB)
		{
		echo "<center>Hauptfoto nicht gefunden.</center>";
		}
		while($alben = sql_fetch_assoc($resultB))
		{
		if (!empty($alben['kennwort']))
		{

if ($alben['kennwort'] == $kennwort) {

}
else {
?>
<table width="85%" border="0" align="center" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td height="40">&nbsp;</td>
  </tr>
</table>
<table width="85%" 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="<?php echo $GLOBALS['bgcolor6'];?>">
<table width="85%" border="0" align="center" cellpadding="0" cellspacing="0">
        <!--DWLayoutTable-->
        <tr>
          <td height="40">&nbsp;</td>
        </tr>
      </table>
      <table width="85%" border="0" align="center" cellpadding="0" cellspacing="0">
        <!--DWLayoutTable-->
        <tr>
          <td height="40"><div align="center"><b>Sorry, das Passwort ist Flasch</b><br><br><INPUT type=button value=" Zurück " onClick="history.back();"></div></td>
        </tr>
      </table>
      <table width="85%" border="0" align="center" cellpadding="0" cellspacing="0">
        <!--DWLayoutTable-->
        <tr>
          <td height="40">&nbsp;</td>
        </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="85%" border="0" align="center" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td height="40">&nbsp;</td>
  </tr>
</table>
<?php
include("footer.php");
die();
}
} else { }
}

?>

  <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> <a href=\"modules.php?name=$module_name&file=selectalbum&fromuser=".$fromuser."\">[Zur Alben Übersicht]</a>";
	  if($fromuser == $cookie[1])
	  {
	  echo "&nbsp;<a href=\"modules.php?name=user_pics&file=isuser&option=alben\">[Alben Verwalten]</a>";
	  }

	  ?></td>
    </tr>
  </table>
<?php
echo "<table width=\"85%\" border=\"0\" align=\"center\" style=\"border-bottom: 1px dotted black;\"><tr><td align=\"center\"><b>".$albumname."</b></td></tr></table><br><br>\n";
?>
<table width="85%" border="0" align="center" cellpadding="0" cellspacing="0" >
  <!--DWLayoutTable-->
  <tr>
    <td height="40" align="center" valign="center"><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="<?php echo $GLOBALS['bgcolor6'];?>">
            <?php


$colcounter=1;
echo "<table width=\"88%\" border=\"0\" align=\"center\"><tr>\n";

		$resultA = sql_query("SELECT * FROM `".$prefix."_user_pics` WHERE `user` = '".$fromuser."' AND `album` = '".$albumname."' AND `aktiv` != '0'");
		if (!$resultA)
		{
		echo "<center>Hauptfoto nicht gefunden.</center>";
		}
		while($pics = sql_fetch_assoc($resultA))
		{

		// Kommentare ermitteln
        $comments_num = 0;
        $resultB = sql_query("SELECT Count(gid) FROM `".$prefix."_user_pics_comments` WHERE `topic` = '".$pics['foto']."';");
        list($comments_num) = sql_fetch_row($resultB);


#$newcomment = "<a href=\"\" onmouseover=\"return overlib('<table><tr><td class=overlib>Neue Kommentare</td></tr></table>', FULLHTML);\" onmouseout=\"return nd();\"><img src=\"modules/$module_name/media/images/general.gif\"></a>";
if(MX_IS_ADMIN) {
$delpic = "<br><a href=\"modules.php?name=user_pics&file=data&option=deletefotoadmin&foto=".$pics['foto']."&fromuser=".$fromuser."\">[Foto Löschen]</a>";
}
else
{
$delpic = "";
}
echo "<td align=\"center\" width=\"215\"><table width=\"35%\" align=\"center\"><tr><td width=\"15%\" align=\"right\" onmouseover=\"return overlib('<table><tr><td class=overlib>Views</td></tr></table>', FULLHTML);\" onmouseout=\"return nd();\"><img src=\"modules/$module_name/media/images/view.gif\"></td><td width=\"35%\">".$pics['clicks']."<td width=\"15%\" align=\"right\" onmouseover=\"return overlib('<table><tr><td class=overlib>Kommentare</td></tr></table>', FULLHTML);\" onmouseout=\"return nd();\"><img src=\"modules/$module_name/media/images/comments.gif\"></td><td width=\"35%\">".$comments_num."</td></tr></table><br><a style=\"cursor:pointer;\" href=\"modules.php?name=$module_name&file=bildercontentview&foto=".$pics['foto']."&album=".$pics['album']."&gid=".$pics['gid']."&fromuser=".$pics['user']."#pic\"><img style=\"border: 2px solid #F2F2F2;\" src='".$thumb_dir_thumb_gross."/thumb_".$pics['foto'].".jpg'></a>".$delpic."</td>";
if (floor($colcounter/$bilderviewreihe)==1)
{
echo "</tr><tr>\n";
        $colcounter=0;
}

$colcounter++;
}
echo "</tr></table>\n";
?>
          </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></td>
  </tr>
</table>
<table width="85%" border="0" align="center" cellpadding="0" cellspacing="0" >
  <!--DWLayoutTable-->
  <tr>
    <td align="center" valign="center"><!--DWLayoutEmptyCell-->&nbsp;</td>
  </tr>
</table>
<table width="85%" 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");


?>