[ Index ]

PHP Cross Reference of phpwcms V1.4.3 _r380 (23.11.09)

title

Body

[close]

/include/inc_lib/ -> files.private.additions.inc.php (source)

   1  <?php
   2  /*************************************************************************************
   3     Copyright notice
   4     
   5     (c) 2002-2009 Oliver Georgi (oliver@phpwcms.de) // All rights reserved.
   6   
   7     This script is part of PHPWCMS. The PHPWCMS web content management system is
   8     free software; you can redistribute it and/or modify it under the terms of
   9     the GNU General Public License as published by the Free Software Foundation;
  10     either version 2 of the License, or (at your option) any later version.
  11    
  12     The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html
  13     A copy is found in the textfile GPL.txt and important notices to the license 
  14     from the author is found in LICENSE.txt distributed with these scripts.
  15    
  16     This script is distributed in the hope that it will be useful, but WITHOUT ANY 
  17     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  18     PARTICULAR PURPOSE.  See the GNU General Public License for more details.
  19   
  20     This copyright notice MUST APPEAR in all copies of the script!
  21  *************************************************************************************/
  22  
  23  
  24  // ----------------------------------------------------------------
  25  // obligate check for phpwcms constants
  26  if (!defined('PHPWCMS_ROOT')) {
  27     die("You Cannot Access This Script Directly, Have a Nice Day.");
  28  }
  29  // ----------------------------------------------------------------
  30  
  31  
  32  if(isset($_GET["all"])) { //Übernehmen der Aufklappwerte aus Session-Variable
  33      if($_GET["all"] == "open") { //alle aufklappen
  34          $sql = "SELECT f_id FROM ".DB_PREPEND."phpwcms_file WHERE f_kid=0 AND f_trash=0 AND f_uid=".$_SESSION["wcs_user_id"];
  35          if($result = mysql_query($sql, $db) or die ("error while open all directories")) {
  36              while($row = mysql_fetch_row($result)) {
  37                  $klapp[$row[0]] = 1;
  38              }
  39              $_SESSION["klapp"] = $klapp;
  40          }
  41      }
  42      if($_GET["all"] == "close") if(isset($_SESSION["klapp"])) unset($_SESSION["klapp"]);
  43  }
  44  
  45  if(isset($_SESSION["klapp"])) $klapp = $_SESSION["klapp"];
  46  
  47  if(isset($_GET["klapp"])) {
  48      list($klapp_id, $klapp_value) = explode("|", $_GET["klapp"]);
  49      $klapp[intval($klapp_id)] = intval($klapp_value);
  50      $_SESSION["klapp"] = $klapp; //Rückgabe des Aktuellen Array mit Aufklappwerten in die Session
  51      mysql_query("UPDATE ".DB_PREPEND."phpwcms_user SET usr_var_privatefile='".serialize($_SESSION["klapp"])."' WHERE usr_id=".$_SESSION["wcs_user_id"], $db);
  52  }
  53  
  54  //Zähler für die Listenfunktion setzen
  55  $_SESSION["list_zaehler"] = 0;
  56  
  57  //Feststellen, ob überhaupt Dateien/Ordner des Users vorhanden sind
  58  $sql = "SELECT COUNT(f_id) FROM ".DB_PREPEND."phpwcms_file WHERE ".
  59         "f_uid=".$_SESSION["wcs_user_id"]." AND f_trash=0 LIMIT 1";
  60  if($result = mysql_query($sql, $db) or die ("error while counting user files")) {
  61      if($row = mysql_fetch_row($result)) $count_user_files = $row[0];
  62      mysql_free_result($result);
  63  }
  64  
  65  //Wenn überhaupt Dateien für User vorhanden, dann Listing
  66  if(isset($count_user_files) && $count_user_files) {
  67      //Beginn Tabelle für Dateilisting
  68      echo "<table width=\"538\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
  69      echo "<tr><td colspan=\"2\"><img src=\"img/leer.gif\" width=\"1\" height=\"1\"></td></tr>\n";
  70      list_private(0, $db, 0, "phpwcms.php?do=files&amp;f=0", $_SESSION["wcs_user_id"], $cutID, $_SESSION["wcs_user_thumb"], $phpwcms);
  71      include_once  (PHPWCMS_ROOT."/include/inc_lib/files.private-filelist.inc.php");
  72      echo "</table>\n";
  73      //Ende Tabelle
  74  } else {
  75      //Wenn keinerlei Datensatz innerhalb Files durchlaufen wurde, dann
  76      echo "<img src=\"img/leer.gif\" width=\"1\" height=\"6\"><br />";            
  77      echo $BL['be_fprivadd_nofolders']."&nbsp;&nbsp;";
  78      echo "[<a href=\"phpwcms.php?do=files&amp;f=0&amp;mkdir=0\">".$BL['be_fpriv_button']."</a>]";
  79      echo "<br /><img src=\"img/leer.gif\" width=\"1\" height=\"6\">";
  80  }
  81  ?>


Generated: Wed Dec 30 05:55:15 2009 Cross-referenced by PHPXref 0.7