[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.
modbo
Registered User
Posts: 45
Joined: Wed Jan 12, 2005 10:26 am

Re: [BETA] Phoogle (Google) Map

Post by modbo »

BassFace wrote:Yes, setting the height with a percentage really doesn't work. This is true for all <div> containers, actually. I would recommend using a set px setting for the height - width should work with either a px or a %.
Ok, but as an example using width 100% and height 480px the map in ACP doesn`t work correct too.
BassFace wrote:I will try to make some updates to the phpBB2 version next week and release a new version.
Fine. :)
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 »

modbo wrote: Ok, but as an example using width 100% and height 480px the map in ACP doesn`t work correct too.
I'll take a look again this week.
User avatar
Savigny
Registered User
Posts: 7
Joined: Sun Mar 23, 2008 1:42 am

Re: [BETA] Phoogle (Google) Map

Post by Savigny »

Hi,

I'm looking for a german language pack (especially the formal one) for Phoogle for the phpBB Version 2.0.x. I read somewhere here in the forum, that there should be a pack in the contrib-folder, but there isn't that folder in the zip-File of version 1.0.5 (maybe it was for phpBB 3.0 ?).

Does anyone got an idea, where I can get it?
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 »

Savigny wrote:Hi,

I'm looking for a german language pack (especially the formal one) for Phoogle for the phpBB Version 2.0.x. I read somewhere here in the forum, that there should be a pack in the contrib-folder, but there isn't that folder in the zip-File of version 1.0.5 (maybe it was for phpBB 3.0 ?).

Does anyone got an idea, where I can get it?
That was referring to version 3 of phpBB. Sorry, but there isn't a German translation that I know of for v2. :(
User avatar
Savigny
Registered User
Posts: 7
Joined: Sun Mar 23, 2008 1:42 am

Re: [BETA] Phoogle (Google) Map- German Translation

Post by Savigny »

Thank you for your quick answer - and of course for your work on the mod Image
(o.k., it should be a "c" instead of a "k" in english, I know that :) )
BassFace wrote:Sorry, but there isn't a German translation that I know of for v2.
So I will translate it by myself. Should I post it here for common use?
raqman
Registered User
Posts: 51
Joined: Tue Jul 23, 2002 4:03 pm
Contact:

Re: [BETA] Phoogle (Google) Map

Post by raqman »

Hi

(had a look and cant seem to see if this has been asked before).

I began to notice users moving about on phoogle and checked why this was happening.

Basically, when a user goes to edit his profile and then scrolls down with the scroll button, the moment he passes the phoogle part, where if by chance the mouse symbol crosses the map, this actually zooms out the map, the user realises it does not scroll down anymore, moves the mouse then reaches the bottom and in most cases or does not realises what they have done or cannot be bothered to place the marker back to position.

So I guess my question is, is there a way to delete the scroll through the mouse functionality?

Many thanks

P.S. My previous problem on phoogle with i.e. has been resolved.

This was due to even the smallest error being picked up by i.e. that would not allow phoogle to be displayed properly and the only way to fix it is to go one by one each user.
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:So I guess my question is, is there a way to delete the scroll through the mouse functionality?
Open phpbb_phoogle_class.php
FIND AND DELETE

Code: Select all

map.enableScrollWheelZoom();
Curryking
Registered User
Posts: 11
Joined: Mon Jun 27, 2005 2:02 am
Location: Germany
Contact:

Re: [BETA] Phoogle (Google) Map

Post by Curryking »

Feature Request: Whats about adding a Link to the "Location Info" in the profile and in the viewtopic-view to the location of the specified person in Phoogle-Map (if he has linked his location in the profile). I guess this would be great. Nevertheless, and awesome phpBB-Addon/Hack/Feature. Well done BassFace and many thanks for all your effort and time...

Image

Cheers, Curry
"It is a sad fact that, regardless of effort or talent, second place really means that you are first in a long line of losers."
xervas
Registered User
Posts: 3
Joined: Fri Apr 25, 2008 3:16 pm

Re: [BETA] Phoogle (Google) Map

Post by xervas »

hello,

i have build in your phoogle map 1.0.5 in my forum.
in the acp and in the profil it works perfect.
but on klick on the phoogle map link teh page is on the left empty and at the right the userlist.

i have make a picture so you can see what i mean
Image

i'm german and my english is not the best.

