[ Index ] |
PHP Cross Reference of phpwcms V1.5.0 _r431 (28.01.12) |
[Summary view] [Print] [Text view]
1 <?php 2 /************************************************************************************* 3 Copyright notice 4 5 (c) 2002-2012 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 // obligate check for phpwcms constants 25 if (!defined('PHPWCMS_ROOT')) { 26 die("You Cannot Access This Script Directly, Have a Nice Day."); 27 } 28 // ---------------------------------------------------------------- 29 30 31 //map 32 33 $CNT_TMP .= headline($crow["acontent_title"], $crow["acontent_subtitle"], $template_default["article"]); 34 $map = unserialize($crow["acontent_form"]); 35 36 $map['sql'] = "SELECT * FROM ".DB_PREPEND."phpwcms_map WHERE map_deleted=0 "; 37 $map['sql'] .= "AND map_cid=".intval($crow["acontent_id"])." ORDER BY map_zip ASC, map_city ASC"; 38 39 $map['map'] = ''; 40 $map['p'] = array(); 41 $map['show'] = (isset($_GET['loc'])) ? intval($_GET['loc']) : 0; 42 $map['loc'] = array(); 43 44 if($map['result'] = mysql_query($map['sql'], $db)) { 45 while($map['row'] = mysql_fetch_assoc($map['result'])) { 46 47 $map['map'] .= '<area shape="rect" coords="'.($map['row']['map_x']-4).','.($map['row']['map_y']-4); 48 $map['map'] .= ','.($map['row']['map_x']+4).','.($map['row']['map_y']+4).'" href="index.php?id='; 49 $map['map'] .= implode(',', $aktion).'&loc='.$map['row']['map_id'].'" title="'; 50 $map['map'] .= html_specialchars($map['row']['map_title']).'" alt="'; 51 $map['map'] .= html_specialchars($map['row']['map_title']).'" />'; 52 $map['p'][] = $map['row']['map_x'].'x'.$map['row']['map_y']; 53 54 if($map['show'] == $map['row']['map_id']) { 55 $map['loc'] = $map['row']; 56 } 57 58 } 59 mysql_free_result($map['result']); 60 } 61 62 $map['template'] = render_device( @file_get_contents(PHPWCMS_TEMPLATE.'inc_cntpart/map/'.$map['template']) ); 63 $map['tmpl_var'] = get_tmpl_section('VAR', $map['template']); 64 $map['tmpl_content'] = get_tmpl_section('CONTENT', $map['template']); 65 $map['tmpl_location'] = get_tmpl_section('LOCATION', $map['template']); 66 67 $map['map_img'] = ''; 68 if(file_exists(PHPWCMS_TEMPLATE.'inc_cntpart/map/map_img/'.$map['image'])) { 69 $map['map_img'] .= '<img src="img/mapimage.php?'; 70 $map['map_img'] .= 'i='.rawurlencode($map['image']).'&xy='.rawurlencode(implode(',', $map['p'])); 71 $map['map_img'] .= '&v='.rawurlencode(($map['tmpl_var']) ? $map['tmpl_var'] : '1,7,7,FFFFFF,FF4000'); 72 $map['map_img'] .= '" hspace="0" vspace="0" border="0" alt="" usemap="#locations" />'; 73 if($map['map']) $map['map_img'] .= '<map name="locations">'.$map['map'].'</map>'; 74 } 75 76 if(!$map['tmpl_content']) { 77 78 $CNT_TMP .= '<div style="float:right;">'.$map['map_img'].'</div>'; 79 80 if(!empty($map['text'])) $CNT_TMP .= nl2br(div_class($map['text'], $template_default["article"]["text_class"])); 81 if($map['loc']) { 82 $CNT_TMP .= '<h5>'.html_specialchars($map['loc']['map_title']).'</h5>'; 83 $map["location"] = ''; 84 $map['loc']['map_zip'] = trim($map['loc']['map_zip'].' '.$map['loc']['map_city']); 85 if($map['loc']['map_zip']) { 86 $map["location"] .= '<strong>'.html_specialchars($map['loc']['map_zip'])."</strong>\n"; 87 } 88 if($map['loc']['map_entry']) { 89 $map["location"] .= $map['loc']['map_entry']; //html_specialchars($map['loc']['map_entry']) 90 } 91 $map["location"] = trim($map["location"]); 92 if($map["location"]) { 93 $CNT_TMP .= nl2br(div_class($map["location"], $template_default["article"]["text_class"])); 94 } 95 } 96 97 } else { 98 99 if($map['loc']) { 100 // build location entry 101 $map['tmpl_location'] = render_cnt_template($map['tmpl_location'], 'TITLE', html_specialchars($map['loc']['map_title'])); 102 $map['tmpl_location'] = render_cnt_template($map['tmpl_location'], 'ZIP', html_specialchars($map['loc']['map_zip'])); 103 $map['tmpl_location'] = render_cnt_template($map['tmpl_location'], 'CITY', html_specialchars($map['loc']['map_city'])); 104 $map['tmpl_location'] = render_cnt_template($map['tmpl_location'], 'ENTRY', $map['loc']['map_entry']); 105 } else { 106 $map['tmpl_location'] = ''; 107 } 108 109 $map['tmpl_content'] = render_cnt_template($map['tmpl_content'], 'MAP', $map['map_img']); 110 $map['tmpl_content'] = render_cnt_template($map['tmpl_content'], 'TEXT', nl2br(html_specialchars($map['text']))); 111 $map['tmpl_content'] = render_cnt_template($map['tmpl_content'], 'LOCATION', $map['tmpl_location']); 112 113 $CNT_TMP .= $map['tmpl_content']; 114 115 } 116 117 // delete map array 118 unset($map); 119 120 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Jan 29 16:31:14 2012 | Cross-referenced by PHPXref 0.7.1 |