[ Index ]

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

title

Body

[close]

/include/inc_lib/content/ -> cnt51.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 Map
  33  $content["map"] = array();
  34  $content["map"]["template"]    = clean_slweg($_POST["cmap_template"]);
  35  $content["map"]["text"]        = clean_slweg($_POST["cmap_text"]);
  36  $content["map"]['image']    = isset($_POST["cmap_image"]) ? clean_slweg($_POST["cmap_image"]) : '';
  37  
  38  
  39  if(isset($_POST['cmap_location_x']) && $content['id']) {
  40  //if(isset($_POST['cmap_location_x']) && isset($_POST['cmap_location_edited']) && intval($_POST['cmap_location_edited']) && $content['id']) {
  41      //if location should be updated or ceated
  42      // cmap_location_x, cmap_location_y, cmap_location_title, 
  43      // cmap_location_zip, cmap_location_city, cmap_location_entry
  44      $content["location"]            = array();
  45      $content["location"]['id']        = intval($_POST["cmap_location_id"]);
  46      $content["location"]['x']        = intval($_POST["cmap_location_x"]);
  47      $content["location"]['y']        = intval($_POST["cmap_location_y"]);
  48      $content["location"]['title']    = clean_slweg($_POST["cmap_location_title"]);
  49      $content["location"]['zip']        = clean_slweg($_POST["cmap_location_zip"]);
  50      $content["location"]['city']    = clean_slweg($_POST["cmap_location_city"]);
  51      $content["location"]['entry']    = slweg($_POST["cmap_location_entry"]);
  52      if(!$_SESSION["WYSIWYG_EDITOR"]) {
  53          $content["location"]['entry'] = nl2br($content["location"]['entry']);
  54      } else {
  55          $content["location"]['entry'] = str_replace("\r\n", '', $content["location"]['entry']);
  56          $content["location"]['entry'] = str_replace("\n", '', $content["location"]['entry']);
  57      }
  58      
  59      if(!$content["location"]['title']) {
  60          $content["error"][] = $BL['be_cmap_location_error_notitle'];
  61      } else {
  62      
  63          $content["location"]['sql']  = "map_cid='".$content['id']."', ";
  64          $content["location"]['sql'] .= "map_x='".$content["location"]['x']."', ";
  65          $content["location"]['sql'] .= "map_y='".$content["location"]['y']."', ";
  66          $content["location"]['sql'] .= "map_title='".aporeplace($content["location"]['title'])."', ";
  67          $content["location"]['sql'] .= "map_zip='".aporeplace($content["location"]['zip'])."', ";
  68          $content["location"]['sql'] .= "map_city='".aporeplace($content["location"]['city'])."', ";
  69          $content["location"]['sql'] .= "map_entry='".aporeplace($content["location"]['entry'])."'";
  70      
  71          // create UPDATE or INSERT query for location
  72          if(!$content["location"]['id']) {
  73              // INSERT
  74              $content["location"]['sql']  = "INSERT INTO ".DB_PREPEND."phpwcms_map SET ".$content["location"]['sql'];
  75          } else {
  76              // UPDATE
  77              $content["location"]['sql']  = "UPDATE ".DB_PREPEND."phpwcms_map SET ".$content["location"]['sql']." ";
  78              $content["location"]['sql'] .= "WHERE map_cid=".$content['id']." AND map_id=".$content["location"]['id']." LIMIT 1";
  79          }
  80          mysql_query($content["location"]['sql'], $db);
  81  
  82      }
  83  
  84  }
  85  
  86  ?>


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