map.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. error_reporting(E_ALL^E_NOTICE);
  3. __FILE__ == '' && die('Fatal error code: 0');
  4. @header("Content-Type: text/html; charset=gbk");
  5. @set_magic_quotes_runtime(0);
  6. if (defined('DEBUG_MODE') == false) define('DEBUG_MODE', 0);
  7. if(PHP_VERSION < '4.1.0') {
  8. $_GET = &$HTTP_GET_VARS;
  9. $_SERVER = &$HTTP_SERVER_VARS;
  10. unset($HTTP_GET_VARS,$HTTP_SERVER_VARS);
  11. }
  12. if (isset($_REQUEST['GLOBALS']) OR isset($_FILES['GLOBALS'])) {
  13. exit('Request tainting attempted.');
  14. }
  15. if(function_exists('date_default_timezone_set')) date_default_timezone_set('Hongkong');
  16. define('CURSCRIPT', 'map');
  17. define('IN_MYMPS',true);
  18. define('CURRENTDIR',dirname(__FILE__));
  19. require_once CURRENTDIR.'/data/config.php';
  20. require_once CURRENTDIR.'/include/common.fun.php';
  21. $p = mhtmlspecialchars($_GET['p']);
  22. if(isset($p) && preg_match("/^[a-z0-9\-\.]+[,][a-z0-9\-\.]+$/", $p)) {
  23. list($p1, $p2) = explode(',', $p);
  24. }
  25. $areacode = isset($_GET['areacode']) ? intval($_GET['areacode']) : '';
  26. $action = isset($_GET['action']) ? trim(mhtmlspecialchars($_GET['action'])) : '';
  27. if(!in_array($action,array('show','markpoint'))) $action = 'show';
  28. $cityname = isset($_GET['cityname']) ? trim(mhtmlspecialchars($_GET['cityname'])) : 'beijing';
  29. $documentdomain = isset($_GET['documentdomain']) ? trim(mhtmlspecialchars($_GET['documentdomain'])) : 0;
  30. $title = isset($_GET['title']) ? checkhtml($_GET['title']) : 'Äú±ê×¢µÄλÖÃ';
  31. $level = is_numeric($_GET['level']) ? intval($_GET['level']) : (is_numeric($mymps_global['mapview_level']) ? $mymps_global['mapview_level'] : 10);
  32. $width = isset($_GET['width']) ? intval($_GET['width']) : 500;
  33. $height = isset($_GET['height']) ? intval($_GET['height']) : 500;
  34. $markpoint = isset($_GET['markpoint']) ? intval($_GET['markpoint']) : 0;
  35. if((!$p1 || !$p2) && !empty($mymps_global['cfg_mappoint'])) {
  36. $key = 1;
  37. list($p1,$p2) = explode(',',$mymps_global['cfg_mappoint']);
  38. }
  39. $mapflag = $mymps_global['mapflag'] ? $mymps_global['mapflag'] : 'baidu';
  40. $version = 1.1;
  41. include CURRENTDIR.'/template/box/map.html';
  42. $mymps_global = $mapflag = $width = $height = $title = $level = $action = $p1 = $areacode = $p2 = NULL;
  43. ?>