[ABD]Google Earth User Plotter Version 3

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
User avatar
mjimeyg
Registered User
Posts: 840
Joined: Sat Aug 29, 2009 7:38 pm
Location: London

[ABD]Google Earth User Plotter Version 3

Post by mjimeyg » Sat Nov 28, 2009 1:37 am

Modification Name: Earth Mapper
Author: mjimeyg

Modification Description:: A MOD that allows the plotting of the number of users in each city on Google Earth.
Modification Version:: 3-2011.03.25.02

Requirements: You will need to obtain a Google Maps API key and the latest GeoLite Binary Database.

WARNING: You MUST download the GeoLite database and upload it into the /earthmapper/data/ folder as soon as you have installed the mod or you will get errors.

Features:
  • Show the number of users your board has from each city.
  • Cusomise the placemark text.
  • Use custom placemark icons.
  • Create custom placemarks,
  • *new* - Appears in the front page.
  • *new* - Shows individual users on map (based on IP address).
  • *new* - Users can opt in or out of having their location displayed.
  • *new* - Users profile picture used as placemark and profile summary shown.
  • *new* - Map rotates to user locale on startup. (Based on IP address).
  • *new* - Options to show current online users and friends. (KNOWN BUG: The code is in place but doesn't work, if someone figures out why please share!)
Screenshots: Image
Image
Image

Demo URL: http://consof.com/forums/

Modification Download: https://sourceforge.net/projects/earthm ... p/download

Notes: This product includes GeoLite data created by MaxMind, available from http://maxmind.com/

Bug list:
  • 27/12/2009 - Error in ACP module saying langauge file not found. (FIXED in release 2009.12.27)
Last edited by mjimeyg on Fri Mar 25, 2011 1:30 pm, edited 9 times in total.
Questions answered via forums only, no pms or emails. Thank you.

ConSof Alternate Login for phpBB

Image Image

RossSEMI
Registered User
Posts: 51
Joined: Sat Feb 16, 2008 9:25 pm
Location: Warren, Michigan, USA

Re: [RC]Google Earth User Plotter

Post by RossSEMI » Sat Dec 19, 2009 12:45 am

Any update on this mod?
I have it installed and working but not all placemarkers are showing.
The generate_kml.php file is not completing. Getting following error.
BTW, all IP's being pulled from my data base are legit and searchable.

Link to my generate_kml.php file : http://greatlakesmetaldetecting.com/php ... te_kml.php

Link to my map: http://greatlakesmetaldetecting.com/php ... rthmap.php

Image
Just a 10 year rookie at this stuff.

User avatar
mjimeyg
Registered User
Posts: 840
Joined: Sat Aug 29, 2009 7:38 pm
Location: London

Re: [RC]Google Earth User Plotter

Post by mjimeyg » Sat Dec 19, 2009 5:11 pm

RossSEMI wrote:Any update on this mod?
I have it installed and working but not all placemarkers are showing.
The generate_kml.php file is not completing. Getting following error.
BTW, all IP's being pulled from my data base are legit and searchable.
I looked at your generate_kml.php output in Firefox, Safari and IE.

It fails to fully load in Safari and IE but comes out fine in FF.

Also, as placemarks are appearing on your map, the generated KML file should be valid otherwise there would be no placemarks at all.

The same issues occur for my own generated kml files.

As for placemarks not appearing, there are only three reasons I can think of that can cause it.

1. The IP address is being routed through elsewhere... ie you user says they come from Paris but they are being routed through an IP in Calais.

2. The IP address is one of the reserved IP's.

3. Your user hides their IP address.

You can test ip's here: http://geotool.flagfox.net/
Questions answered via forums only, no pms or emails. Thank you.

ConSof Alternate Login for phpBB

Image Image

RossSEMI
Registered User
Posts: 51
Joined: Sat Feb 16, 2008 9:25 pm
Location: Warren, Michigan, USA

Re: [RC]Google Earth User Plotter

Post by RossSEMI » Sat Dec 19, 2009 5:38 pm

Thanks for checking mjimeyg. I will be adding your credits/link on my page this weekend.
How would you like it worded?
It fails to fully load in Safari and IE but comes out fine in FF.
Any reason for this? It was driving me nuts. I never thought to check with FF. Thanks again.
Very cool mod btw.

One last thing. I can't get the "GoTo" thing to work with subsilver2 template.
I just get a blank image. I suspect it's because of using DIV's in a table?

Code: Select all

<!-- INCLUDE overall_header.html -->

<table width="100%" align="center" cellpadding="3" cellspacing="1" border="0">
<tr>
<th class="thTop" align="center">GLMD Google Earth Map</th>
</tr>
</table>
<br>
<center>
<body onload='init()' id='body'>
  <div>
    <form name='searchform' id='searchform' action='javascript:submitLocation();void(0);'>
      <input type=text size=60 id='address'></input>
      <input type=submit value='Go to location'>
    </form>
  </div>

  <div id='map3d_container' style='border: 1px solid silver; height: 600px;'> <!--  defaults width to browser -->
  <!-- <div id='map3d_container' style='border: 1px solid silver; height: 480px; width: 640px;'> fix width and height -->
    <div id='map3d' style='height: 100%; width: 100%;'></div>
  </div>
</center>
<br>

<!-- INCLUDE overall_footer.html -->
Just a 10 year rookie at this stuff.

User avatar
mjimeyg
Registered User
Posts: 840
Joined: Sat Aug 29, 2009 7:38 pm
Location: London

Re: [RC]Google Earth User Plotter

Post by mjimeyg » Sat Dec 19, 2009 6:52 pm

On the subsilver thing, is it the form or the map that comes up blank?
Questions answered via forums only, no pms or emails. Thank you.

ConSof Alternate Login for phpBB

Image Image

User avatar
mjimeyg
Registered User
Posts: 840
Joined: Sat Aug 29, 2009 7:38 pm
Location: London

Re: [RC]Google Earth User Plotter

Post by mjimeyg » Sat Dec 19, 2009 6:53 pm

Oh, and for a credit, just a link to the homepage so others can use it will be fine, many thanks!

http://www.consof.com/index.php?page=earthmapper
Questions answered via forums only, no pms or emails. Thank you.

ConSof Alternate Login for phpBB

Image Image

RossSEMI
Registered User
Posts: 51
Joined: Sat Feb 16, 2008 9:25 pm
Location: Warren, Michigan, USA

Re: [RC]Google Earth User Plotter

Post by RossSEMI » Sat Dec 19, 2009 8:32 pm

On the subsilver thing, is it the form or the map that comes up blank?
My mistake, not blank.
I get double image of map and hiting GoTo button changes bottom image to location.

Image
Just a 10 year rookie at this stuff.

User avatar
mjimeyg
Registered User
Posts: 840
Joined: Sat Aug 29, 2009 7:38 pm
Location: London

Re: [RC]Google Earth User Plotter

Post by mjimeyg » Sat Dec 19, 2009 8:42 pm

What does the source code say when you view it in the browser? I'm not sure how the template parser would treat commented code.

It could be doubling the image that way.
Questions answered via forums only, no pms or emails. Thank you.

ConSof Alternate Login for phpBB

Image Image

RossSEMI
Registered User
Posts: 51
Joined: Sat Feb 16, 2008 9:25 pm
Location: Warren, Michigan, USA

Re: [RC]Google Earth User Plotter

Post by RossSEMI » Mon Dec 21, 2009 8:08 pm

1st off, again this only happens with subsilver2 template not with prosilver.
Here is code I use to displa map and GOTO function:

Code: Select all

<center>
<body onload='init()' id='body'>
  <div>
    <form name='searchform' id='searchform' action='javascript:submitLocation();void(0);'>
      <input type=text size=60 id='address'></input>
      <input type=submit value='Go to location'>
    </form>
  </div>

  <div id='map3d_container' style='border: 1px solid silver; height: 600px;'> <!--  defaults width to browser -->
  <!-- <div id='map3d_container' style='border: 1px solid silver; height: 480px; width: 640px;'> fix width and height -->
    <div id='map3d' style='height: 100%; width: 100%;'></div>
  </div>
</center>
If I remove GOTO function code, everything is OK.

Code: Select all

<body onload='init()' id='body'>
  <div>
    <form name='searchform' id='searchform' action='javascript:submitLocation();void(0);'>
      <input type=text size=60 id='address'></input>
      <input type=submit value='Go to location'>
    </form>
  </div>
Source code looks OK in browser.
Apparently, this code conflicts with Private Message popup code in the overall_header.html file.
Here is that code:

Code: Select all

<!-- IF S_USER_PM_POPUP -->
	if ({S_NEW_PM})
	{
		popup('{UA_POPUP_PM}', 550, 460, '_phpbbprivmsg');
	}
<!-- ENDIF -->

function popup(url, width, height, name)
{
	if (!name)
	{
		name = '_popup';
	}

	window.open(url.replace(/&/g, '&'), name, 'height=' + height + ',resizable=yes,scrollbars=yes,width=' + width);
	return false;
}

function jumpto()
{
	var page = prompt('{LA_JUMP_PAGE}:', '{ON_PAGE}');
	var per_page = '{PER_PAGE}';
	var base_url = '{A_BASE_URL}';

	if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0)
	{
		if (base_url.indexOf('?') == -1)
		{
			document.location.href = base_url + '?start=' + ((page - 1) * per_page);
		}
		else
		{
			document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page);
		}
	}
}

