[ Index ]

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

title

Body

[close]

/ -> fileinfo.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  // session_name('hashID');
  24  session_start();
  25  
  26  $phpwcms = array();
  27  require_once ('config/phpwcms/conf.inc.php');
  28  
  29  if(empty($_SESSION["wcs_user_lang"])) {
  30      session_destroy();
  31      headerRedirect($phpwcms['site'].$phpwcms["root"]);
  32  
  33  } else {
  34      require ('include/inc_lang/backend/en/lang.ext.inc.php');
  35      $cust_lang = 'include/inc_lang/backend/'.substr($_SESSION["wcs_user_lang"],0,2).'/lang.ext.inc.php';
  36      if(is_file($cust_lang)) include($cust_lang);
  37  }
  38  require_once  ('include/inc_lib/default.inc.php');
  39  require_once  (PHPWCMS_ROOT.'/include/inc_lib/dbcon.inc.php');
  40  
  41  require_once  ("include/inc_lib/general.inc.php");
  42  checkLogin();
  43  require_once  ("include/inc_lib/backend.functions.inc.php");
  44  require_once  ("include/inc_lib/imagick.convert.inc.php");
  45  require_once  ("include/inc_lib/autolink.inc.php");
  46  
  47  $file_id    = (isset($_GET["fid"])) ? intval($_GET["fid"]) : 0;
  48  $public        = (isset($_GET["public"])) ? true : false;
  49  
  50  if($file_id) {
  51  
  52      $file_key = get_list_of_file_keywords();
  53  
  54      if($public) {
  55          //public file
  56          $sql =  "SELECT * FROM ".DB_PREPEND."phpwcms_file WHERE f_id=".$file_id." ".
  57                  "AND f_kid=1 AND f_trash=0 AND (f_public=1 OR ".
  58                  "f_uid=".$_SESSION["wcs_user_id"].") AND f_aktiv=1 LIMIT 1";
  59      } else {
  60          //private file
  61          $sql =  "SELECT * FROM ".DB_PREPEND."phpwcms_file WHERE f_id=".$file_id.
  62                  " AND f_kid=1 AND (f_trash=0 OR f_trash=1) AND f_uid=".$_SESSION["wcs_user_id"]." LIMIT 1";
  63      }
  64      if($result = mysql_query($sql, $db) or die("error")) {
  65          if($row = mysql_fetch_assoc($result)) {
  66              $filename = html_specialchars($row["f_name"]);
  67              
  68              
  69              $thumb_image = get_cached_image(
  70                      array(    "target_ext"    =>    $row["f_ext"],
  71                              "image_name"    =>    $row["f_hash"] . '.' . $row["f_ext"],
  72                              "thumb_name"    =>    md5($row["f_hash"].'538538'.$phpwcms["sharpen_level"]),
  73                              "max_width"        =>    538,
  74                              "max_height"    =>    538
  75                      )
  76                  );
  77          
  78  ?>
  79  <html>
  80  <head>
  81  <title><?php echo $BL['FILEINFO_TITLE'] ?></title>
  82  <meta http-equiv="Content-Type" content="text/html; charset=<?php echo PHPWCMS_CHARSET ?>">
  83  <meta http-equiv="Expires" content="0">
  84  <meta http-equiv="Pragma" content="no-cache">
  85  <meta http-equiv="cache-control" content="no-cache">
  86  <meta name="robots" content="noindex, nofollow">
  87  <script src="include/inc_js/phpwcms.js" language="JavaScript" type="text/JavaScript"></script>
  88  <?php
  89  echo '
  90  <script language="JavaScript" type="text/javascript">
  91  <!--
  92  
  93  function ResizeAndCenter(){
  94      var width = 590;
  95  ';
  96  if($thumb_image != false) {
  97      echo '
  98      var height = screen.availHeight;
  99      if(height < 490) {
 100          height=420;
 101      } else {
 102          height=570;
 103      }
 104  ';
 105  } else {
 106      echo '    var height = 300;';
 107  }
 108  
 109  echo '
 110      window.moveTo(5,5);
 111      window.resizeTo(width,height);
 112  }
 113  //-->
 114  </script>
 115  ';
 116  
 117  ?>
 118  <link href="include/inc_css/phpwcms.css" rel="stylesheet" type="text/css">
 119  </head>
 120  
 121  <body text="#000000" link="#000000" vlink="#000000" alink="#000000" onLoad="ResizeAndCenter();">
 122  <table width="558" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#C1D2E2" summary="">
 123    <tr bgcolor="#C1D2E2"><td colspan="4"><img src="img/leer.gif" alt="" width="1" height="8"></td></tr>
 124    <tr bgcolor="#C1D2E2">
 125      <td width="10"><img src="img/leer.gif" alt="" width="10" height="1"></td>
 126      <td width="20"><img src='img/icons/small_<?php echo extimg($row["f_ext"]) ?>' alt="" border=0></td>
 127      <td width="518" class="h14b"><strong><?php echo $filename ?></strong></td>
 128      <td width="10"><img src="img/leer.gif" alt="" width="10" height="1"></td>
 129    </tr>
 130    <tr bgcolor="#C1D2E2"><td colspan="4"><img src="img/leer.gif" alt="" width="10" height="6"></td></tr>
 131    <tr bgcolor="#363E57"><td colspan="4"><img src="img/leer.gif" alt="" width="1" height="1"></td></tr>
 132    <tr><td colspan="4" bgcolor="#F5F8F9"><img src="img/leer.gif" alt="" width="1" height="5"></td></tr>
 133    <tr>
 134      <td bgcolor="#F5F8F9"><img src="img/leer.gif" alt="" width="1" height="1"></td>
 135      <td bgcolor="#F5F8F9"><img src="img/leer.gif" alt="" width="1" height="1"></td>
 136      <td bgcolor="#F5F8F9"><table width="518" border="0" cellpadding="0" cellspacing="0" summary="">
 137        <tr>
 138          <td width="422" class="v10"><?php echo $BL['CREATED'] ?>: <strong><?php echo date($BL['DATE_FORMAT'], intval($row["f_created"])) ?></strong>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $BL['SIZE'] ?>: <strong><?php echo fsizelong($row["f_size"]) ?></strong></td>
 139          <td width="96" align="right"><?php 
 140          if(!$row["f_trash"]) {
 141          ?><a href="include/inc_act/act_download.php?dl=<?php 
 142          
 143          echo $row["f_id"];
 144          //download public file too
 145          if($public) echo '&amp;pl=1';
 146          
 147          ?>" target="_blank" title="<?php echo $BL['DOWNLOAD_FILE'].": ".$filename ?>"><img src="img/button/download_disc_large.gif" alt="" width="61" height="13" border="0"></a><?php 
 148          } else {
 149           echo "<img src=\"img/button/file_in_trash.gif\" width=\"61\" height=\"13\" border=\"0\" title=\"".$BL['FILE_IN_TRASH']."\">";
 150          }
 151          ?><img src="img/leer.gif" alt="" width="9" height="1"><img src="img/button/aktiv_12x13_<?php echo $row["f_aktiv"] ?>.gif" alt="" width="12" height="13"><img src="img/button/public_12x13_<?php echo $row["f_public"] ?>.gif" alt="" width="12" height="13"></td>
 152        </tr>
 153      </table></td>
 154      <td bgcolor="#F5F8F9"><img src="img/leer.gif" alt="" width="1" height="1"></td>
 155    </tr>
 156    <tr><td colspan="4" bgcolor="#F5F8F9"><img src="img/leer.gif" alt="" width="1" height="5"></td></tr>
 157    <tr><td colspan="4" bgcolor="#CDDEE4"><img src="img/leer.gif" alt="" width="1" height="1"></td></tr>
 158    <tr><td colspan="4"><img src="img/leer.gif" alt="" width="1" height="5"></td></tr>
 159    <tr>
 160      <td><img src="img/leer.gif" alt="" width="1" height="5"></td>
 161      <td><img src="img/leer.gif" alt="" width="1" height="5"></td>
 162      <td class="v10"><?php echo $BL['KEYWORDS'].": ".html_specialchars($row["f_shortinfo"].add_keywords_to_search ($file_key, $row["f_keywords"])) ?></td>
 163      <td><img src="img/leer.gif" alt="" width="1" height="5"></td>
 164    </tr>
 165    <tr><td colspan="4"><img src="img/leer.gif" alt="" width="1" height="5"></td></tr>
 166  <?php
 167  
 168      if($thumb_image != false) {
 169  ?>
 170    <tr><td colspan="4" bgcolor="#CDDEE4"><img src="img/leer.gif" alt="" width="1" height="1"></td></tr>
 171    <tr><td colspan="4" bgcolor="#F5F8F9"><img src="img/leer.gif" alt="" width="1" height="5"></td></tr>
 172    <tr>
 173      <td bgcolor="#F5F8F9"><img src="img/leer.gif" alt="" width="1" height="1"></td>
 174      <td colspan="2" align="center" bgcolor="#F5F8F9"><?php
 175      
 176      echo '<img src="'.PHPWCMS_IMAGES . $thumb_image[0] .'" border="0" '.$thumb_image[3].'>';
 177  
 178      ?></td>
 179      <td bgcolor="#F5F8F9"><img src="img/leer.gif" alt="" width="1" height="5"></td>
 180    </tr>
 181    <tr><td colspan="4" bgcolor="#F5F8F9"><img src="img/leer.gif" alt="" width="1" height="5"></td></tr>
 182  <?php 
 183      } 
 184      if($row["f_longinfo"]) {
 185  ?>
 186    <tr><td colspan="4" bgcolor="#CDDEE4"><img src="img/leer.gif" alt="" width="1" height="1"></td></tr>
 187    <tr><td colspan="4"><img src="img/leer.gif" alt="" width="1" height="5"></td></tr>
 188    <tr>
 189      <td><img src="img/leer.gif" alt="" width="1" height="5"></td>
 190      <td><img src="img/leer.gif" alt="" width="1" height="5"></td>
 191      <td class="v10"><?php echo nl2br(auto_link(html_specialchars($row["f_longinfo"]))) ?></td>
 192      <td><img src="img/leer.gif" alt="" width="1" height="5"></td>
 193    </tr>
 194    <tr><td colspan="4"><img src="img/leer.gif" alt="" width="1" height="5"></td></tr>
 195    <?php } ?>
 196    <tr><td colspan="4" bgcolor="#CDDEE4"><img src="img/leer.gif" alt="" width="1" height="1"></td></tr>
 197    <tr bgcolor="#EBF2F4">
 198      <td><img src="img/leer.gif" alt="" width="10" height="10"></td>
 199      <td><img src="img/leer.gif" alt="" width="20" height="1"></td>
 200      <td><img src="img/leer.gif" alt="" width="518" height="1"></td>
 201      <td><img src="img/leer.gif" alt="" width="10" height="10"></td>
 202    </tr>
 203  </table>
 204  </body>
 205  </html>
 206  <?php
 207          } else {
 208              $fehler = 1;
 209          }
 210      } else {
 211          $fehler = 1;
 212      }
 213  } else {
 214      $fehler = 1;
 215  }
 216  
 217  if(isset($fehler)) {
 218      echo $BL['DOWNLOAD_ERR3'];
 219  }
 220  ?>


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