my forum is a orion (http://www.cback.de) it is a phpbb2 2.0.22

mfg
xervas
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 »

xervas wrote:hello,

i have build in your phoogle map 1.0.5 in my forum.
in the acp and in the profil it works perfect.
but on klick on the phoogle map link teh page is on the left empty and at the right the userlist.

i have make a picture so you can see what i mean
Image

i'm german and my english is not the best.

my forum is a orion (http://www.cback.de) it is a phpbb2 2.0.22

mfg
xervas
It is most likely a problem with one of the map markers. Copy and paste your map page source code here and I'll take a look at it.
xervas
Registered User
Posts: 3
Joined: Fri Apr 25, 2008 3:16 pm

Re: [BETA] Phoogle (Google) Map

Post by xervas »

hello,

you mean the phoogle_map.php?

Code: Select all

<?php
/***************************************************************************
 *                           phoogle_map.php
 *                     for phpbb phoogle map MOD v1.0.5
 *                         -------------------
 *   begin                : Friday, December 29, 2006
 *   copyright            : (C) 2006 BassFace
 *   email                : [email protected]
 *
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *
 ***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

// Bring in phoogle class
include($phpbb_root_path . 'includes/phpbb_phoogle_class.'.$phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_PHOOGLE);
init_userprefs($userdata);
//
// End session management
//

// session id check
if (!empty($HTTP_POST_VARS['sid']) || !empty($HTTP_GET_VARS['sid']))
{
	$sid = (!empty($HTTP_POST_VARS['sid'])) ? $HTTP_POST_VARS['sid'] : $HTTP_GET_VARS['sid'];
}
else
{
	$sid = '';
}

if ( !defined('IN_PHPBB') )
{
	die("Hacking attempt");
	exit;
}
// Registered users only can see map
if ( !$userdata['session_logged_in'] || $userdata['user_id'] == ANONYMOUS )
{
redirect(append_sid("login.".$phpEx."?redirect=phoogle_map.".$phpEx, true));
exit;
}
// Start Phoogle Map ============================================================================================================================
// Create a new map
	$myMap = new PhoogleMap();

// sql for map config params
	$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);
	}

// iterate through the config results to set map params
	while ( $mapConfig = $db->sql_fetchrow($result_map_config) )
	{
		$map_type = $mapConfig['map_type'];
		$width = $mapConfig['map_width'];
		$width_measure = $mapConfig['width_measure'];
		$height = $mapConfig['map_height'];
		$height_measure = $mapConfig['height_measure'];
		$api_key = $mapConfig['api_key'];
		$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'];
		$zoom_limit = $mapConfig['zoom_limit'];
		$map_center = $mapConfig['map_center'];
		$use_special_markers = $mapConfig['use_special_markers'];
		$marker_folder = $mapConfig['marker_folder'];
		$default_show = $mapConfig['default_show'];
	}

// We're done with config results, so clear them	
	$db->sql_freeresult($result_map_config);

// Now let's turn config values from local vars into the class vars
	$myMap->setAPIKey("$api_key");
	$myMap->setWidth("$width");
	$myMap->setHeight("$height");
	$myMap->zoomLimit = $zoom_limit;
	$myMap->showControl = $show_control; 
	$myMap->controlType = $control_type;
	$myMap->showType = $show_type;
	$myMap->showScale = $show_scale; 
	$myMap->showOverview = $show_overview; 

// sql for map marker icons
	$sql_map_markers = "SELECT * 
		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);
	}

// iterate through the marker results and create array
	while ( $mapMarker = $db->sql_fetchrow($result_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]['anchor_x'] = $mapMarker['marker_x'];
		$marker[$mid]['anchor_y'] = $mapMarker['marker_y'];
		$marker[$mid]['shadow'] = $marker_folder.$mapMarker['shadow_image'];
		$marker[$mid]['shadow_width'] = $mapMarker['shadow_width'];
		$marker[$mid]['shadow_height'] = $mapMarker['shadow_height'];
	}
// We're done with map marker results, so clear them	
	$db->sql_freeresult($result_markers);

// Send array of markers into the class	
	$myMap->customMarker = $marker; 

// Get list of user_groups
$sql_groups = "SELECT group_id, group_name 
		FROM " . GROUPS_TABLE . "
		WHERE group_single_user != 1  
		ORDER BY group_name";

	if( !($result_groups = $db->sql_query($sql_groups)) )
	{
		message_die(GENERAL_ERROR, 'Could not query User Groups', '', __LINE__, __FILE__, $sql_groups);
	}
	$group_select_box = '<select name="group_select" id="group_select" class="post" onChange="location.href=this.value;">';
	$group_select_box .= '<option selected="selected" disabled="disabled">Pick a Group</option>';	
	while($groups = $db->sql_fetchrow($result_groups))
	{
		$group_name = $groups['group_name'];
		$group_id = $groups['group_id'];
		// Attempt for heading display of group name
		$group_names[$group_id] = $group_name;
		$group_select_box .= "<option value=\"phoogle_map.php?group_id=$group_id\">$group_name</option>";	
	}
	$group_select_box .= '</select>';	

// PAGINATION
// get starting position
//
$start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) : 0;

// PAGINATION
// get show amount from Phoogle map config or from user if set
//
if ( isset($HTTP_GET_VARS['show']) || isset($HTTP_POST_VARS['show']) )
{
	$show = ( isset($HTTP_POST_VARS['show']) ) ? intval($HTTP_POST_VARS['show']) : intval($HTTP_GET_VARS['show']);
}
else
{
	$show = $default_show;
}
	
/* /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
// This code block generates the maps that show multiple users - from the link in the header and 'All Members' link in sidebar       /
// and from the User Group select box                                                                                                /
/* /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
if ( empty($HTTP_GET_VARS[POST_USERS_URL]) && empty($HTTP_POST_VARS['Search']) ) 
{
// This point is always the first point (used to center the map but does not display a map marker).
// Map Types: G_NORMAL_MAP, G_SATELLITE_MAP, G_HYBRID_MAP
	$myMap->centerMap = "map.setCenter(new GLatLng($map_center), $init_zoom, $map_type);"; 

	// If asking for User Group display, use this query
	if ( isset($HTTP_GET_VARS['group_id']) )
	{
		$group_id = intval($HTTP_GET_VARS['group_id']);
		// Assign the Group Name to the Username spot for display in the Map Header
		$template->assign_vars(array(
			'L_PHOOGLE_USERNAME' => ": ".$group_names[$group_id])
			);	
		// 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";
	
		if( !($result_all_members = $db->sql_query($sql_all_members)) )
		{
			message_die(GENERAL_ERROR, 'Could not query Group Members', '', __LINE__, __FILE__, $sql_all_members);
		}
	
	}
	else
	{
		// 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";
	
		if( !($result_all_members = $db->sql_query($sql_all_members)) )
		{
			message_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql_all_members);
		}

	}

// iterate through the results to display members with map points set	
	while ( $members = $db->sql_fetchrow($result_all_members))
	{
		$username = $members['username'];
		$user_id = $members['user_id'];
		$user_level = $members['user_level'];
		$parens = array('(',')');
		$user_phoogle_map_center = str_replace($parens, "", $members['user_phoogle_map_center']);
		// get this user's avatar
		$user_avatar_type = $members['user_avatar_type'];
		$user_allowavatar = $members['user_allowavatar'];
		$user_avatar = $members['user_avatar'];	
		if ( $members['user_avatar_type'] && $members['user_allowavatar'] )
		{
			// get max avatar sizes from board_config or just set to 100 to put in <img> tag 
			$av_width = ( !empty( $board_config['avatar_max_width'] ) && !empty( $board_config['avatar_max_height'] ) ) ? intval( $board_config['avatar_max_width'] ) : '100';
			$av_height = ( !empty( $board_config['avatar_max_width'] ) && !empty( $board_config['avatar_max_height'] ) ) ? intval( $board_config['avatar_max_height'] ) : '100';
			switch( $members['user_avatar_type'] )
			{
				case USER_AVATAR_UPLOAD:
				$user_avatar = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $board_config['avatar_path'] . '/' . $members['user_avatar'] . '" width="'.$av_width.'" height="'.$av_height.'" alt="" border="0" />' : '';
				break;
				case USER_AVATAR_REMOTE:
				$user_avatar = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $members['user_avatar'] . '" width="'.$av_width.'" height="'.$av_height.'" alt="" border="0" />' : '';
				break;
				case USER_AVATAR_GALLERY:
				$user_avatar = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $members['user_avatar'] . '" width="'.$av_width.'" height="'.$av_height.'" alt="" border="0" />' : '';
				break;
			}
		}
		
	$user_avatar = addslashes(html_entity_decode($user_avatar));	
// end avatar section				
			
// Now deal with each user's selected icon and what to do if they are an admin or a moderator
// Within each case is what to do if 'Use Special Markers' is selected or not in the ACP.
// 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';
	}

// User's map bubble comment is dealt with here

	$rep = array("\n","\r","<br /><br />"); // $rep is used to make the comment-text safe for output to a javascript string
	$user_phoogle_comment = str_replace($rep, "<br />", $members['user_phoogle_comment']);
	$user_phoogle_comment = addslashes(html_entity_decode($user_phoogle_comment));
	$user_phoogle_comment = ereg_replace("<img[^>]*>", '', $user_phoogle_comment);
	$comment_length = strlen($user_phoogle_comment);

// Build Profile image/link - to be put in 2nd tab of user's Comment bubble		
	$temp_url = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id");
	$profile_img = "<a href=\"" . $temp_url . "\"><img src=\"" . $images['icon_profile'] . "\" alt=\"" . $lang['Read_profile'] . "\" title=\"" . $lang['Read_profile'] . "\" border=\"0\" /></a>";
	$profile_img = addslashes($profile_img);
		
// Build PM image/link - to be put in 2nd tab of user's Comment bubble
	$temp_url = append_sid("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=$user_id");
	$pm_img = "<a href=\"" . $temp_url . "\"><img src=\"" . $images['icon_pm'] . "\" alt=\"" . $lang['Send_private_message'] . "\" title=\"" . $lang['Send_private_message'] . "\" border=\"0\" /></a>";
	$pm_img = addslashes($pm_img);

// Assemble comment-bubble tab contents

// 1st tab		
	$tab[] = "$user_avatar";

//2nd tab - If comment is too long (over 100 chars), add a scrollbar and use CSS class with a smaller font size (at least in subSilver).
	if($comment_length > 100)
	{
		$tab[] = "<div style='width:260px; height:90; margin-top:10px; overflow:auto' class='phoogleComment'>$user_phoogle_comment</div>$pm_img&nbsp;&nbsp;$profile_img";
	}
	else
	{
		$tab[] = "<div class='phoogleComment'>$user_phoogle_comment</div>$pm_img&nbsp;&nbsp;$profile_img";	
	}

// this sends each user's map point (lat,long), comment and icon choice to the map, then clears the $tab var for use by the next loop
		$myMap->addGeoPointTabbed($user_phoogle_map_center, $user_phoogle_icon, $tab, $username, $marker_group);
		unset($tab);
	}	
}

/*/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
** This code block generates the map for viewing individual user's maps - 
** from the buttons in the user's Profile page and below user's posts or a username search result.
**///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
if( isset($HTTP_GET_VARS[POST_USERS_URL]) || isset($HTTP_POST_VARS['Search']) ) 
{	
	// Search result map, from Search form on page.
	if(isset($HTTP_POST_VARS['Search']))
	{
	$user_search = phpbb_clean_username( $HTTP_POST_VARS['user_search'] );
	$sql_search_member = "SELECT *
		FROM " . USERS_TABLE .  
		" WHERE username = '$user_search'";

		if( !($result_search_member = $db->sql_query($sql_search_member)) )
		{
			message_die(GENERAL_ERROR, 'Could not find user '.$user_search, '', __LINE__, __FILE__, $sql_search_member);
		}
		while ( $found_member = $db->sql_fetchrow($result_search_member))
		{
			$member = $found_member['user_id'];
		}
	$profiledata = get_userdata( intval($member));
	}
	// Individual user map, from Profile and Posts buttons
	else{
	$profiledata = get_userdata( intval( $HTTP_GET_VARS[POST_USERS_URL] ));
	}
	if (!$profiledata)
	{
		message_die(GENERAL_MESSAGE, $lang['No_user_id_specified']);
	}
	$myMap->zoomLevel=$user_zoom;

// get specified user's info from $profiledata function above
		$username = $profiledata['username'];
		$user_id = $profiledata['user_id'];
		$user_level = $profiledata['user_level'];
		$parens = array('(',')');
		$user_phoogle_map_center = str_replace($parens, '', $profiledata['user_phoogle_map_center']);

// If user is ALLOWED to be shown, and wants to be show, show it	
	if( $profiledata['user_phoogle_allow']  && $profiledata['user_phoogle_show_me'] )
	{
		// attempt to get avatar
		$user_avatar_type = $profiledata['user_avatar_type'];
		$user_allowavatar = $profiledata['user_allowavatar'];
		$user_avatar = $profiledata['user_avatar'];	
		if ( $profiledata['user_avatar_type'] && $profiledata['user_allowavatar'] )
		{
			// get max avatar sizes from board_config or just set to 100 to put in <img> tag 
			$av_width = ( !empty( $board_config['avatar_max_width'] ) && !empty( $board_config['avatar_max_height'] ) ) ? intval( $board_config['avatar_max_width'] ) : '100';
			$av_height = ( !empty( $board_config['avatar_max_width'] ) && !empty( $board_config['avatar_max_height'] ) ) ? intval( $board_config['avatar_max_height'] ) : '100';
			switch( $profiledata['user_avatar_type'] )
			{
				case USER_AVATAR_UPLOAD:
				$user_avatar = ( $board_config['allow_avatar_upload'] ) ? '<img src="' . $board_config['avatar_path'] . '/' . $profiledata['user_avatar'] . '" width="'.$av_width.'" height="'.$av_height.'" alt="" border="0" />' : '';
				break;
				case USER_AVATAR_REMOTE:
				$user_avatar = ( $board_config['allow_avatar_remote'] ) ? '<img src="' . $profiledata['user_avatar'] . '" width="'.$av_width.'" height="'.$av_height.'" alt="" border="0" />' : '';
				break;
				case USER_AVATAR_GALLERY:
				$user_avatar = ( $board_config['allow_avatar_local'] ) ? '<img src="' . $board_config['avatar_gallery_path'] . '/' . $profiledata['user_avatar'] . '" width="'.$av_width.'" height="'.$av_height.'" alt="" border="0" />' : '';
				break;
			}
		}
		$user_avatar = addslashes(html_entity_decode($user_avatar));	
// end avatar section				

		$rep = array("\n","\r","<br /><br />");
		$user_phoogle_comment = str_replace($rep, '<br />', $profiledata['user_phoogle_comment']);
		$user_phoogle_comment = addslashes(html_entity_decode($user_phoogle_comment));
		$user_phoogle_comment = ereg_replace("<img[^>]*>", '', $user_phoogle_comment);
		$comment_length = strlen($user_phoogle_comment);

// Now deal with user's selected icon and what to do if they are an admin or a moderator
// Within each case is what to do if 'Use Special Markers' is selected or not in the ACP.
		switch($user_level) 
		{
			case ADMIN:
				$user_phoogle_icon = ($use_special_markers == 1) ? '11' : $profiledata['user_phoogle_icon'];
				$marker_group = 'admin';
				break;
			case MOD:
				$user_phoogle_icon = ($use_special_markers == 1) ? '12' : $profiledata['user_phoogle_icon'];
				$marker_group = 'moderator';
				break;
			default:
				$user_phoogle_icon = $profiledata['user_phoogle_icon'];
				$marker_group = 'user';
		}
		
    // Build Profile image/link - to be put in 2nd tab of user's Comment bubble      
          $temp_url = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id");
          $profile_img = "<a href=\"" . $temp_url . "\"><img src=\"" . $images['icon_profile'] . "\" alt=\"" . $lang['Read_profile'] . "\" title=\"" . $lang['Read_profile'] . "\" border=\"0\" /></a>";
          $profile_img = addslashes($profile_img);
          
    // Build PM image/link - to be put in 2nd tab of user's Comment bubble
          $temp_url = append_sid("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=$user_id");
          $pm_img = "<a href=\"" . $temp_url . "\"><img src=\"" . $images['icon_pm'] . "\" alt=\"" . $lang['Send_private_message'] . "\" title=\"" . $lang['Send_private_message'] . "\" border=\"0\" /></a>";
          $pm_img = addslashes($pm_img);
		
// Assemble tab contents

// 1st tab		
	$tab[] = "$user_avatar";
	
//2nd tab - 
	if($comment_length > 100)
	{
		$tab[] = "<div style='width:260px; height:80; overflow:auto' class='phoogleComment'>$user_phoogle_comment</div>$pm_img&nbsp;&nbsp;$profile_img";
	}
	else
	{
		$tab[] = "<div class='phoogleComment'>$user_phoogle_comment</div>$pm_img&nbsp;&nbsp;$profile_img";	
	}
		
		$template->assign_vars(array(
			'L_PHOOGLE_USERNAME' => ": " . $username )
			);
			
// Set selected user's map point
		$myMap->addGeoPointTabbed($user_phoogle_map_center, $user_phoogle_icon, $tab, $username, $marker_group);
		unset($tab);
}	

// If user is NOT ALLOWED to be shown, show 'Not Allowed' text.
	else if( !$profiledata['user_phoogle_allow'] )
	{
		$template->assign_vars(array(
			'L_PHOOGLE_USERNAME' => ": ".$username . $lang['Phoogle_Not_Allowed'])
			);
		$myMap->centerMap = "map.setCenter(new GLatLng($map_center), $init_zoom);"; 
	}
	
// If user is ALLOWED to be shown, and DOES NOT want to be show,  show 'No Show' text.	
	else if( !$profiledata['user_phoogle_show_me'] )
	{
		$template->assign_vars(array(
			'L_PHOOGLE_USERNAME' => ": ".$username . $lang['Phoogle_No_Show'])
			);
		$myMap->centerMap = "map.setCenter(new GLatLng($map_center), $init_zoom);"; 		
	}
	
// iterate through the results to display members with map points set
	
	while ( $members = $db->sql_fetchrow($result_all_members) )
	{
		$username = $members['username'];
		$user_id = $members['user_id'];
	}		
}

// Everything below is used for both maps.

/*/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
** Userlist / Sidebar 
**///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
// set vars for user list (sidebar)
	$phoogleList = '';
	$member_count = $db->sql_numrows($result_all_members);
	
// Reset internal row pointer back to the beginning of $result_all_members
	@$db->sql_rowseek(0, $result_all_members);	

// Now build the list
// new increment counter for js click  function
$j = 0;

// Start with the all users link
	$phoogleList = '<a href="phoogle_map.php"><span style="color:#' . $theme['fontcolor1'] . '">'.$lang['Phoogle_All_Members'].'</span></a><br />';

// Only populate the sidebar with user names on main map, cuz it doesn't work on individual user maps.
	while ( $memberlist = $db->sql_fetchrow($result_all_members) )
	{
		$userlist_name = $memberlist['username'];
		$userlist_id = $memberlist['user_id'];
		$userlist_level = $memberlist['user_level'];
		
// Text coloring for Admin and Moderator names, based on board theme settings.
		switch($userlist_level) 
		{
			case ADMIN:
				$userlist_name = '<span style="color:#' . $theme['fontcolor3'] . '">'. $userlist_name . '</span>';
				break;
			case MOD:
				$userlist_name = '<span style="color:#' . $theme['fontcolor2'] . '">'. $userlist_name . '</span>';
				break;
			default:
				$userlist_name = '<span style="color:#' . $theme['fontcolor1'] . '">'. $userlist_name . '</span>';
		}
// Sidebar links need to do different things depending on which map you are looking at.
		if (empty($HTTP_GET_VARS[POST_USERS_URL]))
		{
		$phoogleList .= '<a href="javascript:myclick('.$j.')">'.$userlist_name.'</a><br />';
		$j++;	
		}
		else 
		{
		$phoogleList .= '<a href="phoogle_map.php?'. POST_USERS_URL .'='.$userlist_id.'">'.$userlist_name.'</a><br />';
		}
	}	
	$db->sql_freeresult($result_all_members);
	
// Only show Admin/Moderator Legend below map if "Use Special Markers" is selected
if ( $use_special_markers == 1 )
	{
		$template->assign_block_vars('switch_special_icons', array());
	}

// Get count of all users with map point set, allowed, and wanted to be shown
	$count_sql = "SELECT count(user_id) AS total 
		FROM " . USERS_TABLE . " 
		WHERE user_id <> " . ANONYMOUS ." AND  
		user_phoogle_allow = 1 AND
		user_phoogle_show_me = 1";

		if ( !($count_result = $db->sql_query($count_sql)) )
		{
			message_die(GENERAL_ERROR, 'Error getting total users', '', __LINE__, __FILE__, $sql);
		}

		if ( $total = $db->sql_fetchrow($count_result) )
		{
			$total_members = $total['total'];
			$pagination = generate_pagination($phpbb_root_path . "phoogle_map.$phpEx?show=$show" . ( ( isset($alphanum) ) ? "&alphanum=$alphanum" : '' ), $total_members, $show, $start);
}

//
// Output page header and map template
//
	$template->set_filenames(array(
		'body' => 'phoogle_map.tpl')
		);	
//
// Generate page
//
	$page_title = $lang['Phoogle_Map_Title'];

	include($phpbb_root_path . 'includes/page_header.'.$phpEx);

	$template->assign_vars(array(
		'L_PHOOGLE_MAP_TITLE' => $lang['Phoogle_Map_Title'],
		'L_PHOOGLE_SUB_HEAD' => $lang['Phoogle_Map_Subheading'],
		'L_PHOOGLE_LOC_LABEL' => $lang['Phoogle_Loc_Label'],
		'MAP_WIDTH' =>$myMap->mapWidth,
		'WIDTH_MEASURE' => $width_measure,
		'MAP_HEIGHT' =>$myMap->mapHeight,
		'HEIGHT_MEASURE' => $height_measure,
		'PHOOGLE_SCRIPT' => $myMap->printGoogleJS(),
		'PHOOGLE_MAP' => $myMap->showMap(),
		'PHOOGLE_COUNT' => $total_members,
		'PHOOGLE_USERS' => $phoogleList,
		'MARKER_FOLDER' => $phpbb_root_path.$marker_folder,
		'L_PHOOGLE_VERSION' => $lang['Phoogle_Version'],
		'L_PHOOGLE_ADMIN' => sprintf($lang['Admin_online_color'], '<span style="color:#' . $theme['fontcolor3'] . '">', '</span>'),
		'L_PHOOGLE_MOD' => sprintf($lang['Mod_online_color'], '<span style="color:#' . $theme['fontcolor2'] . '">', '</span>'),
		'USER_GROUP_SELECT' => $group_select_box,
		'S_PHOOGLE_ACTION' => append_sid("phoogle_map.".$phpEx ),
		
		'TROUBLESHOOT' => '' )
	);

$template->assign_vars(array(
	'S_SHOW' => $show,
	'L_SORT_BY' => $lang['Sort_by'],
	'L_USER_ID' => $lang['User_id'],
	'L_USER_LEVEL' => $lang['User_level'],
	'L_ASCENDING' => $lang['Ascending'],
	'L_DESCENDING' => $lang['Descending'],
	'L_SHOW' => $lang['Phoogle_Show'],
	'S_SHOW' => $show,
	'S_HIDDEN_FIELDS' => $hidden_fields,
	'PAGINATION' => $pagination,
	'PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $start / $show ) + 1 ), ceil( $total_members / $show )))
);	
	$template->pparse('body');

	include($phpbb_root_path . 'includes/page_tail.'.$phpEx);

// EOF
?>
you say it is a problem with the markers?
i have in the acp all markers deleted becaus i want one of them.

mfg
xervas
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 »

xervas wrote:hello,

you mean the phoogle_map.php?


you say it is a problem with the markers?
i have in the acp all markers deleted becaus i want one of them.

mfg
xervas
OK, I think you will need to put the markers back, or if you only want one, put it in all the spots for the markers. They are all expected by the map script to be there.
xervas
Registered User
Posts: 3
Joined: Fri Apr 25, 2008 3:16 pm

Re: [BETA] Phoogle (Google) Map

Post by xervas »

hello, thank you for your fast assistance.
the map functions now perfectly.
thank you for this mod and I hope you extend this mod still another little.
for example users in x km search in the environment

mfg
xervas
Exilexi
Registered User
Posts: 1
Joined: Fri May 09, 2008 11:18 pm

Re: [BETA] Phoogle (Google) Map

Post by Exilexi »

How can i add User automaticly to Phoogle Map when they entered their "Wohnort" city in their profile after Registration ??
emathews
Registered User
Posts: 16
Joined: Sun Mar 23, 2008 6:41 pm

Re: [BETA] Phoogle (Google) Map

Post by emathews »

I just installed this in my forum, PHPbb 3.0.1, phpBB3 Phoogle Map MOD v0.2.0

Very impressive, like it a lot. Thanks for the MOD
Post Reply

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