/**
* Find a member
*/
function find_username(url)
{
	popup(url, 760, 570, '_usersearch');
	return false;
}

/**
* Mark/unmark checklist
* id = ID of parent container, name = name prefix, state = state [true/false]
*/
function marklist(id, name, state)
{
	var parent = document.getElementById(id);
	if (!parent)
	{
		eval('parent = document.' + id);
	}

	if (!parent)
	{
		return;
	}

	var rb = parent.getElementsByTagName('input');
	
	for (var r = 0; r < rb.length; r++)
	{
		if (rb[r].name.substr(0, name.length) == name)
		{
			rb[r].checked = state;
		}
	}
}

<!-- IF ._file -->

	/**
	* Play quicktime file by determining it's width/height
	* from the displayed rectangle area
	*
	* Only defined if there is a file block present.
	*/
	function play_qt_file(obj)
	{
		var rectangle = obj.GetRectangle();

		if (rectangle)
		{
			rectangle = rectangle.split(',')
			var x1 = parseInt(rectangle[0]);
			var x2 = parseInt(rectangle[2]);
			var y1 = parseInt(rectangle[1]);
			var y2 = parseInt(rectangle[3]);

			var width = (x1 < 0) ? (x1 * -1) + x2 : x2 - x1;
			var height = (y1 < 0) ? (y1 * -1) + y2 : y2 - y1;
		}
		else
		{
			var width = 200;
			var height = 0;
		}

		obj.width = width;
		obj.height = height + 16;

		obj.SetControllerVisible(true);

		obj.Play();
	}
