Mercurial > hg > batmud > gmap2
changeset 132:ace4060171e8 gmap2
Remove SQL / private/public marker mentions, as I personally deem those
unnecessary, at least for current development.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 09 Mar 2014 13:07:50 +0200 |
parents | f28f58045270 |
children | 68cdf41b3a48 |
files | README priv.php pub.php tools/tables.sql |
diffstat | 4 files changed, 5 insertions(+), 114 deletions(-) [+] |
line wrap: on
line diff
--- a/README Sun Mar 09 13:04:49 2014 +0200 +++ b/README Sun Mar 09 13:07:50 2014 +0200 @@ -3,7 +3,6 @@ These are the "hard" requirements. - PHP 5 and the PHP commandline interpreter (notice the latter!) -(- MySQL ) - A sane and working /bin/sh (bash, for example) - 'convert' utility of ImageMagick or GraphicsMagick. - Mercurial (Hg) DVCS. @@ -19,29 +18,16 @@ ============== Steps for producing your own fancy Google Maps -style BatMap: -1. Run tools/createdb.sh to create database for storing custom - markers. Or do it by hand, the SQL table schemas are in - tools/tables.sql - -2. Edit db_credentials.php to match your database configuration: - -<?php - $db_host = "localhost"; - $db_name = "map"; - $db_passwd = "zonni123"; - $db_database = "map"; -?> - -3. Run tools/makegmaps.php: +1. Run tools/makegmaps.php: $ cd tools $ php makegmaps.php -4. Edit tiles/htaccess.skel, tiles/9/htaccess.skel and tiles/10/htaccess.skel +2. Edit tiles/htaccess.skel, tiles/9/htaccess.skel and tiles/10/htaccess.skel to point to right address, rename all of them to .htaccess respectively. -5. Some additional http-server configuration may be necessary. +3. Some additional http-server configuration may be necessary. -6. ??? +4. ??? -7. Profit. +5. Profit.
--- a/priv.php Sun Mar 09 13:04:49 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -<?php -session_start(); -if (session_is_registered("user")) -{ - require("db_credentials.php"); - - $db = @mysql_connect($db_host, $db_name, $db_passwd) or die ("MySQL error"); - @mysql_select_db($db_database, $db) or die ("MySQL error"); - - $username = $_SESSION["user"]; - - $result = mysql_query("select id from users where login='".addslashes($username)."'", $db); - if ($result !== FALSE) { - $data = @mysql_fetch_assoc($result); - $id = $data["id"]; - - $result = mysql_query("select markers.*,users.login from markers left join users on markers.ownerid=users.id where public=0 and ownerid=$id", $db); - if ($result !== FALSE) { - while ($data = @mysql_fetch_assoc($result)) - $res[] = $data; - } - echo json_encode($res); - } -} -?>
--- a/pub.php Sun Mar 09 13:04:49 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ -<?php -require("db_credentials.php"); - -$db = @mysql_connect($db_host,$db_name,$db_passwd) or die ("MySQL error"); -@mysql_select_db($db_database,$db) or die ("MySQL error"); - -$result = @mysql_query( - "SELECT markers.*,users.login FROM markers ". - "LEFT JOIN users ON markers.ownerid=users.id WHERE public=1", $db); - -if (result !== FALSE) { - $res = array(); - - while ($data = @mysql_fetch_assoc($result)) - $res[] = $data; - - echo json_encode($res); -} -?> \ No newline at end of file
--- a/tools/tables.sql Sun Mar 09 13:04:49 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ --- --- Table structure for table `markers` --- - -CREATE TABLE `markers` ( - `id` int(11) NOT NULL auto_increment, - `ownerid` int(11) NOT NULL, - `name` text collate utf8_unicode_ci NOT NULL, - `x` int(11) NOT NULL, - `y` int(11) NOT NULL, - `created` timestamp NOT NULL default CURRENT_TIMESTAMP, - `type` char(1) collate utf8_unicode_ci NOT NULL, - `public` tinyint(1) NOT NULL, - `moderated` tinyint(1) NOT NULL, - `comment` text collate utf8_unicode_ci NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=12 ; - --- -------------------------------------------------------- - --- --- Table structure for table `overlays` --- - -CREATE TABLE `overlays` ( - `id` int(11) NOT NULL auto_increment, - `ownerid` int(11) NOT NULL, - `x` int(11) NOT NULL, - `y` int(11) NOT NULL, - `char` char(1) collate utf8_unicode_ci NOT NULL, - `name` text collate utf8_unicode_ci NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ; - --- -------------------------------------------------------- - --- --- Table structure for table `users` --- - -CREATE TABLE `users` ( - `id` int(11) NOT NULL auto_increment, - `login` text collate utf8_unicode_ci NOT NULL, - `passwd` text collate utf8_unicode_ci NOT NULL, - `email` text collate utf8_unicode_ci NOT NULL, - `created` timestamp NOT NULL default CURRENT_TIMESTAMP, - `lastseen` timestamp NOT NULL default '0000-00-00 00:00:00', - `moderator` tinyint(1) NOT NULL, - `cookie` text collate utf8_unicode_ci NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=26 ;