[ Index ] |
PHP Cross Reference of phpwcms V1.4.3 _r380 (23.11.09) |
[Summary view] [Print] [Text view]
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 E-Card 34 $content['ecard']['images'] = array(); 35 $content["ecard"]["list"] = isset($_POST["cimage_list"]) ? $_POST["cimage_list"] : array(); 36 37 $content["ecard"]["width"] = (intval($_POST["cecard_width"])) ? intval($_POST["cecard_width"]) : ''; 38 $content["ecard"]["height"] = (intval($_POST["cecard_height"])) ? intval($_POST["cecard_height"]) : ''; 39 $temp_width = $content["ecard"]["width"]; 40 $temp_height = $content["ecard"]["height"]; 41 42 $content["ecard"]["space"] = intval($_POST["cecard_space"]); 43 $content["ecard"]["col"] = intval($_POST["cecard_col"]); 44 $content["ecard"]["pos"] = intval($_POST["cecard_pos"]); 45 $content["ecard"]["caption"] = clean_slweg($_POST["cecard_caption"]); 46 47 $content["ecard"]["subject"] = clean_slweg($_POST["cecard_subject"]); 48 $content["ecard"]["form"] = slweg($_POST["cecard_form"]); 49 $content["ecard"]["mail"] = slweg($_POST["cecard_mail"]); 50 $content["ecard"]["send"] = slweg($_POST["cecard_send"]); 51 $content["ecard"]["zoom"] = isset($_POST["cecard_zoom"]) ? 1 : 0; 52 $content["ecard"]["selector"] = isset($_POST["cecard_selector"]) ? intval($_POST["cecard_selector"]) : 0; 53 $content["ecard"]["onover"] = slweg($_POST["cecard_onover"]); 54 $content["ecard"]["onclick"] = slweg($_POST["cecard_onclick"]); 55 $content["ecard"]["onout"] = slweg($_POST["cecard_onout"]); 56 57 $imgx = 0; 58 59 $content["ecard"]["image_cctext"] = explode("\n", $content["ecard"]["caption"]); 60 61 // remove form tag from form template 62 $content["ecard"]["form"] = preg_replace("'<form[^>]*?>(.*?)</form>'si", '$1', $content["ecard"]["form"]); 63 64 if(is_array($content["ecard"]["list"]) && count($content["ecard"]["list"])) { 65 66 $img_sql = "SELECT * FROM ".DB_PREPEND."phpwcms_file WHERE ("; 67 $img_sort = array(); 68 69 foreach($content["ecard"]["list"] as $key => $value) { 70 if ($imgx) $img_sql .= " OR "; 71 $img_sql .= "f_id=" . intval($value); 72 $imgx++; 73 } 74 if(!$imgx) { 75 $img_sql .= "0"; 76 } 77 $img_sql .= ");"; 78 79 // check for image information and get alle infos from file 80 if ($img_result = mysql_query($img_sql, $db) or die("error while getting content image only info")) { 81 82 // Gegenrechnen von Breite zu Anzahl Spalten und Bildabstand 83 $temp_count_img = mysql_num_rows($img_result); 84 if($content["ecard"]["col"] > $temp_count_img) $content["ecard"]["col"] = $temp_count_img; 85 $temp_img_maxwidth = $phpwcms["content_width"] - (($content["ecard"]["col"] - 1) * $content["ecard"]["space"]); 86 $temp_img_maxwidth = intval($temp_img_maxwidth / $content["ecard"]["col"]); 87 88 if (($content["ecard"]["width"] > $temp_img_maxwidth) || ($content["ecard"]["width"] == "")) { 89 $content["ecard"]["width"] = $temp_img_maxwidth; 90 $temp_width = $content["ecard"]["width"]; 91 } 92 93 $imgx = 0; 94 $current_img_key = 0; 95 96 while ($img_row = mysql_fetch_assoc($img_result)) { 97 98 // set correct sorting 99 foreach($content["ecard"]["list"] as $key => $value) { 100 if($value == $img_row['f_id']) { 101 $current_img_key = $key; 102 unset($content["ecard"]["list"][$key]); 103 break; 104 } 105 } 106 $content['ecard']['images'][$current_img_key][0] = $img_row['f_id']; 107 $content['ecard']['images'][$current_img_key][1] = $img_row['f_name']; 108 $content['ecard']['images'][$current_img_key][2] = $img_row['f_hash']; 109 $content['ecard']['images'][$current_img_key][3] = $img_row['f_ext']; 110 $content['ecard']['images'][$current_img_key][4] = $temp_width; 111 $content['ecard']['images'][$current_img_key][5] = $temp_height; 112 $content['ecard']['images'][$current_img_key][6] = isset($content["ecard"]["image_cctext"][$current_img_key]) ? trim($content["ecard"]["image_cctext"][$current_img_key]) : ''; 113 114 $imgx++; 115 116 } 117 mysql_free_result($img_result); 118 ksort($content['ecard']['images']); 119 } 120 } 121 122 unset($content["ecard"]["list"]); 123 124 125 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Dec 30 05:55:15 2009 | Cross-referenced by PHPXref 0.7 |