<!-- ENDIF -->
Just a 10 year rookie at this stuff.

User avatar
mjimeyg
Registered User
Posts: 840
Joined: Sat Aug 29, 2009 7:38 pm
Location: London

Re: [RC]Google Earth User Plotter

Post by mjimeyg » Mon Dec 21, 2009 8:14 pm

Do you have a URL I could see?

I assume the GOTO function you are talking about is the submitLocation function?
Questions answered via forums only, no pms or emails. Thank you.

ConSof Alternate Login for phpBB

Image Image

RossSEMI
Registered User
Posts: 51
Joined: Sat Feb 16, 2008 9:25 pm
Location: Warren, Michigan, USA

Re: [RC]Google Earth User Plotter

Post by RossSEMI » Mon Dec 21, 2009 8:27 pm

Here you go:
http://greatlakesmetaldetecting.com/php ... rthmap.php

Default template is prosilver, map looks OK.

To see problem, switch to subsilver2 template. See styles above to select.
Just a 10 year rookie at this stuff.

User avatar
mjimeyg
Registered User
Posts: 840
Joined: Sat Aug 29, 2009 7:38 pm
Location: London

Re: [RC]Google Earth User Plotter

Post by mjimeyg » Mon Dec 21, 2009 9:00 pm

Ok, so I had a look using both styles in Google Chrome, Safari, Firefox, and IE.

FF and IE have the same issue in subsilver.

But FF has the same issue in both styles.

I was tryng to figure out what could cause this as all the div tags appear to be properly closed.

The only thing I cn think of is that your html code is what's called 'well-formed'

For instance all tags should have a corresponding closing tag, i.e:

Code: Select all

<input></input>
<input />
Also, some of your attributes aren't enclodes in quotes.

This is what the got to location code should look like in well-formed:

Code: Select all

<div>
    <form name='searchform' id='searchform' action='javascript:submitLocation();void(0);'>
      <input type='text' size='60' id='address'></input>
      <input type='submit' value='Go to location' />
    </form>
  </div>
