Hello,

on Sonntag, 30. September 2007, Rajko M. wrote:
> Seems not updated since some time.
> I see new users adding coordinates, but not appearing on the map.
> CBoltz?

Something[tm] broke it, but at least it wasn't my fault *g*

My coordinates.php file fetches 
http://en.opensuse.org/index.php?title=OpenSUSE_Community/Map/Coordinates&action=raw
Until now, it simply passed the content to the map script (and worked 
the last time I checked it), so the problem must be caused by a change 
on the coordinates page.

I have modified the code in coordinates.php [1]. This means:
- all lines before the <!--START--> comment will be ignored
- all remaining lines containing "{{map_user" will be read
- all other lines will be dropped

I have moved the entry
    <!-- In the middle of the sea?
    {{map_user|54:11:47|2:49:40|SuSe User UK|South Lakes Lancashire 
    Cumbria}}
    -->
to the top of the page, because the new PHP code does NOT ignore it - it 
simply drops the "<!--" and "-->" lines ;-)
If someone can fix this entry, just move it downwards again.

I have also done some minor bugfixing and enhancements:
- people who didn't enter an URL will no longer have their name linked 
  as <a href="">
- there's a "loading map data..." notice now until the data is loaded
- the name list below the map is now organized in columns instead of an 
  endless line and therefore easier to read


To make the story short: The map works again :-) and I'll run 
"mv $0 bed/ now.

Rajko, you might want to update the screenshot in the wiki - there are 
much more users in the map now ;-)


Regards and good night,

Christian Boltz

[1]
PHP code in coordinates.php:

<?php
header ("Content-Type: text/html; charset=utf-8");

ob_start();
readfile("http://en.opensuse.org/index.php?title=OpenSUSE_Community/Map/Coordinates&action=raw";);
$pagecontent = ob_get_contents();
ob_clean();

$lines = explode("\n", $pagecontent);
$started = 0;
foreach ($lines as $line) {
    if (preg_match("/<!--START-->/", $line)) $started = 1;
    if (preg_match("/{{map_user/", $line) && $started > 0) 
            print $line . "\n";
}
?>

-- 
[makeSUSEdvd] When it works, I will most likely hold a press conference
or something, so people will be informed by CNN. :-)
[houghi in opensuse]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to