[ Index ]

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

title

Body

[close]

/include/inc_lib/content/ -> cnt20.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  // Content Type Bid
  33  $content["bid"]["start_date"]            = clean_slweg($_POST["cbid_startdate"]);
  34  $content["bid"]["end_date"]                = clean_slweg($_POST["cbid_enddate"]);
  35  
  36  $content["bid"]["emailfrom"]            = clean_slweg($_POST["cbid_emailfrom"]);
  37  if(!is_valid_email($content["bid"]["emailfrom"])) {
  38      $content["bid"]["emailfrom"] = $phpwcms['SMTP_FROM_EMAIL'];
  39  }
  40  $content["bid"]["emailfromname"]        = clean_slweg($_POST["cbid_emailfromname"]);
  41  if(!$content["bid"]["emailfromname"]) $content["bid"]["emailfromname"] = $phpwcms['SMTP_FROM_NAME'];
  42  
  43  if($content["bid"]["start_date"]) {
  44      $content["bid"]["start_date"] = strtotime($content["bid"]["start_date"]);
  45      if($content["bid"]["start_date"] == -1) $content["bid"]["start_date"] = '';
  46  }
  47  if($content["bid"]["end_date"]) {
  48      $content["bid"]["end_date"] = strtotime($content["bid"]["end_date"]);
  49      if($content["bid"]["end_date"] == -1) $content["bid"]["end_date"] = '';
  50  }
  51  
  52  $content["bid"]["before"]                = slweg($_POST["cbid_before"]);
  53  $content["bid"]["after"]                 = slweg($_POST["cbid_after"]);
  54  $content["bid"]["text"]                 = slweg($_POST["cbid_text"]);
  55  
  56  $content["bid"]["form"]                 = slweg($_POST["cbid_form"]);
  57  $content["bid"]["form"]                 = preg_replace("'<form[^>]*?>(.*?)</form>'si", '$1', $content["bid"]["form"]);
  58  
  59  
  60  $content["bid"]["sent"]                 = slweg($_POST["cbid_sent"]);
  61  $content["bid"]["verified"]             = slweg($_POST["cbid_verified"]);
  62  $content["bid"]["notverified"]             = slweg($_POST["cbid_notverified"]);
  63  $content["bid"]["emailmsg"]             = slweg($_POST["cbid_emailmsg"]);
  64  
  65  $content["bid"]["startbid"]             = floatval($_POST["cbid_startbid"]);
  66  $content["bid"]["nextbidadd"]             = floatval($_POST["cbid_nextbidadd"]);
  67  
  68  $content["bid"]["image_name"]            = clean_slweg($_POST["cimage_name"]);
  69  $content["bid"]["image_id"]                = intval($_POST["cimage_id"]);
  70  
  71  $content["bid"]["image_width"]            = intval($_POST["cimage_width"]);
  72  $content["bid"]["image_height"]            = intval($_POST["cimage_height"]);
  73  $content["bid"]["image_zoom"]            = isset($_POST["cimage_zoom"]) ? intval($_POST["cimage_zoom"]) : 0;
  74  
  75  if(!$content["bid"]["image_width"])        $content["bid"]["image_width"] = '';
  76  if(!$content["bid"]["image_height"])    $content["bid"]["image_height"] = '';
  77  
  78  //prepare bid image
  79  if($content["bid"]["image_width"] > $phpwcms["content_width"] || $content["bid"]["image_width"] == '') {
  80      $content["bid"]["image_width"] = $phpwcms["content_width"];
  81  }
  82  
  83  /*
  84  if ($content["bid"]["image_id"] || $content["bid"]["image_name"]) {
  85  
  86      // check for image information and get alle infos from file
  87      $img_sql  = "SELECT f_thumb_preview, f_thumb_list FROM ";
  88      $img_sql .= DB_PREPEND . "phpwcms_file WHERE f_id=" . $content["bid"]["image_id"];
  89      $img_sql .= " AND f_name='" . aporeplace($content["bid"]["image_name"]) . "' LIMIT 1;";
  90  
  91      if ($img_result = mysql_query($img_sql, $db) or die("error while getting content image info")) {
  92  
  93          if ($img_row = mysql_fetch_row($img_result)) {
  94                      
  95              $content["bid"]["image_prev"] = $img_row[0];
  96              $content["bid"]["image_list"] = $img_row[1];
  97              $content["bid"]["image_prev_info"] = getimagesize(PHPWCMS_ROOT.'/'.$phpwcms["file_tmp"].$phpwcms["dir_preview"].$content["bid"]["image_prev"]);
  98              $content["bid"]["image_prev_make"] = 0; 
  99              
 100              // check real image sizes
 101              if(    $content["bid"]["image_width"] >= $content["bid"]["image_prev_info"][0] && 
 102                  $content["bid"]["image_height"] > $content["bid"]["image_prev_info"][1])
 103              {
 104                  //only make a copy of the image
 105                  copy(    PHPWCMS_ROOT."/".$phpwcms["file_tmp"].$phpwcms["dir_preview"].$content["bid"]["image_prev"], 
 106                          PHPWCMS_ROOT."/".$phpwcms["content_path"].$phpwcms["cimage_path"].cut_ext($content["bid"]["image_prev"])."-"
 107                          .$content["bid"]["image_prev_info"][0]."x".$content["bid"]["image_prev_info"][1]
 108                          .".".which_ext($content["bid"]["image_prev"]));
 109                  
 110                  //set that that preview make done
 111                  $content["bid"]["image_prev_make"] = 1;
 112              } 
 113              
 114              if($content["bid"]["image_width"] > $content["bid"]["image_prev_info"][0]) {
 115                  $content["bid"]["image_width"] = $content["bid"]["image_prev_info"][0];
 116              }
 117              
 118              if($content["bid"]["image_height"] > $content["bid"]["image_prev_info"][1]) {
 119                  $content["bid"]["image_height"] = $content["bid"]["image_prev_info"][1];
 120              }
 121  
 122              $content["bid"]["image_add"] = "-".$content["bid"]["image_width"]."x".$content["bid"]["image_height"];
 123                      
 124              $content["bid"]["image_cname"]  = cut_ext($content["bid"]["image_prev"]).$content["bid"]["image_add"].".";
 125              $content["bid"]["image_cname"] .= which_ext($content["bid"]["image_prev"]);
 126                  
 127          }
 128          mysql_free_result($img_result);
 129      
 130      }
 131      
 132  }
 133  */
 134          
 135  // now check if new resized image should be created
 136  if(isset($content["bid"]["image_prev_info"]) && count($content["bid"]["image_prev_info"]) && !$content["bid"]["image_prev_make"] && 
 137      !file_exists(PHPWCMS_ROOT."/".$phpwcms["content_path"].$phpwcms["cimage_path"].$content["bid"]["image_cname"])) {
 138      
 139      include_once  "include/inc_lib/imagick.convert.inc.php";
 140      $old_abort = ignore_user_abort(true);
 141      $create_cimage = imagick_converting($content["bid"]["image_prev"], $content["bid"]["image_add"], PHPWCMS_ROOT."/".$phpwcms["file_tmp"].$phpwcms["dir_preview"], PHPWCMS_ROOT."/".$phpwcms["content_path"].$phpwcms["cimage_path"], $content["bid"]["image_width"], $content["bid"]["image_height"]);
 142      ignore_user_abort($old_abort);
 143      if ($create_cimage["error"]) $content["error"][60] = "Error while creating image preview";
 144  
 145  }
 146  
 147  
 148  
 149  
 150  ?>


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