Author: cfinck
Date: Mon Feb 11 21:43:40 2008
New Revision: 32303
URL:
http://svn.reactos.org/svn/reactos?rev=32303&view=rev
Log:
New ReactOS People Map based on Google Maps API (not yet on the Web server)
The map integrates into the existing website and is linked with the RosCMS accounts.
You can add a group of users (like Translators, Developers, Administrators, etc.) to the
map or search for people and add them individually. I made tests with 500 random users on
one map and it was still usable :-)
Also there are easy features for setting your own position.
I successfully tested the People Map with Firefox 2.0, Opera 9.21, Safari 3 Beta,
Konqueror 3.5.6 and IE6/7.
The marker graphics were done myself with Inkscape and the other graphics were composed
out of icons from the Tango Icon Project or taken from other ReactOS web apps.
The PNGs with alpha transparency are also shown correctly under IE6 using a trick in
"ie6-fixes.css".
Added:
trunk/web/reactos.org/htdocs/peoplemap/
trunk/web/reactos.org/htdocs/peoplemap/ajax-deletelocation.php (with props)
trunk/web/reactos.org/htdocs/peoplemap/ajax-getuser.php (with props)
trunk/web/reactos.org/htdocs/peoplemap/ajax-setlocation.php (with props)
trunk/web/reactos.org/htdocs/peoplemap/config.inc.php (with props)
trunk/web/reactos.org/htdocs/peoplemap/ie6-fixes.css (with props)
trunk/web/reactos.org/htdocs/peoplemap/images/
trunk/web/reactos.org/htdocs/peoplemap/images/add-user.png (with props)
trunk/web/reactos.org/htdocs/peoplemap/images/ajax_loading.gif (with props)
trunk/web/reactos.org/htdocs/peoplemap/images/filter.png (with props)
trunk/web/reactos.org/htdocs/peoplemap/images/ll.gif (with props)
trunk/web/reactos.org/htdocs/peoplemap/images/lr.gif (with props)
trunk/web/reactos.org/htdocs/peoplemap/images/marker_blue.png (with props)
trunk/web/reactos.org/htdocs/peoplemap/images/marker_cyan.png (with props)
trunk/web/reactos.org/htdocs/peoplemap/images/marker_green.png (with props)
trunk/web/reactos.org/htdocs/peoplemap/images/marker_lightgrey.png (with props)
trunk/web/reactos.org/htdocs/peoplemap/images/marker_red.png (with props)
trunk/web/reactos.org/htdocs/peoplemap/images/marker_violet.png (with props)
trunk/web/reactos.org/htdocs/peoplemap/images/marker_white.png (with props)
trunk/web/reactos.org/htdocs/peoplemap/images/marker_yellow.png (with props)
trunk/web/reactos.org/htdocs/peoplemap/images/set-location.png (with props)
trunk/web/reactos.org/htdocs/peoplemap/images/ul.gif (with props)
trunk/web/reactos.org/htdocs/peoplemap/images/ur.gif (with props)
trunk/web/reactos.org/htdocs/peoplemap/index.php (with props)
trunk/web/reactos.org/htdocs/peoplemap/lang/
trunk/web/reactos.org/htdocs/peoplemap/lang/de.inc.php (with props)
trunk/web/reactos.org/htdocs/peoplemap/lang/en.inc.php (with props)
trunk/web/reactos.org/htdocs/peoplemap/languages.inc.php (with props)
trunk/web/reactos.org/htdocs/peoplemap/peoplemap.css (with props)
trunk/web/reactos.org/htdocs/peoplemap/peoplemap.js.php (with props)
trunk/web/reactos.org/htdocs/peoplemap/peoplemap.sql (with props)
Added:
trunk/web/reactos.org/htdocs/peoplemap/ajax-deletelocation.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/a…
==============================================================================
---
trunk/web/reactos.org/htdocs/peoplemap/ajax-deletelocation.php (added)
+++
trunk/web/reactos.org/htdocs/peoplemap/ajax-deletelocation.php Mon Feb 11 21:43:40
2008
@@ -1,0 +1,36 @@
+<?php
+/*
+ PROJECT: People Map of the ReactOS Website
+ LICENSE: GPL v2 or any later version
+ FILE:
web/reactos.org/htdocs/peoplemap/ajax-deletelocation.php
+ PURPOSE: AJAX backend for the People Map for deleting user locations
+ COPYRIGHT: Copyright 2008 Colin Finck <mail(a)colinfinck.de>
+*/
+
+ header("Content-type: text/xml");
+
+ if(!$_COOKIE["roscmsusrkey"] || !isset($_GET["delete"]))
+ die("<error>Necessary information not specified!</error>");
+
+
+ require_once("config.inc.php");
+
+ $db = mysql_connect($DB_HOST, $DB_USER, $DB_PASS);
+
+ // Get the user ID from the session key
+ $query = "SELECT usersession_user_id FROM $DB_ROSCMS.user_sessions WHERE
usersession_id = '" .
mysql_real_escape_string($_COOKIE["roscmsusrkey"]) . "' LIMIT
1;";
+ $result = mysql_query($query, $db) or die("<error>Query failed
#1!</error>");
+
+ if(mysql_num_rows($result) > 0)
+ $userid = mysql_result($result, 0);
+
+ if(!$userid)
+ die("<error>No user ID!</error>");
+
+ // Delete the location entry
+ $query = "DELETE FROM $DB_PEOPLEMAP.user_locations WHERE roscms_user_id =
$userid;";
+ mysql_query($query, $db) or die("<error>Query failed
#2!</error>");
+
+ // Just return a success state
+ echo "<deleted />";
+?>
Propchange:
trunk/web/reactos.org/htdocs/peoplemap/ajax-deletelocation.php
------------------------------------------------------------------------------
svn:eol-style = native
Added:
trunk/web/reactos.org/htdocs/peoplemap/ajax-getuser.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/a…
==============================================================================
---
trunk/web/reactos.org/htdocs/peoplemap/ajax-getuser.php (added)
+++
trunk/web/reactos.org/htdocs/peoplemap/ajax-getuser.php Mon Feb 11 21:43:40 2008
@@ -1,0 +1,85 @@
+<?php
+/*
+ PROJECT: People Map of the ReactOS Website
+ LICENSE: GPL v2 or any later version
+ FILE:
web/reactos.org/htdocs/peoplemap/ajax-getuser.php
+ PURPOSE: AJAX backend for the People Map for getting user information
+ COPYRIGHT: Copyright 2007-2008 Colin Finck <mail(a)colinfinck.de>
+*/
+
+ header("Content-type: text/xml");
+
+ if( !isset($_GET["query"]) || !isset($_GET["subject"]) )
+ die("<error>Necessary information not specified!</error>");
+
+ if( !$_GET["subject"] == "userid" &&
strlen($_GET["query"]) < 3 )
+ die("<error>Minimum query length is 3 characters!</error>");
+
+
+ require_once("config.inc.php");
+
+ $db = mysql_connect($DB_HOST, $DB_USER, $DB_PASS);
+ $query = "SELECT u.user_id, u.user_name, u.user_fullname, l.latitude, l.longitude
" .
+ "FROM $DB_ROSCMS.users u " .
+ "JOIN $DB_PEOPLEMAP.user_locations l ON u.user_id = l.roscms_user_id
";
+
+ switch($_GET["subject"])
+ {
+ case "username":
+ $query .= "WHERE u.user_name LIKE '" .
mysql_real_escape_string($_GET["query"], $db) . "%'";
+ break;
+
+ case "fullname":
+ $query .= "WHERE u.user_fullname LIKE '" .
mysql_real_escape_string($_GET["query"], $db) . "%'";
+ break;
+
+ case "group":
+ $query .= "JOIN $DB_ROSCMS.usergroup_members g ON u.user_id =
g.usergroupmember_userid " .
+ "WHERE g.usergroupmember_usergroupid = '" .
mysql_real_escape_string($_GET["query"], $db) . "'";
+ break;
+
+ case "userid":
+ $query .= "WHERE u.user_id = " . (int)$_GET["query"];
+ break;
+
+ default:
+ die("<error>Invalid subject!</error>");
+ }
+
+ $query .= " ORDER BY u.user_name ASC";
+
+ switch($_GET["subject"])
+ {
+ case "username":
+ case "fullname":
+ $query .= " LIMIT 25";
+ break;
+
+ case "group":
+ $query .= " LIMIT 500";
+ break;
+
+ case "userid":
+ $query .= " LIMIT 1";
+ break;
+ }
+
+ $query .= ";";
+
+ $result = mysql_query($query, $db) or die("<error><message>Query
failed!</message></error>");
+
+ echo "<userinformation>";
+
+ while( $row = mysql_fetch_row($result) )
+ {
+ echo "<user>";
+ printf("<id>%u</id>", $row[0]);
+ printf("<username>%s</username>", $row[1]);
+ printf("<fullname>%s</fullname>", $row[2]);
+ printf("<latitude>%s</latitude>", $row[3]);
+ printf("<longitude>%s</longitude>", $row[4]);
+ echo "</user>";
+ }
+
+ echo "</userinformation>";
+?>
Propchange:
trunk/web/reactos.org/htdocs/peoplemap/ajax-getuser.php
------------------------------------------------------------------------------
svn:eol-style = native
Added:
trunk/web/reactos.org/htdocs/peoplemap/ajax-setlocation.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/a…
==============================================================================
---
trunk/web/reactos.org/htdocs/peoplemap/ajax-setlocation.php (added)
+++
trunk/web/reactos.org/htdocs/peoplemap/ajax-setlocation.php Mon Feb 11 21:43:40 2008
@@ -1,0 +1,56 @@
+<?php
+/*
+ PROJECT: People Map of the ReactOS Website
+ LICENSE: GPL v2 or any later version
+ FILE:
web/reactos.org/htdocs/peoplemap/ajax-setlocation.php
+ PURPOSE: AJAX backend for the People Map for saving user locations
+ COPYRIGHT: Copyright 2008 Colin Finck <mail(a)colinfinck.de>
+*/
+
+ header("Content-type: text/xml");
+
+ if(!$_COOKIE["roscmsusrkey"] || !isset($_GET["latitude"]) ||
!isset($_GET["longitude"]))
+ die("<error>Necessary information not specified!</error>");
+
+
+ require_once("config.inc.php");
+
+ $db = mysql_connect($DB_HOST, $DB_USER, $DB_PASS);
+
+ // Get the user ID from the session key
+ $query = "SELECT usersession_user_id FROM $DB_ROSCMS.user_sessions WHERE
usersession_id = '" .
mysql_real_escape_string($_COOKIE["roscmsusrkey"]) . "' LIMIT
1;";
+ $result = mysql_query($query, $db) or die("<error>Query failed
#1!</error>");
+
+ if(mysql_num_rows($result) > 0)
+ $userid = mysql_result($result, 0);
+
+ if(!$userid)
+ die("<error>No user ID!</error>");
+
+ $latitude = (float)$_GET["latitude"];
+ $longitude = (float)$_GET["longitude"];
+
+ // Set latitude and longitude
+ $query = "INSERT INTO $DB_PEOPLEMAP.user_locations " .
+ "(roscms_user_id, latitude, longitude) " .
+ "VALUES ($userid, $latitude, $longitude) " .
+ "ON DUPLICATE KEY UPDATE " .
+ "latitude=$latitude, longitude=$longitude;";
+
+ mysql_query($query, $db) or die("<error>Query failed
#2!</error>");
+
+ // We succeeded, return all information about our account
+ $query = "SELECT user_name, user_fullname FROM $DB_ROSCMS.users WHERE user_id =
$userid LIMIT 1;";
+ $result = mysql_query($query, $db) or die("<error>Query failed
#3!</error>");
+ $row = mysql_fetch_row($result);
+
+ echo "<userinformation>";
+ echo "<user>";
+ printf("<id>%u</id>", $userid);
+ printf("<username>%s</username>", $row[0]);
+ printf("<fullname>%s</fullname>", $row[1]);
+ printf("<latitude>%s</latitude>", $latitude);
+ printf("<longitude>%s</longitude>", $longitude);
+ echo "</user>";
+ echo "</userinformation>";
+?>
Propchange:
trunk/web/reactos.org/htdocs/peoplemap/ajax-setlocation.php
------------------------------------------------------------------------------
svn:eol-style = native
Added:
trunk/web/reactos.org/htdocs/peoplemap/config.inc.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/c…
==============================================================================
---
trunk/web/reactos.org/htdocs/peoplemap/config.inc.php (added)
+++
trunk/web/reactos.org/htdocs/peoplemap/config.inc.php Mon Feb 11 21:43:40 2008
@@ -1,0 +1,25 @@
+<?php
+/*
+ PROJECT: People Map of the ReactOS Website
+ LICENSE: GPL v2 or any later version
+ FILE:
web/reactos.org/htdocs/peoplemap/config.inc.php
+ PURPOSE: Configuration settings
+ COPYRIGHT: Copyright 2007-2008 Colin Finck <mail(a)colinfinck.de>
+*/
+
+ // DB Settings
+ // The user entered here must have:
+ // * SELECT, INSERT, UPDATE and DELETE privileges to $DB_PEOPLEMAP
+ // * SELECT privileges to $DB_ROSCMS
+ $DB_HOST = "localhost";
+ $DB_USER = "root";
+ $DB_PASS = "";
+ $DB_PEOPLEMAP = "peoplemap";
+ $DB_ROSCMS = "roscms";
+
+ // Google Maps Settings
+ $GOOGLE_MAPS_KEY = "";
+
+ // Image Settings
+ $MARKERS = array("red", "blue", "green",
"violet", "yellow", "cyan", "lightgrey");
+?>
Propchange:
trunk/web/reactos.org/htdocs/peoplemap/config.inc.php
------------------------------------------------------------------------------
svn:eol-style = native
Added:
trunk/web/reactos.org/htdocs/peoplemap/ie6-fixes.css
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/i…
==============================================================================
---
trunk/web/reactos.org/htdocs/peoplemap/ie6-fixes.css (added)
+++
trunk/web/reactos.org/htdocs/peoplemap/ie6-fixes.css Mon Feb 11 21:43:40 2008
@@ -1,0 +1,29 @@
+/*
+ PROJECT: People Map of the ReactOS Website
+ LICENSE: GPL v2 or any later version
+ FILE:
web/reactos.org/htdocs/peoplemap/ie6-fixes.css
+ PURPOSE: This file contains fixes for Internet Explorer 6.0
+ COPYRIGHT: Copyright 2007-2008 Colin Finck <mail(a)colinfinck.de>
+*/
+
+/* IE6 doesn't add the size of the edges to the box height. So we have to add this
space by enhancing the "padding-bottom" value */
+.bubble_bg, .selectable_bubble_bg, .hovered_bubble_bg {
+ padding-bottom: 4px;
+}
+
+/* Show PNG's with alpha transparency through the AlphaImageLoader filter */
+#toolbox0_image, #toolbox1_image, #toolbox2_image {
+ background: none;
+}
+
+#toolbox0_image {
+ filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="images/filter.png");
+}
+
+#toolbox1_image {
+ filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="images/add-user.png");
+}
+
+#toolbox2_image {
+ filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="images/set-location.png");
+}
Propchange:
trunk/web/reactos.org/htdocs/peoplemap/ie6-fixes.css
------------------------------------------------------------------------------
svn:eol-style = native
Added:
trunk/web/reactos.org/htdocs/peoplemap/images/add-user.png
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/i…
==============================================================================
Binary file - no diff available.
Propchange:
trunk/web/reactos.org/htdocs/peoplemap/images/add-user.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
trunk/web/reactos.org/htdocs/peoplemap/images/ajax_loading.gif
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/i…
==============================================================================
Binary file - no diff available.
Propchange:
trunk/web/reactos.org/htdocs/peoplemap/images/ajax_loading.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
trunk/web/reactos.org/htdocs/peoplemap/images/filter.png
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/i…
==============================================================================
Binary file - no diff available.
Propchange:
trunk/web/reactos.org/htdocs/peoplemap/images/filter.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
trunk/web/reactos.org/htdocs/peoplemap/images/ll.gif
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/i…
==============================================================================
Binary file - no diff available.
Propchange:
trunk/web/reactos.org/htdocs/peoplemap/images/ll.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
trunk/web/reactos.org/htdocs/peoplemap/images/lr.gif
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/i…
==============================================================================
Binary file - no diff available.
Propchange:
trunk/web/reactos.org/htdocs/peoplemap/images/lr.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
trunk/web/reactos.org/htdocs/peoplemap/images/marker_blue.png
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/i…
==============================================================================
Binary file - no diff available.
Propchange:
trunk/web/reactos.org/htdocs/peoplemap/images/marker_blue.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
trunk/web/reactos.org/htdocs/peoplemap/images/marker_cyan.png
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/i…
==============================================================================
Binary file - no diff available.
Propchange:
trunk/web/reactos.org/htdocs/peoplemap/images/marker_cyan.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
trunk/web/reactos.org/htdocs/peoplemap/images/marker_green.png
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/i…
==============================================================================
Binary file - no diff available.
Propchange:
trunk/web/reactos.org/htdocs/peoplemap/images/marker_green.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
trunk/web/reactos.org/htdocs/peoplemap/images/marker_lightgrey.png
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/i…
==============================================================================
Binary file - no diff available.
Propchange:
trunk/web/reactos.org/htdocs/peoplemap/images/marker_lightgrey.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
trunk/web/reactos.org/htdocs/peoplemap/images/marker_red.png
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/i…
==============================================================================
Binary file - no diff available.
Propchange:
trunk/web/reactos.org/htdocs/peoplemap/images/marker_red.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
trunk/web/reactos.org/htdocs/peoplemap/images/marker_violet.png
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/i…
==============================================================================
Binary file - no diff available.
Propchange:
trunk/web/reactos.org/htdocs/peoplemap/images/marker_violet.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
trunk/web/reactos.org/htdocs/peoplemap/images/marker_white.png
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/i…
==============================================================================
Binary file - no diff available.
Propchange:
trunk/web/reactos.org/htdocs/peoplemap/images/marker_white.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
trunk/web/reactos.org/htdocs/peoplemap/images/marker_yellow.png
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/i…
==============================================================================
Binary file - no diff available.
Propchange:
trunk/web/reactos.org/htdocs/peoplemap/images/marker_yellow.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
trunk/web/reactos.org/htdocs/peoplemap/images/set-location.png
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/i…
==============================================================================
Binary file - no diff available.
Propchange:
trunk/web/reactos.org/htdocs/peoplemap/images/set-location.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
trunk/web/reactos.org/htdocs/peoplemap/images/ul.gif
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/i…
==============================================================================
Binary file - no diff available.
Propchange:
trunk/web/reactos.org/htdocs/peoplemap/images/ul.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
trunk/web/reactos.org/htdocs/peoplemap/images/ur.gif
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/i…
==============================================================================
Binary file - no diff available.
Propchange:
trunk/web/reactos.org/htdocs/peoplemap/images/ur.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added:
trunk/web/reactos.org/htdocs/peoplemap/index.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/i…
==============================================================================
---
trunk/web/reactos.org/htdocs/peoplemap/index.php (added)
+++
trunk/web/reactos.org/htdocs/peoplemap/index.php Mon Feb 11 21:43:40 2008
@@ -1,0 +1,296 @@
+<?php
+/*
+ PROJECT: People Map of the ReactOS Website
+ LICENSE: GPL v2 or any later version
+ FILE:
web/reactos.org/htdocs/peoplemap/index.php
+ PURPOSE: Main web page
+ COPYRIGHT: Copyright 2007-2008 Colin Finck <mail(a)colinfinck.de>
+*/
+
+ require_once("config.inc.php");
+ require_once("languages.inc.php");
+
+ // Get the domain for the cookie (with a leading dot if possible). Borrowed from
"utils.php" of RosCMS.
+ function cookie_domain()
+ {
+ if( isset($_SERVER['SERVER_NAME']) )
+ {
+ if( preg_match('/(\.[^.]+\.[^.]+$)/', $_SERVER['SERVER_NAME'],
$matches) )
+ return $matches[1];
+ else
+ return "";
+ }
+ else
+ return "";
+ }
+
+ // Get the language and include it
+ if( isset($_GET["lang"]) )
+ $lang = $_GET["lang"];
+ else if( isset($_COOKIE["roscms_usrset_lang"]) )
+ $lang = $_COOKIE["roscms_usrset_lang"];
+
+ // Check if the language is valid
+ $lang_valid = false;
+
+ foreach( $peoplemap_languages as $lang_key => $lang_name )
+ {
+ if( $lang == $lang_key )
+ {
+ $lang_valid = true;
+ break;
+ }
+ }
+
+ if( !$lang_valid )
+ $lang = "en";
+
+ setcookie( "roscms_usrset_lang", $lang, time() + 5 * 30 * 24 * 3600,
"/", cookie_domain() );
+ require_once("lang/$lang.inc.php");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html;
charset=utf-8">
+ <title><?php echo $peoplemap_langres["title"]; ?></title>
+ <link rel="stylesheet" type="text/css"
href="peoplemap.css">
+ <!--[if IE 6]><link rel="stylesheet" type="text/css"
href="ie6-fixes.css"><![endif]-->
+ <script type="text/javascript"
src="http://maps.google.com/maps?file=api&v=2&key=<… echo
$GOOGLE_MAPS_KEY; ?>"></script>
+ <script type="text/javascript">
+ <?php require_once("peoplemap.js.php"); ?>
+ </script>
+</head>
+<body onload="Load()" onunload="Unload()">
+
+<?php
+
readfile("http://www.reactos.org/$lang/subsys_extern_menu_top.html&quo…tml");
+
readfile("http://www.reactos.org/$lang/subsys_extern_menu_left.html&qu…tml");
+?>
+
+<div class="navTitle"><?php echo
$peoplemap_langres["language"]; ?></div>
+ <ol>
+ <li style="text-align: center;">
+ <select size="1" onchange="window.location.href = '<?php echo
"http://" . $_SERVER["SERVER_NAME"] . $_SERVER["PHP_SELF"];
?>?lang=' + this.options[this.selectedIndex].value;">
+ <?php
+ foreach($peoplemap_languages as $lang_key => $lang_name)
+ printf('<option value="%s"%s>%s</option>', $lang_key,
($lang_key == $lang ? ' selected' : ''), $lang_name);
+ ?>
+ </select>
+ </li>
+ </ol>
+</td>
+<td id="content">
+
+<h1><?php echo $peoplemap_langres["header"]; ?></h1>
+<h2><?php echo $peoplemap_langres["title"]; ?></h2>
+
+<p><?php echo $peoplemap_langres["intro"]; ?></p>
+
+<table width="100%" cellspacing="0" cellpadding="0">
+ <tr>
+ <td>
+ <div class="bubble_bg">
+ <div class="rounded_ll">
+ <div class="rounded_lr">
+ <div class="rounded_ul">
+ <div class="rounded_ur">
+
+ <div class="bubble">
+ <div id="map">
+ <!-- The map will be here -->
+
+ <noscript><strong><?php echo
$peoplemap_langres["activatejs"]; ?></strong></noscript>
+ </div>
+ </div>
+
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </td>
+ <td id="toolbox_td">
+ <div class="bubble_bg" id="toolbox0_bubble">
+ <div class="rounded_ll">
+ <div class="rounded_lr">
+ <div class="rounded_ul">
+ <div class="rounded_ur">
+
+ <div class="bubble">
+ <table id="toolbox0_head" onclick="ToggleToolbox(0);">
+ <tr>
+ <td id="toolbox0_image"></td>
+ <td class="toolbox_head"><strong><?php echo
$peoplemap_langres["filter"]; ?></strong></td>
+ </tr>
+ </table>
+
+ <div id="toolbox0_controls">
+ <?php
+ echo $peoplemap_langres["filter_intro"] .
"<br><br>";
+
+ // We need a DB connection for getting the user groups and checking if the user is
logged in
+ $db = mysql_connect($DB_HOST, $DB_USER, $DB_PASS) or die("Could not connect
to the database!");
+ $query = "SELECT usrgroup_name_id, usrgroup_name FROM
$DB_ROSCMS.usergroups";
+ $result = mysql_query($query, $db) or die("Query failed #1!");
+
+ echo "<table>";
+
+ $iconcode = '<script type="text/javascript">';
+ $iconcode .= 'IconTable = new Object();';
+
+ while($row = mysql_fetch_row($result))
+ {
+ echo "<tr>";
+ echo "<td><input type=\"checkbox\"
onclick=\"ToggleUserGroup(this, '" . $row[0] .
"');\"></td>";
+ echo "<td><div class=\"colorbox\"
style=\"background: " . current($MARKERS) .
"\"></div></td>";
+ echo "<td>" . $row[1] . "</td>";
+ echo "<td><img id=\"ajaxloading_" . $row[0] .
"\" style=\"visibility: hidden;\"
src=\"images/ajax_loading.gif\" alt=\"\"></td>";
+ echo "</tr>";
+
+ $iconcode .= "IconTable['" . $row[0] . "'] = '" .
current($MARKERS) . "';";
+
+ next($MARKERS);
+ }
+
+ echo "</table>";
+
+ $iconcode .= '</script>';
+ echo $iconcode;
+ ?>
+ </div>
+ </div>
+
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="selectable_bubble_bg" id="toolbox1_bubble"
onmouseover="BubbleHover(this, true);" onmouseout="BubbleHover(this,
false);">
+ <div class="rounded_ll">
+ <div class="rounded_lr">
+ <div class="rounded_ul">
+ <div class="rounded_ur">
+
+ <div class="bubble">
+ <table id="toolbox1_head" onclick="ToggleToolbox(1);">
+ <tr>
+ <td id="toolbox1_image"><td>
+ <td class="toolbox_head"><strong><?php echo
$peoplemap_langres["add"]; ?></strong></td>
+ </tr>
+ </table>
+
+ <div id="toolbox1_controls">
+ <p>
+ <select id="add_subject" size="1">
+ <option><?php echo $peoplemap_langres["add_username"];
?></option>
+ <option><?php echo $peoplemap_langres["add_fullname"];
?></option>
+ </select>:
+
+ <input type="text" id="add_query" size="16"
onkeyup="GetUser()">
+ <img id="ajaxloading_add" style="visibility: hidden;"
src="images/ajax_loading.gif" alt="">
+ </p>
+
+ <div id="add_user_result">
+ <!-- The result of the user name search will be here -->
+ </div>
+ </div>
+ </div>
+
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="selectable_bubble_bg" id="toolbox2_bubble"
onmouseover="BubbleHover(this, true);" onmouseout="BubbleHover(this,
false);">
+ <div class="rounded_ll">
+ <div class="rounded_lr">
+ <div class="rounded_ul">
+ <div class="rounded_ur">
+
+ <div class="bubble">
+ <table id="toolbox2_head" onclick="ToggleToolbox(2);">
+ <tr>
+ <td id="toolbox2_image"><td>
+ <td class="toolbox_head"><strong><?php echo
$peoplemap_langres["mylocation"]; ?></strong></td>
+ </tr>
+ </table>
+
+ <div id="toolbox2_controls">
+ <?php
+ $logintext = $peoplemap_langres["mylocation_login"];
+ $logintext .= "<br><br>";
+ $logintext .= "<div style=\"text-align: center;\">";
+ $logintext .= "<a href=\"/roscms/?page=login&target=" .
urlencode($_SERVER["PHP_SELF"]) . "\">" .
$peoplemap_langres["mylocation_login_page"] . "</a>";
+ $logintext .= "<script type=\"text/javascript\">MyUserId =
-1;</script>";
+ $logintext .= "</div>";
+
+ if($_COOKIE["roscmsusrkey"])
+ {
+ $query = "SELECT usersession_user_id FROM $DB_ROSCMS.user_sessions WHERE
usersession_id = '" .
mysql_real_escape_string($_COOKIE["roscmsusrkey"]) . "' LIMIT
1;";
+ $result = mysql_query($query, $db) or die("Query failed #2!");
+
+ if(mysql_num_rows($result) > 0)
+ $userid = mysql_result($result, 0);
+
+ mysql_close($db);
+
+ if($userid)
+ {
+ echo $peoplemap_langres["mylocation_intro"];
+
+ echo "<ul>";
+
+ echo "<li>";
+ echo $peoplemap_langres["mylocation_marker_intro"] .
"<br>";
+ echo "<input type=\"button\"
onclick=\"SetLocationMarker();\" value=\"" .
$peoplemap_langres["mylocation_marker_button"] . "\">";
+ echo "<br><br>";
+ echo "</li>";
+
+ echo "<li>";
+ echo $peoplemap_langres["mylocation_coordinates_intro"] .
"<br>";
+ echo "<table>";
+ echo "<tr><td>" . $peoplemap_langres["latitude"]
. ":</td><td><input type=\"text\"
id=\"mylocation_latitude\" size=\"10\"
onkeyup=\"CheckCoordinate(this);\">°</td></tr>";
+ echo "<tr><td>" .
$peoplemap_langres["longitude"] . ":</td><td><input
type=\"text\" id=\"mylocation_longitude\" size=\"10\"
onkeyup=\"CheckCoordinate(this);\">°</td></tr>";
+ echo "</table>";
+ echo "<input type=\"button\"
onclick=\"SetLocationCoordinates();\" value=\"" .
$peoplemap_langres["mylocation_coordinates_button"] . "\"> ";
+ echo "<img id=\"ajaxloading_setlocation_coordinates\"
style=\"visibility: hidden;\" src=\"images/ajax_loading.gif\"
alt=\"\">";
+ echo "<br><br>";
+ echo "</li>";
+
+ echo "<li>";
+ echo $peoplemap_langres["mylocation_delete_intro"] .
"<br>";
+ echo "<input type=\"button\"
onclick=\"DeleteMyLocation();\" value=\"" .
$peoplemap_langres["mylocation_delete_button"] . "\">";
+ echo "</li>";
+
+ echo "</ul>";
+
+ echo "<script type=\"text/javascript\">";
+ echo "MyUserId = $userid;";
+ echo "</script>";
+ }
+ else
+ echo $logintext;
+ }
+ else
+ echo $logintext;
+ ?>
+ </div>
+ </div>
+
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </td>
+ </tr>
+</table>
+
+</td>
+</tr>
+</table>
+
+</body>
+</html>
Propchange:
trunk/web/reactos.org/htdocs/peoplemap/index.php
------------------------------------------------------------------------------
svn:eol-style = native
Added:
trunk/web/reactos.org/htdocs/peoplemap/lang/de.inc.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/l…
==============================================================================
---
trunk/web/reactos.org/htdocs/peoplemap/lang/de.inc.php (added)
+++
trunk/web/reactos.org/htdocs/peoplemap/lang/de.inc.php Mon Feb 11 21:43:40 2008
@@ -1,0 +1,47 @@
+<?php
+/*
+ PROJECT: People Map of the ReactOS Website
+ LICENSE: GPL v2 or any later version
+ FILE:
web/reactos.org/htdocs/peoplemap/lang/de.inc.php
+ PURPOSE: Translation
+ COPYRIGHT: Copyright 2007-2008 Colin Finck <mail(a)colinfinck.de>
+ TRANSLATOR: Colin Finck
+*/
+
+ /**** German resources (charset=utf-8) ****/
+ $peoplemap_langres["language"] = "Sprache";
+
+ $peoplemap_langres["header"] = '<a
href="http://www.reactos.org/">Startseite</a> > ReactOS
Personen-Karte';
+ $peoplemap_langres["title"] = "ReactOS Personen-Karte";
+ $peoplemap_langres["intro"] = 'Die folgende Karte zeigt die Standorte von
ReactOS-Entwicklern und -Benutzern.';
+
+ $peoplemap_langres["filter"] = "Nach Benutzergruppen filtern";
+ $peoplemap_langres["filter_intro"] = "Klicken Sie auf ein
Kontrollkästchen neben einer Benutzergruppe, um alle Benutzer dieser Gruppe zur Karte
hinzuzufügen oder von der Karte zu entfernen.";
+
+ $peoplemap_langres["add"] = "Benutzer suchen und zur Karte
hinzufügen";
+ $peoplemap_langres["add_username"] = "Benutzername";
+ $peoplemap_langres["add_fullname"] = "Voller Name";
+
+ $peoplemap_langres["mylocation"] = "Meine Position auf der Karte";
+ $peoplemap_langres["mylocation_login"] = "Sie müssen eingeloggt sein, um
Ihre Position festzulegen.";
+ $peoplemap_langres["mylocation_login_page"] = "Login-Seite";
+ $peoplemap_langres["mylocation_intro"] = "Hier können Sie ihre eigene
Position auf der Karte festlegen. Sie haben dazu mehrere Möglichkeiten:";
+ $peoplemap_langres["mylocation_marker_intro"] = "Einen Marker verwenden
und diesen auf Ihre Position auf der Karte ziehen.";
+ $peoplemap_langres["mylocation_marker_button"] = "Den Marker
verwenden";
+ $peoplemap_langres["mylocation_marker_save_intro"] = "Klicken Sie auf den
folgenden Button,<br>um Ihre Position zu speichern.";
+ $peoplemap_langres["mylocation_marker_save_button"] = "Meine Position
speichern";
+ $peoplemap_langres["mylocation_marker_cancel"] = "Abbrechen";
+ $peoplemap_langres["mylocation_coordinates_intro"] = "Die Koordinaten in
dezimalen Gradzahlen selbst angeben:";
+ $peoplemap_langres["mylocation_coordinates_button"] = "Eintragen";
+ $peoplemap_langres["mylocation_coordinates_invalid"] = "Dies sind keine
gültigen Koordinaten!";
+ $peoplemap_langres["mylocation_delete_intro"] = "Ãber den folgenden
Button können Sie Ihre eigene Position auf der Karte löschen.";
+ $peoplemap_langres["mylocation_delete_button"] = "Eigene Position
löschen";
+
+ $peoplemap_langres["latitude"] = "Breite";
+ $peoplemap_langres["longitude"] = "Länge";
+ $peoplemap_langres["removefrommap"] = "Diese Person aus der Karte
entfernen";
+ $peoplemap_langres["minquerylength"] = "Bitte geben Sie mindestens 3
Zeichen ein.";
+ $peoplemap_langres["nousers"] = "Keinen Benutzer mit Ortsdaten
gefunden.";
+ $peoplemap_langres["activatejs"] = "Sie müssen JavaScript aktivieren, um
die Personen-Karte zu benutzen!";
+ $peoplemap_langres["unsupportedbrowser"] = "Die Personen-Karte wird von
Ihrem Browser nicht unterstützt.";
+?>
Propchange:
trunk/web/reactos.org/htdocs/peoplemap/lang/de.inc.php
------------------------------------------------------------------------------
svn:eol-style = native
Added:
trunk/web/reactos.org/htdocs/peoplemap/lang/en.inc.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/l…
==============================================================================
---
trunk/web/reactos.org/htdocs/peoplemap/lang/en.inc.php (added)
+++
trunk/web/reactos.org/htdocs/peoplemap/lang/en.inc.php Mon Feb 11 21:43:40 2008
@@ -1,0 +1,47 @@
+<?php
+/*
+ PROJECT: People Map of the ReactOS Website
+ LICENSE: GPL v2 or any later version
+ FILE:
web/reactos.org/htdocs/peoplemap/lang/en.inc.php
+ PURPOSE: Translation
+ COPYRIGHT: Copyright 2007-2008 Colin Finck <mail(a)colinfinck.de>
+ TRANSLATOR: Colin Finck
+*/
+
+ /**** English resources (charset=utf-8) ****/
+ $peoplemap_langres["language"] = "Language";
+
+ $peoplemap_langres["header"] = '<a
href="http://www.reactos.org/">Startseite</a> > ReactOS People
Map';
+ $peoplemap_langres["title"] = "ReactOS People Map";
+ $peoplemap_langres["intro"] = "The following map shows the locations of
ReactOS Developers and Users";
+
+ $peoplemap_langres["filter"] = "Filter by User Groups";
+ $peoplemap_langres["filter_intro"] = "Click a Checkbox next to a User
Group to add all Users of this Group to the Map or remove them.";
+
+ $peoplemap_langres["add"] = "Search for a User and Add him to the
Map";
+ $peoplemap_langres["add_username"] = "User name";
+ $peoplemap_langres["add_fullname"] = "Full name";
+
+ $peoplemap_langres["mylocation"] = "My Location on the Map";
+ $peoplemap_langres["mylocation_login"] = "You must be logged in to set
your Location.";
+ $peoplemap_langres["mylocation_login_page"] = "Login Page";
+ $peoplemap_langres["mylocation_intro"] = "Here you can set your own
Location on the Map. You have several Possibilities to do so:";
+ $peoplemap_langres["mylocation_marker_intro"] = "Use a Marker and drag it
to your Location on the Map.";
+ $peoplemap_langres["mylocation_marker_button"] = "Use the Marker";
+ $peoplemap_langres["mylocation_marker_save_intro"] = "Click the following
Button<br>to save your Location.";
+ $peoplemap_langres["mylocation_marker_save_button"] = "Save my
Location";
+ $peoplemap_langres["mylocation_marker_cancel"] = "Cancel";
+ $peoplemap_langres["mylocation_coordinates_intro"] = "Enter the
Coordinates in decimal Degrees yourself:";
+ $peoplemap_langres["mylocation_coordinates_button"] = "Set";
+ $peoplemap_langres["mylocation_coordinates_invalid"] = "These are not
valid Coordinates!";
+ $peoplemap_langres["mylocation_delete_intro"] = "Using the following
Button, you can remove your Location on the Map.";
+ $peoplemap_langres["mylocation_delete_button"] = "Delete my
Location";
+
+ $peoplemap_langres["latitude"] = "Latitude";
+ $peoplemap_langres["longitude"] = "Longitude";
+ $peoplemap_langres["removefrommap"] = "Remove this User from the
Map";
+ $peoplemap_langres["minquerylength"] = "Please enter at least 3
characters.";
+ $peoplemap_langres["nousers"] = "No user with location data
found!";
+ $peoplemap_langres["activatejs"] = "You have to activate JavaScript to
use the People Map!";
+ $peoplemap_langres["unsupportedbrowser"] = "The People Map is not
supported by your Browser.";
+?>
Propchange:
trunk/web/reactos.org/htdocs/peoplemap/lang/en.inc.php
------------------------------------------------------------------------------
svn:eol-style = native
Added:
trunk/web/reactos.org/htdocs/peoplemap/languages.inc.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/l…
==============================================================================
---
trunk/web/reactos.org/htdocs/peoplemap/languages.inc.php (added)
+++
trunk/web/reactos.org/htdocs/peoplemap/languages.inc.php Mon Feb 11 21:43:40 2008
@@ -1,0 +1,15 @@
+<?php
+/*
+ PROJECT: People Map of the ReactOS Website
+ LICENSE: GPL v2 or any later version
+ FILE:
web/reactos.org/htdocs/peoplemap/languages.inc.php
+ PURPOSE: Language list
+ COPYRIGHT: Copyright 2007-2008 Colin Finck <mail(a)colinfinck.de>
+*/
+
+ // The language names have to be saved in an UTF-8 file without the Byte-Order-Mark
+ $peoplemap_languages = array(
+ "en" => "English",
+ "de" => "Deutsch (German)"
+ );
+?>
Propchange:
trunk/web/reactos.org/htdocs/peoplemap/languages.inc.php
------------------------------------------------------------------------------
svn:eol-style = native
Added:
trunk/web/reactos.org/htdocs/peoplemap/peoplemap.css
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/p…
==============================================================================
---
trunk/web/reactos.org/htdocs/peoplemap/peoplemap.css (added)
+++
trunk/web/reactos.org/htdocs/peoplemap/peoplemap.css Mon Feb 11 21:43:40 2008
@@ -1,0 +1,233 @@
+/*
+ PROJECT: People Map of the ReactOS Website
+ LICENSE: GPL v2 or any later version
+ FILE:
web/reactos.org/htdocs/peoplemap/peoplemap.css
+ PURPOSE: Main stylesheet
+ COPYRIGHT: Copyright 2007-2008 Colin Finck <mail(a)colinfinck.de>
+*/
+
+body {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ margin: 0 0 1em 0;
+ padding: 0; /* Only affects Opera */
+ background: #FFFFFF
url('http://www.reactos.org/images/topbar.jpg') repeat-x
scroll top left;
+}
+
+a {
+ color: #006090;
+}
+
+a:hover {
+ color: #000000;
+}
+
+tr, td {
+ vertical-align: top;
+}
+
+h1 {
+ display: block;
+ line-height: normal;
+ font-size: 14px;
+ font-weight: bold;
+ color: #FFFFFF;
+ background-color: #5984C3;
+ padding: 0px 0px 1px 10px;
+ margin-top: 0;
+}
+
+h1 a {
+ font-size: 14px;
+ font-weight: bold;
+ color: #FFFFFF;
+ background-color: #5984C3;
+ text-decoration: none;
+}
+
+h1 a:hover {
+ font-size: 14px;
+ font-weight: bold;
+ color: #FFFFFF;
+ background-color: #5984C3;
+ text-decoration: underline;
+}
+
+h2 {
+ font-size: 22px;
+ color: #5984C3;
+ font-weight: bold;
+ margin-top: 0;
+}
+
+h3 {
+ font-size: 10pt;
+ color: black;
+ font-weight: bold;
+ margin-top: 0;
+ margin-bottom: 1em;
+}
+
+#top {
+ margin: 0;
+ background:
url('http://www.reactos.org/images/logo.jpg') no-repeat scroll 35px
0;
+ padding: 103px 0 26px 0;
+ color: #FFFFFF;
+ text-align: right;
+}
+
+#top a {
+ font-size: 13px;
+ color: #FFFFFF;
+ text-decoration: none;
+ padding: 1px 5px 1px 5px;
+}
+
+#top a:hover {
+ color: #000000;
+ background-color: #FFCC33;
+}
+
+#topMenu {
+ font-size: 13px;
+ margin-left: 300px;
+ background-color: #5984C3;
+}
+
+#topMenu p {
+ text-align: left;
+ margin: 0;
+}
+
+#leftNav {
+ padding: 0px 10px 10px 7px;
+}
+
+#leftNav ol {
+ margin: 0;
+ padding: 0;
+ list-style-type: none;
+ background-color: #EEEEEE;
+ border-top: #3F3849 0px solid;
+ border-right: #3F3849 1px solid;
+ border-left: #3F3849 1px solid;
+}
+
+#leftNav ol li {
+ font-size: 13px;
+ font-weight: bold;
+ border-bottom: #3f3849 1px solid;
+}
+
+#leftNav ol li a {
+ font-size: 12px;
+
+ display: block;
+ width: 137px;
+ padding: 2px 4px 2px 4px;
+
+ color: #3F3849;
+ text-decoration: none;
+ background-color: #EEEEEE;
+}
+
+#leftNav ol li a:hover {
+ color: #000000;
+ background-color: #FFCC33;
+}
+
+#leftNav ol li a.extern {
+ background: none;
+ padding-right: 0px;
+}
+
+#leftNav .navTitle {
+ padding-left: 12px;
+ border-top: #3F3849 1px solid;
+ border-right: #3F3849 1px solid;
+ border-bottom: #3F3849 1px solid;
+ border-left: #3F3849 1px solid;
+
+ font-weight: bold;
+ font-size: 14px;
+ color: #FFFFFF;
+ background-color: #5984c3;
+}
+
+#content {
+ padding-right: 10px;
+}
+
+.bubble_bg, .selectable_bubble_bg, .hovered_bubble_bg {
+ margin-bottom: 10px;
+}
+
+.bubble_bg {
+ background: #C9DAF8;
+}
+
+.selectable_bubble_bg {
+ background: #E1EAFB;
+}
+
+.hovered_bubble_bg {
+ background: #FFFFCC;
+}
+
+.bubble {
+ padding: 8px;
+}
+
+.rounded_ul {
+ background: transparent url(images/ul.gif) no-repeat scroll left top;
+}
+.rounded_ur {
+ background: transparent url(images/ur.gif) no-repeat scroll right top;
+}
+.rounded_ll {
+ background: transparent url(images/ll.gif) no-repeat scroll left bottom;
+}
+.rounded_lr {
+ background: transparent url(images/lr.gif) no-repeat scroll right bottom;
+}
+
+#toolbox_td {
+ width: 300px;
+ padding-left: 7px;
+}
+
+#toolbox0_image, #toolbox1_image, #toolbox2_image {
+ height: 40px;
+ width: 47px;
+}
+
+#toolbox0_image {
+ background: url(images/filter.png) no-repeat;
+}
+
+#toolbox1_image {
+ background: url(images/add-user.png) no-repeat;
+}
+
+#toolbox2_image {
+ background: url(images/set-location.png) no-repeat;
+}
+
+#toolbox1_head, #toolbox2_head {
+ cursor: pointer;
+}
+
+#toolbox1_controls, #toolbox2_controls {
+ display: none;
+}
+
+div.colorbox {
+ border: solid 1px black;
+ height: 15px;
+ width: 15px;
+}
+
+td.toolbox_head {
+ /* This is mainly necessary for IE (as always ;-), but also useful as a general rule
for the other browsers */
+ width: 220px;
+}
Propchange:
trunk/web/reactos.org/htdocs/peoplemap/peoplemap.css
------------------------------------------------------------------------------
svn:eol-style = native
Added:
trunk/web/reactos.org/htdocs/peoplemap/peoplemap.js.php
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/p…
==============================================================================
---
trunk/web/reactos.org/htdocs/peoplemap/peoplemap.js.php (added)
+++
trunk/web/reactos.org/htdocs/peoplemap/peoplemap.js.php Mon Feb 11 21:43:40 2008
@@ -1,0 +1,524 @@
+/*
+ PROJECT: People Map of the ReactOS Website
+ LICENSE: GPL v2 or any later version
+ FILE:
web/reactos.org/htdocs/peoplemap/peoplemap.js.php
+ PURPOSE: Main JavaScript file (parsed by PHP before)
+ COPYRIGHT: Copyright 2007-2008 Colin Finck <mail(a)colinfinck.de>
+*/
+
+var Map;
+var IconTable;
+var MarkerTable;
+var MyLocationMarker = null;
+
+function AddUserToMap(UserId, UserName, FullName, Latitude, Longitude, UserGroup)
+{
+ // Has this user already been added to the map?
+ if(MarkerTable[UserId] || (UserId == MyUserId && MyLocationMarker))
+ return;
+
+ var IconColor;
+
+ if(!UserGroup)
+ {
+ UserGroup = "";
+ IconColor = "white";
+ }
+ else
+ IconColor = IconTable[UserGroup];
+
+ var Icon = new GIcon(G_DEFAULT_ICON, "images/marker_" + IconColor +
".png");
+ var Marker = new GMarker( new GLatLng(Latitude, Longitude), Icon );
+ var html;
+
+ html = "<strong><a
href=\"http://reactos.org/roscms/?page=user&sec=profil&sec2=&q… + UserId +
"\" target=\"_blank\">" + UserName +
"</a></strong><br>";
+ html += FullName + "<br><br>";
+
+ // parseFloat strips off trailing zeros
+ html += "<?php echo $peoplemap_langres["latitude"]; ?>: " +
parseFloat(Latitude) + "°<br>";
+ html += "<?php echo $peoplemap_langres["longitude"]; ?>: " +
parseFloat(Longitude) + "°<br><br>";
+
+ html += "<a href=\"javascript:RemoveUserFromMap(" + UserId +
")\"><?php echo $peoplemap_langres["removefrommap"];
?></a>";
+
+ GEvent.addListener( Marker, "click", function()
{Marker.openInfoWindowHtml(html);} );
+
+ MarkerTable[UserId] = new Object();
+ MarkerTable[UserId].group = UserGroup;
+ MarkerTable[UserId].marker = Marker;
+
+ Map.addOverlay(Marker);
+}
+
+function RemoveUserFromMap(UserId)
+{
+ Map.removeOverlay(MarkerTable[UserId].marker);
+ delete MarkerTable[UserId];
+}
+
+function SetLoading(id, value)
+{
+ document.getElementById("ajaxloading_" + id).style.visibility = (value ?
"visible" : "hidden");
+}
+
+function AjaxGet(action, parameters, data)
+{
+ var HttpRequest = false;
+
+ switch(action)
+ {
+ case "GetUsersByName":
+ SetLoading("add", true);
+ var url = "ajax-getuser.php?" + parameters;
+ var callback = "GetUsersByNameCallback(HttpRequest);";
+ break;
+
+ case "GetUsersByGroup":
+ SetLoading(data, true);
+ var url = "ajax-getuser.php?" + parameters;
+ var callback = "GetUsersByGroupCallback(HttpRequest, data);";
+ break;
+
+ case "SetLocation":
+ SetLoading(data, true);
+ var url = "ajax-setlocation.php?" + parameters;
+ var callback = "SetLocationCallback(HttpRequest, data);";
+ break;
+
+ case "SetLocation_GetUser":
+ var url = "ajax-getuser.php?" + parameters;
+ var callback = "SetLocationMarker_GetUserCallback(HttpRequest);";
+ break;
+
+ case "DeleteMyLocation":
+ var url = "ajax-deletelocation.php?delete=1";
+ var callback = "";
+ break;
+ }
+
+ if (window.XMLHttpRequest)
+ {
+ // Mozilla, Safari, ...
+ HttpRequest = new XMLHttpRequest();
+ }
+ else if (window.ActiveXObject)
+ {
+ // IE
+ try
+ {
+ HttpRequest = new ActiveXObject("Msxml2.XMLHTTP");
+ }
+ catch (e)
+ {
+ try
+ {
+ HttpRequest = new ActiveXObject("Microsoft.XMLHTTP");
+ }
+ catch (e) {}
+ }
+ }
+
+ if (!HttpRequest)
+ {
+ alert("Giving up :( Cannot create an XMLHTTP instance");
+ return false;
+ }
+
+ HttpRequest.open("GET", url, true);
+ HttpRequest.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000
00:00:00 GMT"); // Bypass the IE Cache
+ HttpRequest.send(null);
+
+ HttpRequest.onreadystatechange = function()
+ {
+ if(HttpRequest.readyState == 4)
+ {
+ if(HttpRequest.status == 200)
+ eval(callback);
+ else
+ alert("AJAX Request problem!" + "\n\nError Code: " +
HttpRequest.status + "\nError Text: " + HttpRequest.statusText + "\nURL:
" + url);
+ }
+ }
+}
+
+function GetUsersByNameCallback(HttpRequest)
+{
+ // Check for an error
+ if( HttpRequest.responseXML.getElementsByTagName("error").length > 0 )
+ alert(
HttpRequest.responseXML.getElementsByTagName("error")[0].firstChild.data );
+ else
+ {
+ var users = HttpRequest.responseXML.getElementsByTagName("user");
+
+ if(users.length == 0)
+ document.getElementById("add_user_result").innerHTML = "<?php echo
addslashes($peoplemap_langres["nousers"]); ?>";
+ else
+ {
+ var html = "<ul>";
+
+ for( var i = 0; i < users.length; i++ )
+ {
+ var UserId = users[i].getElementsByTagName("id")[0].firstChild.data;
+ var UserName =
users[i].getElementsByTagName("username")[0].firstChild.data;
+
+ var FullName = "";
+ if(users[i].getElementsByTagName("fullname")[0].firstChild)
+ FullName = users[i].getElementsByTagName("fullname")[0].firstChild.data;
+
+ var Latitude =
users[i].getElementsByTagName("latitude")[0].firstChild.data;
+ var Longitude =
users[i].getElementsByTagName("longitude")[0].firstChild.data;
+
+ html += "<li>";
+ html += "<a href=\"javascript:AddUserToMap(" + UserId + ",
'" + UserName + "', '" + FullName + "', " +
Latitude + ", " + Longitude + ");\">";
+ html += UserName;
+ html += "</a>";
+
+ if(FullName != "")
+ html += " (" + FullName + ")";
+
+ html += "</li>";
+ }
+
+ html += "</ul>";
+
+ document.getElementById("add_user_result").innerHTML = html;
+ }
+ }
+
+ SetLoading("add", false);
+}
+
+function GetUsersByGroupCallback(HttpRequest, UserGroup)
+{
+ // Check for an error
+ if( HttpRequest.responseXML.getElementsByTagName("error").length > 0 )
+ alert(
HttpRequest.responseXML.getElementsByTagName("error")[0].firstChild.data );
+ else
+ {
+ var users = HttpRequest.responseXML.getElementsByTagName("user");
+
+ for( var i = 0; i < users.length; i++ )
+ {
+ var UserId = users[i].getElementsByTagName("id")[0].firstChild.data;
+ var UserName =
users[i].getElementsByTagName("username")[0].firstChild.data;
+
+ var FullName = "";
+ if(users[i].getElementsByTagName("fullname")[0].firstChild)
+ FullName = users[i].getElementsByTagName("fullname")[0].firstChild.data;
+
+ var Latitude =
users[i].getElementsByTagName("latitude")[0].firstChild.data;
+ var Longitude =
users[i].getElementsByTagName("longitude")[0].firstChild.data;
+
+ AddUserToMap(UserId, UserName, FullName, Latitude, Longitude, UserGroup);
+ }
+ }
+
+ SetLoading(UserGroup, false);
+}
+
+function GetUser()
+{
+ var len = document.getElementById("add_query").value.length;
+
+ if(len == 0)
+ document.getElementById("add_user_result").innerHTML = "";
+ else if(len < 3)
+ document.getElementById("add_user_result").innerHTML = "<?php echo
addslashes($peoplemap_langres["minquerylength"]); ?>";
+ else
+ {
+ var param = "query=" + document.getElementById("add_query").value +
"&subject=";
+
+ if(document.getElementById("add_subject").selectedIndex == 0)
+ param += "username";
+ else
+ param += "fullname";
+
+ AjaxGet("GetUsersByName", param);
+ }
+}
+
+function OnWindowResize()
+{
+ var MinMapHeight = 300;
+ var MinWndScrollHeight = 800;
+ var MinMapWidth = 500;
+ var SubtractHeight = 300;
+ var SubtractWidth = 500;
+
+ var MapBox = document.getElementById("map");
+ var MapHeight;
+ var WndHeight;
+ var MapWidth;
+
+ // Set the height
+ if(window.innerHeight)
+ {
+ // All browsers except IE
+ WndHeight = window.innerHeight;
+ MapHeight = window.innerHeight - SubtractHeight;
+ MapWidth = window.innerWidth - SubtractWidth;
+ }
+ else
+ {
+ // IE in Strict Mode
+ WndHeight = document.documentElement.clientHeight;
+ MapHeight = document.documentElement.clientHeight - SubtractHeight;
+ MapWidth = document.documentElement.clientWidth - SubtractWidth;
+ }
+
+ if(MapHeight < MinMapHeight)
+ MapHeight = MinMapHeight;
+
+ if(MapWidth < MinMapWidth)
+ MapWidth = MinMapWidth;
+
+ if(Map)
+ {
+ if(WndHeight < MinWndScrollHeight)
+ Map.disableScrollWheelZoom();
+ else
+ Map.enableScrollWheelZoom();
+ }
+
+ MapBox.style.height = String(MapHeight) + "px";
+ MapBox.style.width = String(MapWidth) + "px";
+}
+
+function Load()
+{
+ // Exclude IE 5.5 as well, because it has problems with the CSS cursor attribute and
various other stuff
+ if( !GBrowserIsCompatible() || navigator.userAgent.indexOf("MSIE 5.5") >=
0)
+ {
+ alert("<?php echo $peoplemap_langres["unsupportedbrowser"];
?>");
+ return;
+ }
+
+ window.onresize = OnWindowResize;
+
+ // Call it for setting the MapBox dimensions before creating the map in it
+ OnWindowResize();
+
+ Map = new GMap2( document.getElementById("map") );
+ Map.addControl(new GLargeMapControl());
+ Map.addControl(new GMapTypeControl());
+ Map.addControl(new GOverviewMapControl(new GSize(150,150)));
+ Map.setCenter(new GLatLng(0, 0), 1);
+
+ // Call it again for enabling/disabling scroll wheel zoom
+ OnWindowResize();
+
+ MarkerTable = new Object();
+}
+
+function Unload()
+{
+ delete IconTable;
+ delete MarkerTable;
+ GUnload();
+}
+
+function ToggleToolbox(id)
+{
+ var i;
+ var ToolboxBubble;
+ var ToolboxHead;
+ var ToolboxControls;
+
+ for(i = 0; ; i++)
+ {
+ ToolboxBubble = document.getElementById("toolbox" + i +
"_bubble");
+ ToolboxHead = document.getElementById("toolbox" + i + "_head");
+ ToolboxControls = document.getElementById("toolbox" + i +
"_controls");
+
+ if(ToolboxBubble && ToolboxHead && ToolboxControls)
+ {
+ if(i == id)
+ {
+ // Show the toolbox identified by "id", hide all the others
+ ToolboxBubble.className = "bubble_bg";
+ ToolboxBubble.onmouseover = null;
+ ToolboxBubble.onmouseout = null;
+ ToolboxHead.style.cursor = "default";
+ ToolboxControls.style.display = "block";
+ }
+ else
+ {
+ ToolboxBubble.className = "selectable_bubble_bg";
+ ToolboxBubble.onmouseover = function() {BubbleHover(this, true);};
+ ToolboxBubble.onmouseout = function() {BubbleHover(this, false);};
+ ToolboxHead.style.cursor = "pointer";
+ ToolboxControls.style.display = "none";
+ }
+ }
+ else
+ break;
+ }
+}
+
+function ToggleUserGroup(CheckBox, UserGroup)
+{
+ var id;
+
+ if(CheckBox.checked)
+ {
+ // Add all users belonging to this group to the map
+ var param = "query=" + UserGroup + "&subject=group";
+ var data = UserGroup;
+ AjaxGet("GetUsersByGroup", param, data);
+ }
+ else
+ {
+ // Remove all users from the map, which belong to the group, which has just been
unchecked with the checkbox
+ for(id in MarkerTable)
+ {
+ if(MarkerTable[id].group == UserGroup)
+ RemoveUserFromMap(id);
+ }
+ }
+}
+
+function SetLocationMarker()
+{
+ RemoveMyMarkers();
+
+ // Get the current location of the user
+ var param = "subject=userid&query=" + MyUserId;
+ AjaxGet("SetLocation_GetUser", param);
+}
+
+function SetLocationMarker_GetUserCallback(HttpRequest)
+{
+ // GMarkerOptions has no constructor, so we use a normal JavaScript Object() here
+ var opts = new Object();
+ opts.draggable = true;
+ opts.bouncy = true;
+
+ var latitude = 0;
+ var longitude = 0;
+
+ if(HttpRequest.responseXML.getElementsByTagName("latitude")[0])
+ {
+ latitude =
HttpRequest.responseXML.getElementsByTagName("latitude")[0].firstChild.data;
+ longitude =
HttpRequest.responseXML.getElementsByTagName("longitude")[0].firstChild.data;
+ }
+ else
+ {
+ // We set the marker at 0° N, 0° E. To ensure that the user sees the marker, reset the
viewport.
+ Map.setCenter(new GLatLng(0, 0), 1);
+ }
+
+ MyLocationMarker = new GMarker( new GLatLng(latitude, longitude), opts );
+ var html;
+
+ html = "<?php echo
$peoplemap_langres["mylocation_marker_save_intro"];
?><br><br>";
+ html += "<input type=\"button\"
onclick=\"SetLocationMarker_Save();\" value=\"<?php echo
$peoplemap_langres["mylocation_marker_save_button"]; ?>\"> ";
+ html += "<input type=\"button\"
onclick=\"SetLocationMarker_Cancel();\" value=\"<?php echo
$peoplemap_langres["mylocation_marker_cancel"]; ?>\"> ";
+ html += "<img id=\"ajaxloading_setlocation_marker\"
style=\"visibility: hidden;\" src=\"images/ajax_loading.gif\"
alt=\"\">";
+
+ GEvent.addListener( MyLocationMarker, "click", function()
{MyLocationMarker.openInfoWindowHtml(html);} );
+ GEvent.addListener( MyLocationMarker, "dragstart", function()
{MyLocationMarker.closeInfoWindow();} );
+ GEvent.addListener( MyLocationMarker, "dragend", function()
{MyLocationMarker.openInfoWindowHtml(html);} );
+
+ Map.addOverlay(MyLocationMarker);
+}
+
+function SetLocationMarker_Cancel()
+{
+ Map.removeOverlay(MyLocationMarker);
+ MyLocationMarker = null;
+}
+
+function SetLocationMarker_Save()
+{
+ var latlng;
+ var param;
+
+ latlng = MyLocationMarker.getLatLng();
+ param = "latitude=" + latlng.lat().toFixed(6) + "&longitude=" +
latlng.lng().toFixed(6);
+
+ AjaxGet("SetLocation", param, "setlocation_marker");
+}
+
+function SetLocationCallback(HttpRequest, data)
+{
+ // Check for an error
+ if( HttpRequest.responseXML.getElementsByTagName("error").length > 0 )
+ alert(
HttpRequest.responseXML.getElementsByTagName("error")[0].firstChild.data );
+ else if(
HttpRequest.responseXML.getElementsByTagName("userinformation").length > 0 )
+ {
+ RemoveMyMarkers();
+
+ // Add a normal white marker
+ var UserId =
HttpRequest.responseXML.getElementsByTagName("id")[0].firstChild.data;
+ var UserName =
HttpRequest.responseXML.getElementsByTagName("username")[0].firstChild.data;
+
+ var FullName = "";
+ if(HttpRequest.responseXML.getElementsByTagName("fullname")[0].firstChild)
+ FullName =
HttpRequest.responseXML.getElementsByTagName("fullname")[0].firstChild.data;
+
+ var Latitude =
HttpRequest.responseXML.getElementsByTagName("latitude")[0].firstChild.data;
+ var Longitude =
HttpRequest.responseXML.getElementsByTagName("longitude")[0].firstChild.data;
+
+ AddUserToMap(UserId, UserName, FullName, Latitude, Longitude);
+ }
+
+ // Only hide the coordinates loading animation, the other one has already been deleted
by the RemoveMyMarkers() call above
+ if(data == "setlocation_coordinates")
+ SetLoading(data, false);
+}
+
+function DeleteMyLocation()
+{
+ RemoveMyMarkers();
+ AjaxGet("DeleteMyLocation");
+}
+
+function SetLocationCoordinates()
+{
+ lat = parseFloat(document.getElementById("mylocation_latitude").value);
+ lng = parseFloat(document.getElementById("mylocation_longitude").value);
+
+ if(isNaN(lat) || isNaN(lng))
+ {
+ alert("<?php echo
$peoplemap_langres["mylocation_coordinates_invalid"]; ?>");
+ return;
+ }
+
+ if(lat >= -90 && lat <= 90 &&
+ lng >= -180 && lng <= 180)
+ {
+ // These are correct coordinates, set them
+ var param = "latitude=" + lat.toFixed(6) + "&longitude=" +
lng.toFixed(6);
+
+ AjaxGet("SetLocation", param, "setlocation_coordinates");
+ }
+ else
+ alert("<?php echo
$peoplemap_langres["mylocation_coordinates_invalid"]; ?>");
+}
+
+function CheckCoordinate(elem)
+{
+ var val = elem.value.replace( /[^[0-9-.]/g, "");
+
+ // First check if something was changed by the replace function.
+ // If not, don't set elem.value = val. Otherwise the cursor would always jump to the
last character in IE, when you press any key.
+ if( elem.value != val )
+ elem.value = val;
+}
+
+function RemoveMyMarkers()
+{
+ // Is the user already setting his position?
+ if(MyLocationMarker)
+ SetLocationMarker_Cancel();
+
+ // Has the user already been added to the map?
+ if(MarkerTable[MyUserId])
+ RemoveUserFromMap(MyUserId);
+}
+
+function BubbleHover(elem, hover)
+{
+ if(hover)
+ elem.className = "hovered_bubble_bg";
+ else
+ elem.className = "selectable_bubble_bg";
+}
Propchange:
trunk/web/reactos.org/htdocs/peoplemap/peoplemap.js.php
------------------------------------------------------------------------------
svn:eol-style = native
Added:
trunk/web/reactos.org/htdocs/peoplemap/peoplemap.sql
URL:
http://svn.reactos.org/svn/reactos/trunk/web/reactos.org/htdocs/peoplemap/p…
==============================================================================
---
trunk/web/reactos.org/htdocs/peoplemap/peoplemap.sql (added)
+++
trunk/web/reactos.org/htdocs/peoplemap/peoplemap.sql Mon Feb 11 21:43:40 2008
@@ -1,0 +1,8 @@
+-- SQL Dump for the "peoplemap" database
+
+CREATE TABLE `user_locations` (
+ `roscms_user_id` bigint(20) UNSIGNED NOT NULL,
+ `latitude` float(8,6) NOT NULL,
+ `longitude` float(9,6) NOT NULL,
+ PRIMARY KEY (`roscms_user_id`)
+);
Propchange:
trunk/web/reactos.org/htdocs/peoplemap/peoplemap.sql
------------------------------------------------------------------------------
svn:eol-style = native