I'm not sure if it will fix the issue, but it's worth a shot.
Questions answered via forums only, no pms or emails. Thank you.

ConSof Alternate Login for phpBB

Image Image

RossSEMI
Registered User
Posts: 51
Joined: Sat Feb 16, 2008 9:25 pm
Location: Warren, Michigan, USA

Re: [RC]Google Earth User Plotter

Post by RossSEMI » Tue Dec 22, 2009 3:28 pm

Made some of the changes you suggested but unfortunately didn't have any effect on outcome.
Also one other problem. I added "Custom Icon path - Full Path (Leave blank for default)" in CP.

Code: Select all

http://greatlakesmetaldetecting.com/phpBB3/earthmapper/data/glmd.png
This to has no effect.??? Does the icon image have to be a certain size or name?
Just a 10 year rookie at this stuff.

User avatar
mjimeyg
Registered User
Posts: 840
Joined: Sat Aug 29, 2009 7:38 pm
Location: London

Re: [RC]Google Earth User Plotter

Post by mjimeyg » Tue Dec 22, 2009 3:55 pm

RossSEMI wrote:Made some of the changes you suggested but unfortunately didn't have any effect on outcome.
Also one other problem. I added "Custom Icon path - Full Path (Leave blank for default)" in CP.

Code: Select all

http://greatlakesmetaldetecting.com/phpBB3/earthmapper/data/glmd.png
This to has no effect.??? Does the icon image have to be a certain size or name?
I tested out your placemark icon on my board and it worked fine.

However I noticed that when I checked your generated kml file the style section was missing.

Can you check in your phpbb_config table that the entry 'earthmapper_icon_path' is set.

Also that in the generate_kml.php file, that the following code exists at about line 63:

Code: Select all

if((isset($config['earthmapper_icon_path'])) && (!empty($config['earthmapper_icon_path'])))
{
	echo '<Style id="customPlacemark">
    <IconStyle>
      <scale>1.399999976158142</scale>
      <Icon>
        <href>' . $config['earthmapper_icon_path'] . '</href>
      </Icon>
    </IconStyle>
  </Style>';
}
As for this double posting, could you pm or post the entire code for your custom page for me? That way I can try and debug it on my dev boards.
Questions answered via forums only, no pms or emails. Thank you.

ConSof Alternate Login for phpBB

Image Image

RossSEMI
Registered User
Posts: 51
Joined: Sat Feb 16, 2008 9:25 pm
Location: Warren, Michigan, USA

Re: [RC]Google Earth User Plotter

Post by RossSEMI » Tue Dec 22, 2009 4:59 pm

OK, stupid me. I just realized I was using generate_kml.php from stand aloan page and not setup for phpBB3.
Corrected and custom icon now working. However doubling still continues. Here is code for custom page.

glmdearthmap.php file in phpBB3 dir:

Code: Select all

<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();

page_header('GLMD Google Earth Map');

$template->set_filenames(array(
'body' => 'glmd_earthmap_body.html',
));

make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
page_footer();
?>
glmd_earthmap_body.html file in subsilver2 template directory:

Code: Select all

<!-- INCLUDE overall_header.html -->

<table width="100%" align="center" cellpadding="3" cellspacing="1" border="0">
<tr>
<th class="thTop" align="center">GLMD Google Earth Map</th>
</tr>
</table>
<br />
<center>
<body onload='init()' id='body'>
  <div>
 <form name='searchform' id='searchform' action='javascript:submitLocation();void(0);'>
	<input type='text' size='60' id='address'></input>
	<input type='submit' value='Go to location' />
 </form>
  </div>

  <div id='map3d_container' style='border: 1px solid silver; height: 600px;'> <!--  defaults width to browser -->
  <!-- <div id='map3d_container' style='border: 1px solid silver; height: 480px; width: 640px;'> fix width and height -->
    <div id='map3d' style='height: 100%; width: 100%;'></div>
  </div>
</center>

<br />
<center>Powered by <a href="http://www.consof.com/index.php?page=earthmapper" target="_blank">Con Sof Earth Mapper</a></center>
<br />

<!-- INCLUDE overall_footer.html -->
Again, thanks for your help.
Just a 10 year rookie at this stuff.

Locked

Return to “[3.0.x] Abandoned MODs”