[BETA] Phoogle (Google) Map

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
junks2001
Registered User
Posts: 16
Joined: Sun Sep 12, 2004 8:04 am

Re: [BETA] Phoogle (Google) Map

Post by junks2001 »

This was right! :D

Thanks a ton! :ugeek:

BassFace wrote:
junks2001 wrote:

Code: Select all

Fatal error: Call to a member function on a non-object in /phpBB2/includes/usercp_register.php on line 1210
That's the full error.

Here's the code on line 1210.

Code: Select all

"PHOOGLE_SCRIPT" => $userMap->printGoogleJS(),
Not certain exactly, but it looks like the phoogle class file is not being included. There is a closing curly brace '}' right before the Phoogle map code that includes the class - I'm wondering if maybe you edited that section of usercp_register.php properly??? It's around line 872.

It should look like this:

Code: Select all

$user_style = $userdata['user_style'];
	$user_lang = $userdata['user_lang'];
	$user_timezone = $userdata['user_timezone'];
	$user_dateformat = $userdata['user_dateformat'];
}
// Phoogle Map
// ---------------------------------------
// Bring in phoogle class
	include($phpbb_root_path . 'includes/phpbb_phoogle_class.'.$phpEx);
// sql for map config
	$sql_map_config = "SELECT * 
					 FROM " . PHOOGLE_CONFIG_TABLE;
	if( !($result_map_config = $db->sql_query($sql_map_config)) )
	{
		message_die(GENERAL_ERROR, 'Could not query Map Config', '', __LINE__, __FILE__, $sql_map_config);
	}
	while ( $mapConfig = $db->sql_fetchrow($result_map_config) )
	{
			$api_key = $mapConfig['api_key'];
			$map_width = $mapConfig['profile_map_width'];
			$width_measure = $mapConfig['profile_width_measure'];
			$map_height = $mapConfig['profile_map_height'];
			$height_measure = $mapConfig['profile_height_measure'];
			$show_control = $mapConfig['show_control'];
			$show_type = $mapConfig['show_type'];
			$control_type = $mapConfig['control_type'];
			$show_scale = $mapConfig['show_scale'];
			$show_overview = $mapConfig['show_overview'];
			$init_zoom = $mapConfig['init_zoom'];
			$user_zoom = $mapConfig['user_zoom'];
			$map_center_c = $mapConfig['map_center'];
			$marker_folder = $mapConfig['marker_folder'];
			$target_folder = $mapConfig['target_folder'];
	}
// Create a new map and show Zoom slider
	$userMap = new PhoogleMap();
	$userMap->setAPIKey("$api_key");
	$userMap->setWidth("$map_width");
	$userMap->setHeight("$map_height");
	$userMap->showControl = 'true'; 
	$userMap->controlType = 'small';
	$userMap->showType = 'true';
	$userMap->showScale = 'false'; 
	$userMap->showOverview = 'false'; 
	if(!empty($map_center))
	{
		$parens = array('(',')');
		$map_center = str_replace($parens, '', $map_center);
		$userMap->centerMap = "map.setCenter(new GLatLng($map_center), $user_zoom);";
	} else 
	{
		$parens = array('(',')');
		$map_center_c = str_replace($parens, '', $map_center_c);
		$userMap->centerMap = "map.setCenter(new GLatLng($map_center_c), $user_zoom);";
	}
/**************************************************************************************************************************************/
// sql for map markers	
	$sql_map_markers = "SELECT marker_id, marker_image, marker_width, marker_height 
											FROM " . PHOOGLE_MARKERS_TABLE;
	if( !($result_map_markers = $db->sql_query($sql_map_markers)) )
	{
		message_die(GENERAL_ERROR, 'Could not query Map Markers', '', __LINE__, __FILE__, $sql_map_markers);
	}
	while ( $mapMarker = $db->sql_fetchrow($result_map_markers) )
	{		
			$mid = $mapMarker['marker_id'];
			$marker[$mid]['id'] 					= $mapMarker['marker_id'];
			$marker[$mid]['image'] 				= $marker_folder.$mapMarker['marker_image'];
			$marker[$mid]['image_width'] 	= $mapMarker['marker_width'];
			$marker[$mid]['image_height'] = $mapMarker['marker_height'];
			$marker[$mid]['filename']			= $mapMarker['marker_image'];
	
	$template->assign_vars(array(
		"MARKER_".$mid 						=> $marker[$mid]['image'],
		"MARKER_".$mid."_WIDTH" 	=> $marker[$mid]['image_width'],
		"MARKER_".$mid."_HEIGHT" 	=> $marker[$mid]['image_height'],
		"MARKER_".$mid."_NAME" 		=> $marker[$mid]['filename']
	));		
	}	
// End Phoogle Map
//
// Default pages
//
include($phpbb_root_path . 'includes/page_header.'.$phpEx);


If needed, you can pm me your usercp_register.php file and I'll have a look at it. Good luck! :D

