
wrcovington at gmail
Dec 4, 2005, 7:12 PM
Post #2 of 3
(5677 views)
Permalink
|
This is awesome! Although, I'm having some trouble. I've done the change to LocalSettings.php, and added GoogleMaps.php to the extensions folder. However, when I add the changes to Skin.php, I get this error: Parse error: parse error, unexpected $ in /home/content/t/h/e/thesteeps/html/singletrackwiki/includes/Skin.php on line 1348 Here is what that section in Skin.php used to look like before my changes: function getHeadScripts() { global $wgStylePath, $wgUser, $wgContLang, $wgAllowUserJs, $wgJsMimeType; $r = "<script type=\"{$wgJsMimeType}\" src=\"{$wgStylePath}/common/wikibits.js\"></script>\n"; if( $wgAllowUserJs && $wgUser->isLoggedIn() ) { $userpage = $wgUser->getUserPage(); $userjs = htmlspecialchars( $this->makeUrl( $userpage->getPrefixedText().'/'.$this->getSkinName().'.js', 'action=raw&ctype='.$wgJsMimeType)); $r .= '<script type="'.$wgJsMimeType.'" src="'.$userjs."\"></script>\n"; } return $r; } and here is what it looks like after my changes: function getHeadScripts() { global $wgStylePath, $wgUser, $wgContLang, $wgAllowUserJs, $wgJsMimeType, $wgScriptPath, $wgRequest, $wgGoogleMapsKey; $r = "<script type=\"{$wgJsMimeType}\" src=\"{$wgStylePath}/common/wikibits.js\"></script>\n"; if( $wgAllowUserJs && $wgUser->isLoggedIn() ) { $userpage = $wgUser->getUserPage(); $userjs = htmlspecialchars( $this->makeUrl( $userpage->getPrefixedText().'/'.$this->getSkinName().'.js', 'action=raw&ctype='.$wgJsMimeType)); $r .= '<script type="'.$wgJsMimeType.'" src="'.$userjs."\"></script>\n"; if (preg_match("/index\.php\//", $wgRequest->getRequestURL())) { $r .= "<script src=\"http://maps.google.com/maps?file=api&v=1&key={$wgGoogleMapsKey}\" type=\"$wgJsMimeType\"></script>\n"; } return $r; } Am I doing something wrong? --Billy On 12/4/05, Evan Miller <Evan.M.Miller [at] williams> wrote: > Hello, > > Google offers an open API for displaying custom information on their > highly usable map application. This API seems suitable for wikis, > which is why there are already three MediaWiki extensions for Google > Maps. But these extensions seemed a bit too rigid for me, needing > database modifications and RSS feeds and the like just to display > markers. So I wrote a simple Google Maps extension: to create a map > with many labeled markers, you just describe one marker per line with > the format "latitude,longitude,label", and put all of these markers > inside of a <googlemap> tag. A neat feature is that the marker labels > will render wiki formatting. Because of its flexibility, I think this > extension will prove useful in a wide variety of projects; I > encourage you to try it out and send me feedback. > > http://meta.wikimedia.org/wiki/User:Emiller/GoogleMapsExtension > > Evan Miller > > > _______________________________________________ > MediaWiki-l mailing list > MediaWiki-l [at] Wikimedia > http://mail.wikipedia.org/mailman/listinfo/mediawiki-l > > > > _______________________________________________ MediaWiki-l mailing list MediaWiki-l [at] Wikimedia http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
|