[ Index ]

PHP Cross Reference of phpwcms V1.4.7 _r403 (01.11.10)

title

Body

[close]

/include/inc_lib/content/ -> cnt31.readform.inc.php (source)

   1  <?php
   2  /*************************************************************************************
   3     Copyright notice
   4     
   5     (c) 2002-2010 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  // Content Type Images Special
  33  $content["image_html"]        = slweg($_POST['image_html']);
  34  $content["image_template"]    = clean_slweg($_POST['template']);
  35  $content['image_special']    = array(
  36  
  37              'pos'            => empty($_POST['cimage_pos']) ? 0 : intval($_POST['cimage_pos']),
  38              'width'            => empty($_POST['cimage_width']) ? '' : intval($_POST['cimage_width']),
  39              'height'        => empty($_POST['cimage_height']) ? '' : intval($_POST['cimage_height']),
  40              'width_zoom'    => empty($_POST['cimage_width_zoom']) ? $phpwcms['img_prev_width'] : intval($_POST['cimage_width_zoom']),
  41              'height_zoom'    => empty($_POST['cimage_height_zoom']) ? $phpwcms['img_prev_height'] : intval($_POST['cimage_height_zoom']),
  42              'col'            => empty($_POST['cimage_col']) ? 1 : intval($_POST['cimage_col']),
  43              'space'            => empty($_POST['cimage_space']) ? 0 : intval($_POST['cimage_space']),
  44              'zoom'            => empty($_POST['cimage_zoom']) ? 0 : 1,
  45              'lightbox'        => empty($_POST['cimage_lightbox']) ? 0 : 1,
  46              'nocaption'        => empty($_POST['cimage_nocaption']) ? 0 : 1,
  47              'center'        => empty($_POST['cimage_center']) ? 0 : intval($_POST['cimage_center']),
  48              'crop'            => empty($_POST['cimage_crop']) ? 0 : 1,
  49              'crop_zoom'        => empty($_POST['cimage_crop_zoom']) ? 0 : 1,
  50              'fx1'            => empty($_POST['cimage_fx1']) ? 0 : 1,
  51              'fx2'            => empty($_POST['cimage_fx2']) ? 0 : 1,
  52              'fx3'            => empty($_POST['cimage_fx3']) ? 0 : 1,
  53              'images'        => array()
  54  
  55          );
  56  
  57  // get image entry POST values
  58  if(isset($_POST['cimage_id_thumb']) && is_array($_POST['cimage_id_thumb']) && count($_POST['cimage_id_thumb'])) {
  59      
  60      $x = 0;
  61      
  62      foreach($_POST['cimage_id_thumb'] as $key => $value) {
  63      
  64          $image_entry = array();
  65          
  66          $image_entry['thumb_id']    = intval($_POST['cimage_id_thumb'][$key]);
  67          $image_entry['zoom_id']        = intval($_POST['cimage_id_zoom'][$key]);
  68          
  69          if(!$image_entry['thumb_id'] && !$image_entry['zoom_id']) {
  70              continue;
  71          }
  72          
  73          $image_entry['thumb_name']    = clean_slweg($_POST['cimage_name_thumb'][$key]);
  74          $image_entry['zoom_name']    = clean_slweg($_POST['cimage_name_zoom'][$key]);
  75          $image_entry['sort']        = $x;
  76          $image_entry['caption']        = clean_slweg($_POST['cimage_caption'][$key]);
  77          $image_entry['freetext']    = slweg($_POST['cimage_freetext'][$key]);
  78          $image_entry['url']            = clean_slweg($_POST['cimage_url'][$key]);
  79          
  80          if(!$image_entry['thumb_id']) {
  81              $image_entry['thumb_id']    = '';
  82              $image_entry['thumb_name']    = '';
  83              $image_entry['thumb_hash']    = '';
  84              $image_entry['thumb_ext']    = '';
  85          } else {
  86              $sql   = 'SELECT f_hash, f_ext FROM '.DB_PREPEND.'phpwcms_file WHERE ';
  87              $sql  .= 'f_id='.$image_entry['thumb_id'].' AND ';
  88              $sql  .= 'f_trash=0 AND f_aktiv=1 AND f_public=1';
  89              $image_data = _dbQuery($sql);
  90              if(isset($image_data[0]['f_hash'])) {
  91                  $image_entry['thumb_hash']    = $image_data[0]['f_hash'];
  92                  $image_entry['thumb_ext']    = $image_data[0]['f_ext'];
  93              }
  94          }
  95          if(!$image_entry['zoom_id']) {
  96              $image_entry['zoom_id']        = '';
  97              $image_entry['zoom_name']    = '';
  98              $image_entry['zoom_hash']    = '';
  99              $image_entry['zoom_ext']    = '';
 100          } else {
 101              $sql   = 'SELECT f_hash, f_ext FROM '.DB_PREPEND.'phpwcms_file WHERE ';
 102              $sql  .= 'f_id='.$image_entry['zoom_id'].' AND ';
 103              $sql  .= 'f_trash=0 AND f_aktiv=1 AND f_public=1';
 104              $image_data = _dbQuery($sql);
 105              if(isset($image_data[0]['f_hash'])) {
 106                  $image_entry['zoom_hash']    = $image_data[0]['f_hash'];
 107                  $image_entry['zoom_ext']    = $image_data[0]['f_ext'];
 108              }
 109          }
 110  
 111          $content['image_special']['images'][$x] = $image_entry;
 112          
 113          $x++;
 114      
 115      }
 116  
 117  }
 118  
 119  
 120  ?>


Generated: Tue Nov 16 22:51:00 2010 Cross-referenced by PHPXref 0.7