Changeset 1229
- Timestamp:
- 09/19/10 19:45:42 (3 years ago)
- Location:
- g-map
- Files:
-
- 4 modified
-
files/lib/page/MapAjaxPage.class.php (modified) (3 diffs)
-
files/lib/system/event/listener/GMapUserPageListener.class.php (modified) (1 diff)
-
files/lib/system/event/listener/GMapUserProfileEditFormListener.class.php (modified) (1 diff)
-
optionals/de.gmap.wbb/files/lib/acp/action/UpdateMapAction.class.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
g-map/files/lib/page/MapAjaxPage.class.php
r1226 r1229 15 15 class MapAjaxPage extends AbstractPage { 16 16 protected $zoom = 0; 17 protected $distance = 10;17 protected $distance = 35; 18 18 protected $bounds= array(); 19 19 protected $initialized = false; … … 31 31 // ((50.08930948264218, 10.298652648925781), (50.14434619645057, 10.506362915039062)) 32 32 if(isset($_GET['bounds'])) { 33 if(preg_match('\((\d+\.?\d*), (\d+\.?\d*)\), \((\d+\.?\d*), (\d+\.?\d*)\)', $_GET['bounds'], $match)) { 34 $this->bounds = $match; 33 if(preg_match('/^\(\((-?\d+\.?\d*), (-?\d+\.?\d*)\), \((-?\d+\.?\d*), (-?\d+\.?\d*)\)\)$/', $_GET['bounds'], $match)) { 34 $this->bounds = array( 35 array( 36 'lat' => $match[1], 37 'lon' => $match[2] 38 ), 39 array( 40 'lat' => $match[3], 41 'lon' => $match[4] 42 ), 43 ); 44 45 // extra 30% 46 $this->bounds[0]['lat'] -= abs($this->bounds[0]['lat'] - $this->bounds[1]['lat']) * 0.3; 47 $this->bounds[1]['lat'] += abs($this->bounds[0]['lat'] - $this->bounds[1]['lat']) * 0.3; 48 $this->bounds[0]['lon'] -= abs($this->bounds[0]['lon'] - $this->bounds[1]['lon']) * 0.3; 49 $this->bounds[1]['lon'] += abs($this->bounds[0]['lon'] - $this->bounds[1]['lon']) * 0.3; 35 50 } 36 51 } … … 50 65 $sql = 'SELECT X(pt) AS lon, 51 66 Y(pt) AS lat 52 FROM wcf'.WCF_N.'_gmap_user'; 67 FROM wcf'.WCF_N.'_gmap_user 68 WHERE 1'; 69 70 if($this->bounds) { 71 $sql .= ' AND X(pt) BETWEEN '.floatval($this->bounds[0]['lon']).' AND '.floatval($this->bounds[1]['lon']).' '; 72 $sql .= ' AND Y(pt) BETWEEN '.floatval($this->bounds[0]['lat']).' AND '.floatval($this->bounds[1]['lat']).' '; 73 } 53 74 54 75 if(!$this->initialized) { -
g-map/files/lib/system/event/listener/GMapUserPageListener.class.php
r1226 r1229 54 54 )); 55 55 // if user position exists 56 WCF::getTPL()->append('additionalBoxes 2', WCF::getTPL()->fetch('userProfileMapSide'));56 WCF::getTPL()->append('additionalBoxes1', WCF::getTPL()->fetch('userProfileMapSide')); 57 57 } 58 58 59 59 // if user is owner or user has personal maps 60 if( WCF::getUser()->userID == $this->userID || $this->personal_maps) {60 if(false && WCF::getUser()->userID == $this->userID || $this->personal_maps) { 61 61 WCF::getTPL()->append('additionalContents3', WCF::getTPL()->fetch('userProfileMapCenter')); 62 62 } -
g-map/files/lib/system/event/listener/GMapUserProfileEditFormListener.class.php
r1223 r1229 20 20 $this->className = $className; 21 21 22 22 $this->$eventName(); 23 23 } 24 24 25 25 protected function saved() { 26 if($this->eventObj->activeCategory == 'profile' && $eventName == 'saved') {26 if($this->eventObj->activeCategory == 'profile') { 27 27 if(isset($this->eventObj->values['location']) && !empty($this->eventObj->values['location'])) { 28 28 29 29 // update user location 30 // MapDiscover::update(); 31 32 // show info message if no location was found 30 require_once(WCF_DIR.'lib/data/gmap/GmapApi.class.php'); 31 $api = new GmapApi(); 32 $point = $api->search($this->eventObj->values['location']); 33 34 if($point) { 35 $sql = "REPLACE INTO wcf".WCF_N."_gmap_user 36 (userID, pt) 37 VALUES (".$this->eventObj->user->userID.", PointFromText('POINT(".$point['lon']." ".$point['lat'].")'))"; 38 WCF::getDB()->sendQuery($sql); 39 } 33 40 } 34 41 } -
g-map/optionals/de.gmap.wbb/files/lib/acp/action/UpdateMapAction.class.php
r1225 r1229 42 42 ".$col." AS loc 43 43 FROM wcf".WCF_N."_user_option_value 44 ORDER BY userID"; 44 WHERE ".$col." != '' 45 ORDER BY userID ASC"; 45 46 $result = WCF::getDB()->sendQuery($sql, $this->limit, ($this->limit * $this->loop)); 46 47 while ($row = WCF::getDB()->fetchArray($result)) {
