[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.
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 » Fri Aug 10, 2007 5:28 am

antisa33 wrote:I have setup this great mod thanks a lot !
In my subscription form, i have the "CP" (number of the town) (postal code).
Dont you think the user could be automaticaly positionned on the map with this variable instead of doing it himself?
Thanks a lot for all!!
All is working for me
That would require geocoding, which is not supported in the MOD at this time :( Geocoding has improved a lot (apparently) since I started this MOD, but at that time it wasn't very good and caused a lot of errors, especially for non-USA addresses. As I mentioned before, I may eventually try to get geocoding back in the MOD someday. :D

volvomad
Registered User
Posts: 48
Joined: Fri May 04, 2007 7:44 pm

Re: [BETA] Phoogle (Google) Map

Post by volvomad » Mon Aug 13, 2007 12:03 am

Paul99Ev wrote: Is there any way to link to these custom events? easy to do for users by replacing the # with the relevant User id in the following:
http://www.mysite.com/forum/phooglemap.php?u=#
That link takes you to a zoomed in map with that user in,
From the code used to place the extra tag, I don't think you can link to it. One other way is to make a new member with the location name as the user name, set the phoogle map to the required location, then link to it's flag.

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

Re: [BETA] Phoogle (Google) Map

Post by raqman » Tue Aug 14, 2007 2:20 pm

Hi Bass,

I waited to post this after upgrading from 1.3 to 1.5, hoping th eprobelm would go away and this did not resolve it, seems like I am the only one that has this problem.

Basically I now have over 340 users on phoogle at http://www.italiansunited.co.uk and you can see them all in Firefox (which I now use after you taught me about the debugging system it has), but when using I.E. 7 on XP or vista, only 10 can be seen on the map.

I realise you are doing some other stuff that has high priority but was wondering if you can have a look and give me an idea what could be wrong.

Many thanks

Paul99Ev
Registered User
Posts: 33
Joined: Sat Jan 27, 2007 3:07 pm

Re: [BETA] Phoogle (Google) Map

Post by Paul99Ev » Thu Aug 16, 2007 8:10 am

volvomad wrote:
Paul99Ev wrote: Is there any way to link to these custom events? easy to do for users by replacing the # with the relevant User id in the following:
http://www.mysite.com/forum/phooglemap.php?u=#
That link takes you to a zoomed in map with that user in,
From the code used to place the extra tag, I don't think you can link to it. One other way is to make a new member with the location name as the user name, set the phoogle map to the required location, then link to it's flag.
Yep guessed that was the case, Shame as I really didnt want to go adding loads of new members just so I could provide a link :| .

Guess I will have to spend some time and try and work something out myself, would be a very useful addition, at least, it would be for us. Also been thinking about a way to add these custom markers to some sort of list as the members are but that obviously wll have to come later, Any pointers / ideas on how to go about modding this mod my knowledge of PHP is very basic at best, a point in the direction might save me a few months of trial and error :lol:

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 » Sun Aug 19, 2007 4:43 am

Paul99Ev wrote: Yep guessed that was the case, Shame as I really didnt want to go adding loads of new members just so I could provide a link :| .

Guess I will have to spend some time and try and work something out myself, would be a very useful addition, at least, it would be for us. Also been thinking about a way to add these custom markers to some sort of list as the members are but that obviously wll have to come later, Any pointers / ideas on how to go about modding this mod my knowledge of PHP is very basic at best, a point in the direction might save me a few months of trial and error :lol:
That's a tall order, unfortunately. This MOD was really designed to be a "one map entry per one user" kinda thing. It can't put maps in posts, or do events like you want it to - at least not easily. You'd need a db table for the events to be stored in, with fields that would relate to what the phoogle_class expects from a user, like a name, lat/long, what icon to use, comment, etc. Then you'd need to get the phoogle_map page to read that db table and add each entry to the array of users that it currently sends to google for the API to map (or create a seperate events map with no users on it). You could either enter in the events manually (into the db) or create an event entry form to manage them and perform add/edit/delete actions. Lots to do, eh? :(

Paul99Ev
Registered User
Posts: 33
Joined: Sat Jan 27, 2007 3:07 pm

Re: [BETA] Phoogle (Google) Map

Post by Paul99Ev » Sun Aug 19, 2007 7:22 pm

BassFace wrote:
Paul99Ev wrote: Yep guessed that was the case, Shame as I really didnt want to go adding loads of new members just so I could provide a link :| .

Guess I will have to spend some time and try and work something out myself, would be a very useful addition, at least, it would be for us. Also been thinking about a way to add these custom markers to some sort of list as the members are but that obviously wll have to come later, Any pointers / ideas on how to go about modding this mod my knowledge of PHP is very basic at best, a point in the direction might save me a few months of trial and error :lol:
That's a tall order, unfortunately. This MOD was really designed to be a "one map entry per one user" kinda thing. It can't put maps in posts, or do events like you want it to - at least not easily. You'd need a db table for the events to be stored in, with fields that would relate to what the phoogle_class expects from a user, like a name, lat/long, what icon to use, comment, etc. Then you'd need to get the phoogle_map page to read that db table and add each entry to the array of users that it currently sends to google for the API to map (or create a seperate events map with no users on it). You could either enter in the events manually (into the db) or create an event entry form to manage them and perform add/edit/delete actions. Lots to do, eh? :(
Thanks for the pointers Bassface, I guessed that a separate table was about the only way to go :| I had a quick play managed to get the phooglemap.php to recall the locations from such a table and display it on a separate map (with no users on) Need to play around with getting this working with the exsisting map (with the users) but so far, I've not had much luck with that. I'll keep on working on it and I'm sure eventually I'll get something usable. Will keep you updated on the progress (or lack of :lol:)
Paul.

volvomad
Registered User
Posts: 48
Joined: Fri May 04, 2007 7:44 pm

Re: [BETA] Phoogle (Google) Map

Post by volvomad » Tue Aug 21, 2007 7:54 am

I'd be interested in seeing the outcome of this as I could do with the separate events map. The separate db and map page seems the easiest route to take.

Paul99Ev
Registered User
Posts: 33
Joined: Sat Jan 27, 2007 3:07 pm

Re: [BETA] Phoogle (Google) Map

Post by Paul99Ev » Tue Aug 21, 2007 8:06 pm

Well I've made a litle progress with this, Thought i'd put up what I have got so far, if nothing else to keep a record of what I've changed, my memory isn't great.

As suggested I've made a second table to hold the places of interest:

Code: Select all

CREATE TABLE `phpbb_phoogle_poi` (
`user_id` mediumint(8) NOT NULL,
`username` varchar(25) NOT NULL,
`user_phoogle_map_center` varchar(255) NOT NULL,
`user_phoogle_comment` TEXT,
`user_phoogle_icon` tinyint(3) unsigned NOT NULL default '1',
`user_phoogle_allow` tinyint(1) unsigned NOT NULL default '1',
`user_phoogle_show_me` tinyint(1) unsigned NOT NULL default '0',
`group_id mediumint`(8) DEFAULT '0' NOT NULL,
`user_level tinyint(4) DEFAULT '0',
`user_allowavatar tinyint(1) DEFAULT '1' NOT NULL,
`user_avatar_type tinyint(4) DEFAULT '0' NOT NULL,
`user_rank int(11) DEFAULT '0',
`user_avatar varchar(100),
PRIMARY KEY  (`user_phoogle_map_center`)
);
I added a test place of interest to this new table via phpMyAdmin then set about trying to get phooglemap to call the POI's from both the Users table and this new POI table:

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
phoogle_map.php
#
#-----[ FIND ]------------------------------------------
#
// sql for members with map points set in the selected user group
		$sql_all_members = "SELECT ug.user_id, ug.group_id, u.username, u.user_level, u.user_rank, u.user_avatar_type, u.user_allowavatar, u.user_avatar, u.user_phoogle_map_center, u.user_phoogle_comment, u.user_phoogle_icon, u.user_phoogle_show_me
		FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug
		WHERE ug.group_id = $group_id AND
		u.user_id = ug.user_id AND
		u.user_phoogle_allow = 1 AND
		u.user_phoogle_show_me = 1
		ORDER BY u.username";
#
#-----[ REPLACE WITH ]------------------------------------------
#
// sql for members with map points set in the selected user group
		$sql_all_members = "SELECT ug.user_id, ug.group_id, u.username, u.user_level, u.user_rank, u.user_avatar_type, u.user_allowavatar, u.user_avatar, u.user_phoogle_map_center, u.user_phoogle_comment, u.user_phoogle_icon, u.user_phoogle_show_me
		FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug
		WHERE ug.group_id = $group_id AND
		u.user_id = ug.user_id AND
		u.user_phoogle_allow = 1 AND
		u.user_phoogle_show_me = 1
                UNION
                SELECT user_id, group_id, username, user_level, user_rank, user_avatar_type, user_allowavatar, user_avatar, user_phoogle_map_center, user_phoogle_comment, user_phoogle_icon, user_phoogle_show_me
		FROM " . PHPBB_PHOOGLE_POI . "
		WHERE group_id = $group_id AND
		user_phoogle_allow = 1 AND
		user_phoogle_show_me = 1
		ORDER BY username";
#
#-----[ FIND ]------------------------------------------
#
// Regular sql for members with map points set - used for 'Show All Users' map and for sidebar list
		$sql_all_members = "SELECT user_id, username, user_level, user_rank, user_avatar_type, user_allowavatar, user_avatar, user_phoogle_map_center, user_phoogle_comment, user_phoogle_icon, user_phoogle_show_me
			FROM " . USERS_TABLE . "
			WHERE user_id <> " . ANONYMOUS ." AND
			user_phoogle_allow = 1 AND
			user_phoogle_show_me = 1
			ORDER BY username
			LIMIT $start, $show";
#
#-----[ REPLACE WITH ]------------------------------------------
#
// Regular sql for members with map points set - used for 'Show All Users' map and for sidebar list
		$sql_all_members = "SELECT user_id, username, user_phoogle_map_center, user_phoogle_comment, user_phoogle_icon, user_phoogle_show_me, user_level
			FROM " . USERS_TABLE . "
                        WHERE user_id <> " . ANONYMOUS ." AND
			user_phoogle_allow = 1 AND
			user_phoogle_show_me = 1
                        UNION
                        SELECT user_id, username, user_phoogle_map_center, user_phoogle_comment, user_phoogle_icon, user_phoogle_show_me, user_level
			FROM " . PHPBB_PHOOGLE_POI . "
                        WHERE user_id <> " . ANONYMOUS ." AND
			user_phoogle_allow = 1 AND
			user_phoogle_show_me = 1
			ORDER BY username
			LIMIT $start, $show";
#
#-----[ EOM ]------------------------------------------
#
That code seems to work in recalling locations from both the tables, it probably isn't how it should be done, infact it's probably a very poor way to do it (but knowing only VERY basic SQL and PHP and seemed to be the only way I could get it to work, I'm not clever enough to work out a better way :lol: )

I haven't yet tried to get the User search working with both tables.

Now I need to be able to toggle the custom POI's (from the new table)
After a few hours of playing I somehow stumbled upon this:

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
phooglemap.php
#
#-----[ FIND ]------------------------------------------
#
// Added marker type for Show/Hide groups feature.
	switch($user_level)
	{
		case ADMIN:
			$user_phoogle_icon = ($use_special_markers == 1) ? '11' : $members['user_phoogle_icon'];
			$marker_group = 'admin';
			break;
		case MOD:
			$user_phoogle_icon = ($use_special_markers == 1) ? '12' : $members['user_phoogle_icon'];
			$marker_group = 'moderator';
			break;
		default:
			$user_phoogle_icon = $members['user_phoogle_icon'];
			$marker_group = 'user';
	}
#
#-----[ REPLACE WITH ]------------------------------------------
#
// Added marker type for Show/Hide groups feature.
	switch($user_level)
	{
                case ADMIN:
			$user_phoogle_icon = ($use_special_markers == 1) ? '11' : $members['user_phoogle_icon'];
			$marker_group = 'admin';
			break;
		case MOD:
			$user_phoogle_icon = ($use_special_markers == 1) ? '12' : $members['user_phoogle_icon'];
			$marker_group = 'moderator';
			break;
                case USER:
			$user_phoogle_icon = $members['user_phoogle_icon'];
			$marker_group = 'user';
			break;
		default:
			$user_phoogle_icon =($use_special_markers == 1) ? '9' : $profiledata['user_phoogle_icon'];
			$marker_group = 'fisheries';
	}
#
#-----[ OPEN ]------------------------------------------
#
phoogle_map.tpl
#
#-----[FIND ]------------------------------------------
#
<label>
			<input name="show_user" type="checkbox" onclick="toggleGroup('user');" checked />Users</label>
#
#-----[AFTER ADD]------------------------------------------
#
<label>
			<input name="show_user" type="checkbox" onclick="toggleGroup('CUSTOM POI's');" checked />CUSTOM POI's</label>
#
#-----[EOM]------------------------------------------
#
So Far that is all I have, I hope I have put all the changes Ive made so far, but having spent so much time changing a bit then testing it before chaning it again I could have missed a bit here by accident, don't think I have but sorry just in case I have :lol:

Obviously this is far from a solution to adding custom markers that you can link directly too (as I havent even looked at linking to the custom POI's from the new table yet) but its a start.

The one thing I could do with some advice on, as I've been trying to work it out but can't:

1. How to hide the Admin's markers by default but when you click on the Show Admin box they appear rather than them being on by default and having to click to hide them.
Last edited by Paul99Ev on Sat Sep 01, 2007 12:10 pm, edited 1 time in total.

volvomad
Registered User
Posts: 48
Joined: Fri May 04, 2007 7:44 pm

Re: [BETA] Phoogle (Google) Map

Post by volvomad » Tue Aug 21, 2007 9:16 pm

Paul99Ev wrote: The one thing I could do with some advice on, as I've been trying to work it out but can't:

1. How to hide the Admin's markers by default but when you click on the Show Admin box they appear rather than them being on by default and having to click to hide them.
Simple (I noticed the command in your code above!):

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
phoogle_map.tpl
#
#-----[FIND ]------------------------------------------
#
<label>
			<input name="show_admin" type="checkbox" onclick="toggleGroup('admin');" checked />Admins</label>
#
#-----[REPLACE WITH]------------------------------------------
#
<label>
			<input name="show_admin" type="checkbox" onclick="toggleGroup('admin');" />Admins</label>
#
Hey, my first crack at modding! The "checked" command means that the default admin checkbox is ticked. Remove it, and voila!

Paul99Ev
Registered User
Posts: 33
Joined: Sat Jan 27, 2007 3:07 pm

Re: [BETA] Phoogle (Google) Map

Post by Paul99Ev » Tue Aug 21, 2007 9:30 pm

volvomad wrote:
Paul99Ev wrote: The one thing I could do with some advice on, as I've been trying to work it out but can't:

1. How to hide the Admin's markers by default but when you click on the Show Admin box they appear rather than them being on by default and having to click to hide them.
Simple (I noticed the command in your code above!):

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
phoogle_map.tpl
#
#-----[FIND ]------------------------------------------
#
<label>
			<input name="show_admin" type="checkbox" onclick="toggleGroup('admin');" checked />Admins</label>
#
#-----[REPLACE WITH]------------------------------------------
#
<label>
			<input name="show_admin" type="checkbox" onclick="toggleGroup('admin');" />Admins</label>
#
Hey, my first crack at modding! The "checked" command means that the default admin checkbox is ticked. Remove it, and voila!
Lol not quite so simple, I tried that and as you say the checkbox now becomes unchecked, but the markers are still on the map, all that does is reverse the function of the checkbox, ie when its unticked the markers show and then when you tick it the markers dissapear. Its a bit strange, hence why I'm a bit stumped.
Thanks for the suggestion though
Paul

volvomad
Registered User
Posts: 48
Joined: Fri May 04, 2007 7:44 pm

Re: [BETA] Phoogle (Google) Map

Post by volvomad » Tue Aug 21, 2007 10:13 pm

Rumaging around I notice that the togglegroup function in includes/phpbb_phoogle_class.php appears to set the default for the groups:

Code: Select all

function toggleGroup(whichType) 
{
	for (var i = 0; i < sbmarkers.length; i++) 
	{
		var marker = sbmarkers[i];
		if(sbmarkers[i].type == whichType)
		{
			if (marker.isHidden()) 
			{
				marker.show();
			} 
			else 
			{
				marker.hide();
			}
		}
	}
}
Maybe something can be done there to define each groups default status?

Paul99Ev
Registered User
Posts: 33
Joined: Sat Jan 27, 2007 3:07 pm

Re: [BETA] Phoogle (Google) Map

Post by Paul99Ev » Thu Aug 23, 2007 7:36 pm

volvomad wrote:Rumaging around I notice that the togglegroup function in includes/phpbb_phoogle_class.php appears to set the default for the groups:

Code: Select all

function toggleGroup(whichType) 
{
	for (var i = 0; i < sbmarkers.length; i++) 
	{
		var marker = sbmarkers[i];
		if(sbmarkers[i].type == whichType)
		{
			if (marker.isHidden()) 
			{
				marker.show();
			} 
			else 
			{
				marker.hide();
			}
		}
	}
}
Maybe something can be done there to define each groups default status?
I've looked at this bit of code myself a few times but it deals only with the toggle on and off, The more I look at it Its the code which creates the user list that needs altering somehow so that the markers aren't displayed until you ask them to be. I've tried a few things but so far havent even come close.

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 » Fri Aug 24, 2007 4:14 am

1. How to hide the Admin's markers by default but when you click on the Show Admin box they appear rather than them being on by default and having to click to hide them.
I don't quite follow what you would like to do here. If you want to hide your marker, can't you turn yourself off in your profile? Or do I misunderstand what you are wanting to do? :?

volvomad
Registered User
Posts: 48
Joined: Fri May 04, 2007 7:44 pm

Re: [BETA] Phoogle (Google) Map

Post by volvomad » Fri Aug 24, 2007 8:06 am

Currently, when you go to the phoogle map, all user group markers are on by default. What he wants is for the admins markers to be hidden by default, but still have the toggle working.
i.e. when you open the map, the "show group" check boxes are at the following status:

admin = unticked (markers hidden), moderators = ticked (markers showing), users = ticked (markers showing)

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

Re: [BETA] Phoogle (Google) Map

Post by raqman » Fri Aug 24, 2007 8:34 am

apologies of asking this again on this topic, but am I the only one that sees all markers in Firefox but in I.E 7 90% of them are missing?

If this is the case, then I guess it must be a problem at my end.

Thanks

Post Reply

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