User avatar
BassFace
Registered User
Posts: 783
Joined: Tue Dec 02, 2003 7:10 pm
Location: Aurora, CO

Re: [BETA] Phoogle (Google) Map

Post by BassFace »

raqman wrote:Hi Bass,

Hey welcome to our Forums at Italiansunited.co.uk, mamma mia :D
Checked Phoogle, but still seems to have problems, however I can see how Fraco could create problems, so I need to check if other users have the same, so my questions are two:

How did you spot that, I am baffled, unless you go down one user at a time :o

Can we take out the long lat line as it seems to confuse peopel?

thanks a million
Yeah, freddie covered the removal of the lat,long line - it has to be there, but can be hidden. As for finding bugs, I use Firefox browser with Firebug extension. It alerts you to any javascript errors:
Image
And double-clicking that shows you the offending code, in this case, the next user who didn't know what lat/long meant :D
Image

Then double click that, and it will show you the page source code, and there you will see the username associated with that map point.

So you will still need to find the problem, fix it, then go back to the map and see if there is another one, cuz the Google Map API javascript stops after the first error :(

Hope this helps!

raqman
Registered User
Posts: 51
Joined: Tue Jul 23, 2002 4:03 pm
Contact:

Re: [BETA] Phoogle (Google) Map

Post by raqman »

Hi Bass,

thanks as always, I have foudn I think all the uders, and apart from converting me to Firefox now, I see it is fixedf there, however, whilst I can see all users in Firefox, I cannot see the same in IE7.

Any ideas why that might be.

So though you have converted me to firefox for its excellent plugins, many of my users will still be IE users and I hope you can help figure this one out.

Thanks!!!

User avatar
BassFace
Registered User
Posts: 783
Joined: Tue Dec 02, 2003 7:10 pm
Location: Aurora, CO

Re: [BETA] Phoogle (Google) Map

Post by BassFace »

raqman wrote:Hi Bass,

thanks as always, I have foudn I think all the uders, and apart from converting me to Firefox now, I see it is fixedf there, however, whilst I can see all users in Firefox, I cannot see the same in IE7.

Any ideas why that might be.

So though you have converted me to firefox for its excellent plugins, many of my users will still be IE users and I hope you can help figure this one out.

Thanks!!!
Well, I can't see the problem with IE. :( Sorry about that! Glad ya liked Firefox though :)

VBDesign
Registered User
Posts: 26
Joined: Sat Mar 03, 2007 12:28 pm

Re: [BETA] Phoogle (Google) Map

Post by VBDesign »

A suggestion or several for your very excellent mod...
first off capture the user IP from an environment query...
Then use a link to http://www.geoiptool.com/en/?IP= to return a location based on IP...
then set it as the default approximate geolocation for the user in the user CP. When a new user regs, they already have a default approximate location.
Set up a radio button toggle in the user CP which defaults to use the approximate location but can be switched to use a more exact string entered by the user (or administrator)...
Then filter manual input with regex to accept only valid values and failing that, revert to the default approximate value. Everyone gets to play and no funky crashing of the map due to invalid inputs.
Maybe even make a change to the admin userCP to change the Allow selection to add Allow Default, Allow Exact? and an addition to the ACP to Allow Default geolocation by Default... Since it would be set by query rather than manually... and a query of the COPPA field that would either disable Exact or at least warn the administrator that the user was a minor (don't need some kid disappearing because they posted a map to their own house).

Make any sense?
"I asked for an assignment... and for my sins, they gave me one."

Showscout
Registered User
Posts: 31
Joined: Thu Jul 18, 2002 4:29 pm

Re: [BETA] Phoogle (Google) Map

Post by Showscout »

nice mod, thank you guys!

btw. does phoogle cache geocode requests?

--
simply embed Google Maps to your homepage

User avatar
BassFace
Registered User
Posts: 783
Joined: Tue Dec 02, 2003 7:10 pm
Location: Aurora, CO

Re: [BETA] Phoogle (Google) Map

Post by BassFace »

VBDesign wrote:A suggestion or several for your very excellent mod...
first off capture the user IP from an environment query...
Then use a link to http://www.geoiptool.com/en/?IP= to return a location based on IP...
then set it as the default approximate geolocation for the user in the user CP. When a new user regs, they already have a default approximate location.
Set up a radio button toggle in the user CP which defaults to use the approximate location but can be switched to use a more exact string entered by the user (or administrator)...
Then filter manual input with regex to accept only valid values and failing that, revert to the default approximate value. Everyone gets to play and no funky crashing of the map due to invalid inputs.
Maybe even make a change to the admin userCP to change the Allow selection to add Allow Default, Allow Exact? and an addition to the ACP to Allow Default geolocation by Default... Since it would be set by query rather than manually... and a query of the COPPA field that would either disable Exact or at least warn the administrator that the user was a minor (don't need some kid disappearing because they posted a map to their own house).

Make any sense?
Indeed. Great ideas! Knock yerself out! :D Seriously, I'm not looking to add any more features to this mod, but as it's open-source, you may feel entirely free to do whatever changes you can think of to it. If this were a commercial MOD, I'd certainly add those features you thought of, as they are very cool ideas. :ugeek:

User avatar
BassFace
Registered User
Posts: 783
Joined: Tue Dec 02, 2003 7:10 pm
Location: Aurora, CO

Re: [BETA] Phoogle (Google) Map

Post by BassFace »

Showscout wrote:nice mod, thank you guys!

btw. does phoogle cache geocode requests?

--
simply embed Google Maps to your homepage
In short, no. Long explanation follows. :D
There is no geocoding in the Phoogle MOD - location is input by pan/zooming the map around. In my first versions of the MOD, I did use the Yahoo! geocoder (Google's wasn't out yet), but international (aka non-USA) addresses were poorly supported - at least at that time. Even US addresses were hit or miss. So I removed the geocoding and just went to the pan/zoom method using the map to set user location.

I've heard the Google geocoder has come a long way since this MOD started. Maybe worth lookin at for someone wishing to extend the MOD. ;)

Doohanjoe
Registered User
Posts: 5
Joined: Mon Jul 09, 2007 8:19 pm

Re: [BETA] Phoogle (Google) Map

Post by Doohanjoe »

Hello everybody,

I was install this mod in my forum and i think that is very great and fun !!!

I love this mod, very big thanks to the author !

My problem : It's running very well with Firefox but with Internet Explorer this not function normally...

Look :

Image

Thanks for the help :)

(sorry for my grammatical mistakes, i am french :oops: )

User avatar
BassFace
Registered User
Posts: 783
Joined: Tue Dec 02, 2003 7:10 pm
Location: Aurora, CO

Re: [BETA] Phoogle (Google) Map

Post by BassFace »

Doohanjoe wrote:Hello everybody,

I was install this mod in my forum and i think that is very great and fun !!!

I love this mod, very big thanks to the author !

My problem : It's running very well with Firefox but with Internet Explorer this not function normally...

Look :

Image

Thanks for the help :)

(sorry for my grammatical mistakes, i am french :oops: )
Could you provide a link to your site? Or PM me it? That would be of great help. It may be one of your users has input their location incorrectly.

Doohanjoe
Registered User
Posts: 5
Joined: Mon Jul 09, 2007 8:19 pm

Re: [BETA] Phoogle (Google) Map

Post by Doohanjoe »

Thanks for the answer. Website link : http://lesamisdupoissonrouge.sup.fr/ (redirection to http://winnisan.free.fr)

My Phoogle Map page link : http://winnisan.free.fr/phoogle_map.php

Another notice, when i go to the ACP with Internet Explorer it's ok, i can see and surf on the map. But in phoogle_map.php en when i edit my profile it isn't ok.

Doohanjoe

pjessop
Registered User
Posts: 144
Joined: Tue Jul 10, 2007 5:40 pm
Contact:

Re: [BETA] Phoogle (Google) Map

Post by pjessop »

This looks like a great MOD, can't wait till its finished. Will it need sql editing or just php/tpl file editing as i don't have access to the sql on the hosted server? I have got ftp access to the php/tpl files

Doohanjoe
Registered User
Posts: 5
Joined: Mon Jul 09, 2007 8:19 pm

Re: [BETA] Phoogle (Google) Map

Post by Doohanjoe »

According to what I saw, you have to alter the table "phpbb_users" to add 5 fills and you have to create 2 tables "phpbb_phoogle_config" and "phpbb_phoogle_markers".

You will have sql rights to alter, create and insert.

But only with ftp... It's not possible :|

pjessop
Registered User
Posts: 144
Joined: Tue Jul 10, 2007 5:40 pm
Contact:

Re: [BETA] Phoogle (Google) Map

Post by pjessop »

This looks like a great MOD. Unfortunately for me I operate a guest board (no members). Is it easy enough to adapt so the map can be created and shown during a topic or reply post. For example if this adaptation was in place on this board, I could select a map during the post I am writing now and after it is submitted, visitors could the see my location map from this individual post, with the map appearing below the post?

As i'm writing this i'm realising that is probably a 'not very easy' adaptation.

User avatar
BassFace
Registered User
Posts: 783
Joined: Tue Dec 02, 2003 7:10 pm
Location: Aurora, CO

Re: [BETA] Phoogle (Google) Map

Post by BassFace »

pjessop wrote:This looks like a great MOD. Unfortunately for me I operate a guest board (no members). Is it easy enough to adapt so the map can be created and shown during a topic or reply post. For example if this adaptation was in place on this board, I could select a map during the post I am writing now and after it is submitted, visitors could the see my location map from this individual post, with the map appearing below the post?

As i'm writing this i'm realising that is probably a 'not very easy' adaptation.
No its not, :( I'd hoped to do that, but it's beyond me. There is another mod, I think it's called Atlas MOD, that does that. I believe it's has been abandoned by it's author though.

Post Reply

Return to “[2.0.x] MODs in Development”