[ Index ]

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

title

Body

[close]

/include/inc_lib/content/ -> cnt29.readform.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  
  33  // Content Type Images
  34  
  35  $content["image_list"]         = isset($_POST["cimage_list"]) ? $_POST["cimage_list"] : array();
  36  $content["image_pos"]         = empty($_POST["cimage_pos"]) ? 0 : intval($_POST["cimage_pos"]);
  37  
  38  $content["image_width"]     = intval($_POST["cimage_width"]) ? intval($_POST["cimage_width"]) : '';
  39  $temp_width                 = $content["image_width"];
  40  
  41  $content["image_height"]     = intval($_POST["cimage_height"]) ? intval($_POST["cimage_height"]) : '';
  42  $temp_height                 = $content["image_height"];
  43  
  44  $content["image_space"]     = intval($_POST["cimage_space"]);
  45  $content["image_col"]         = intval($_POST["cimage_col"]);
  46  $content["image_caption"]     = clean_slweg($_POST["cimage_caption"], 0 , false);
  47  $content["image_zoom"]         = empty($_POST["cimage_zoom"]) ? 0 : 1;
  48  $content["image_crop"]         = empty($_POST["cimage_crop"]) ? 0 : 1;
  49  $content["image_cctext"]     = explode(LF, $content["image_caption"]);
  50  
  51  $content["image_template"]    = clean_slweg($_POST['template']);
  52  
  53  $content["text"]            = slweg($_POST["ctext"]);
  54  
  55  $content['tmp_images']        = array();
  56  
  57  if(is_array($content["image_list"]) && count($content["image_list"])) {
  58  
  59  
  60      $content["image_list"] = array_map('intval', $content["image_list"]);
  61      $content["image_list"] = array_diff($content["image_list"], array(0,'',NULL,false));
  62  
  63      if(count($content["image_list"])) {
  64      
  65          $img_all = _dbQuery('SELECT * FROM '.DB_PREPEND.'phpwcms_file WHERE f_id IN ('.implode(',', $content["image_list"]).')');
  66          
  67          // take all values from db
  68          $temp_img_row = array();
  69          foreach($img_all as $value) {
  70              $temp_img_row[ $value['f_id'] ] = $value;
  71          }
  72          
  73          // now run though image result - but keep sorting
  74          foreach($content["image_list"] as $key => $value) {
  75              if(isset($temp_img_row[$value])) {
  76              
  77                  $content['tmp_images'][$key][0]    = $temp_img_row[$value]['f_id'];
  78                  $content['tmp_images'][$key][1]    = $temp_img_row[$value]['f_name'];
  79                  $content['tmp_images'][$key][2]    = $temp_img_row[$value]['f_hash'];
  80                  $content['tmp_images'][$key][3]    = $temp_img_row[$value]['f_ext'];
  81                  $content['tmp_images'][$key][4]    = $temp_width;
  82                  $content['tmp_images'][$key][5]    = $temp_height;
  83                  $content['tmp_images'][$key][6]    = isset($content["image_cctext"][$key]) ? trim($content["image_cctext"][$key]) : '';
  84              
  85              }
  86          }
  87          
  88                  
  89          
  90      }
  91  }
  92  
  93  
  94  // take values
  95  $content['image_list']                     = array();
  96  $content['image_list']['images']        = $content['tmp_images'];
  97  $content['image_list']['width']            = $temp_width;
  98  $content['image_list']['height']        = $temp_height;
  99  $content['image_list']['pos']            = $content["image_pos"];
 100  $content['image_list']['col']            = $content["image_col"];
 101  $content['image_list']['zoom']            = $content["image_zoom"];
 102  $content['image_list']['crop']            = $content["image_crop"];
 103  $content['image_list']['space']            = $content["image_space"];
 104  $content['image_list']['lightbox']        = empty($_POST["cimage_lightbox"]) ? 0 : 1;
 105  $content['image_list']['nocaption']        = empty($_POST["cimage_nocaption"]) ? 0 : 1;
 106  
 107  $content['image_list']['center_image']    = empty($_POST["cimage_center"]) ? 0 : intval($_POST["cimage_center"]);
 108  if($content['image_list']['center_image'] > 3) {
 109      $content['image_list']['center_image'] = 0;
 110  } elseif($content['image_list']['center_image'] < 0) {
 111      $content['image_list']['center_image'] = 0;
 112  }        
 113  
 114  ?>


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