[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.
mr.wood
Registered User
Posts: 10
Joined: Tue Mar 27, 2007 3:06 pm

Re: [BETA] Phoogle (Google) Map

Post by mr.wood » Tue Mar 27, 2007 8:11 pm

BassFace:

This mod is AWESOME!

I absolutely love it!

One question: If I want to put the map on the index page of the forum how could I do that? I tried editing index.php and I managed to get the map on there but I obviously didn't do it right.

Anyone else know how to add it onto the bottom of the index.php page? I want to put it above the "administrator control" button.

Thanks,

Ryan

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 » Wed Mar 28, 2007 3:51 am

FIX FOR Phoogle Map v1.0.2 Users

Please edit your phoogle_map.php file as follows (in 2 places):

Code: Select all

#
#--[ FIND ]------------------
#
$rep = array('\n','\r','<br /><br />');
#
#--[ REPLACE WITH ]------------------
#
$rep = array("\n","\r","<br /><br />");
Issue: Map will not display due to a user's input in their bubble comment.
This is an old issue that cropped back up during editing for the new version. Not sure why the single-quote vs double-quote makes a difference, but it does!
Last edited by BassFace on Sat Mar 31, 2007 12:31 pm, edited 1 time in total.

mr.wood
Registered User
Posts: 10
Joined: Tue Mar 27, 2007 3:06 pm

Re: [BETA] Phoogle (Google) Map

Post by mr.wood » Wed Mar 28, 2007 5:03 am

Well I must say that I am really impressed by this mod. I know you're not supposed to use a beta mod on a live site, but I couldn't resist. Plus BassFace is very helpful.

Check out my live site if you want: www.planetinverts.com/forum

Thanks BassFace!!

-Ryan

User avatar
cherryworld4u
Registered User
Posts: 32
Joined: Wed Feb 14, 2007 7:39 pm

Re: [BETA] Phoogle (Google) Map

Post by cherryworld4u » Wed Mar 28, 2007 10:49 am

BassFace wrote: I started the v0.0.4 to v1.0.2 update file last night. I'll continue with it tonight. 8) Update files are a lot harder to create than install files.


Hye BassFace,

Thnx for ur appreciation. Is that upgrading files ready plz upload them :neutral:
And plz upload the 0.0.4 installation instruction with it if the prob remains then i will try uninstall and then install ur latest ver.

Thnx 4 this gr8 mod

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 » Wed Mar 28, 2007 2:36 pm

cherryworld4u wrote:
BassFace wrote: I started the v0.0.4 to v1.0.2 update file last night. I'll continue with it tonight. 8) Update files are a lot harder to create than install files.


Hye BassFace,

Thnx for ur appreciation. Is that upgrading files ready plz upload them :neutral:
And plz upload the 0.0.4 installation instruction with it if the prob remains then i will try uninstall and then install ur latest ver.

Thnx 4 this gr8 mod


Almost done, tonight for certain. You can be the Update tester! 8)

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

Phoogle Map on Index Page

Post by BassFace » Wed Mar 28, 2007 2:43 pm

mr. wood asked how to put a map on the index page, so I put this together. Thanks for the idea, and for testing, mr. wood! :mrgreen:

This will put a stripped down Phoogle map on your index page, right above the footer (You can put it anywhere on the page - just put the <table> code block below at a different spot in index_body.tpl). This map has no userlist to the right, and nothing but usernames in the map comment bubbles.

1. Backup your index.php and templates/subSilver/index_body.tpl.
2. Edits.
OPEN index.php
FIND

Code: Select all

include($phpbb_root_path . 'common.'.$phpEx);
AFTER, ADD

Code: Select all

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

Code: Select all

//
// Generate the page
//
$template->pparse('body');
BEFORE, ADD

Code: Select all

// Begin Phoogle
// 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) )
	{
		$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'];
		$marker_folder = $mapConfig['marker_folder'];
	}
	
	$db->sql_freeresult($result_map_config);

// Now let's put values 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 markers
	$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'];
	}
	$db->sql_freeresult($result_markers);

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

// sql for members with map points set - used for 'Show All Users' map and for sidebar list
	$sql_all_members = "SELECT username, user_phoogle_map_center, user_phoogle_icon
		FROM " . USERS_TABLE . "
		WHERE user_id <> " . ANONYMOUS ." AND  
		user_phoogle_allow = 1 AND
		user_phoogle_show_me = 1
		ORDER BY username";

	if( !($result_all_members = $db->sql_query($sql_all_members)) )
	{
		message_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql_all_members);
	}
// This point is always the first point (used to center the map but does not display a map marker).
	$myMap->centerMap = "map.setCenter(new GLatLng($map_center), $init_zoom);"; 
// iterate through the results to display members with map points set
	$member_count = 0;
	while ( $members = $db->sql_fetchrow($result_all_members) )
	{
		$username = $members['username'];
		$parens = array('(',')');
		$user_phoogle_map_center = str_replace($parens, '', $members['user_phoogle_map_center']);
		$user_phoogle_icon = $members['user_phoogle_icon'];

// 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
		$tab[] = '';
		$myMap->addGeoPointTabbed($user_phoogle_map_center, $user_phoogle_icon, $tab, $username);
		unset($tab);
	$member_count++;
}
$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' => $member_count,
		'L_PHOOGLE_ALL' => $lang['Phoogle_All_Members'],
		'PHOOGLE_VERSION' => $lang['Phoogle_Version'] )
	);
// End Phoogle
OPEN templates/subSilver/index_body.tpl
AT THE TOP OF THE PAGE, ADD

Code: Select all

<style>
#phoogleMap 
  {
	position: relative;
	height: {MAP_HEIGHT}{HEIGHT_MEASURE}; 	
	width: {MAP_WIDTH}{WIDTH_MEASURE};
	border: 4px inset #03699C;
	vertical-align: middle;
  }
</style>
AT BOTTOM OF THE PAGE (you can put this wherever you want the map to display, but I would think in-between two other tables would be best)

Code: Select all

<br clear="all" />
<table cellpadding="2" cellspacing="1" border="0" class="forumline" align="center">
  <tr> 
	<th class="thHead" height="25" nowrap="nowrap">{L_PHOOGLE_MAP_TITLE} {L_PHOOGLE_USERNAME}</th>
  </tr>
  <tr> 
	<td align="center" class="row1">
		<!-- Phoogle Google Map -->      
	    <div id="phoogleMap" class="postbody"></div>		<div class="cattitle">{L_PHOOGLE_SUB_HEAD} ({PHOOGLE_COUNT})<span class="row3">
	    	<input name="map_center" type="hidden" id="map_center" size="60" />
			<input name="init_zoom" type="hidden" id="message" size="60" />
	    </span></div></td>
	</tr>
  </table>
<div class="copyright" align="center">Phoogle Map phpbb MOD {PHOOGLE_VERSION} by <a href="http://www.bassface3d.com">BassFace</a> | Original Phoogle Map Class by <a href="http://www.systemsevendesigns.com">Justin Johnson of systemsevendesigns</a></div>
That should do it (worked on my test server copy at least! :D )
Last edited by BassFace on Wed Mar 28, 2007 4:11 pm, edited 1 time in total.

mr.wood
Registered User
Posts: 10
Joined: Tue Mar 27, 2007 3:06 pm

Re: Phoogle Map on Index Page

Post by mr.wood » Wed Mar 28, 2007 2:56 pm

BassFace wrote: mr. wood asked how to put a map on the index page, so I put this together. Thanks for the idea, and for testing, mr. wood! :mrgreen:

This will put a stripped down Phoogle map on your index page, right above the footer (You can put it anywhere on the page - just put the <table> code block below at a different spot in index_body.tpl). This map has no userlist to the right, and nothing but usernames in the map comment bubbles.

1. Backup your index.php and templates/subSilver/index_body.tpl.


That should do it (worked on my test server copy at least! :D ) I'd love to see it in action when you get the edits done, would you PM me a link to your site?

Let me know how it goes.
Bass
[/quote]

It works very well. I love it!

-Ryan

User avatar
cherryworld4u
Registered User
Posts: 32
Joined: Wed Feb 14, 2007 7:39 pm

Re: [BETA] Phoogle (Google) Map

Post by cherryworld4u » Wed Mar 28, 2007 4:18 pm

BassFace wrote:
cherryworld4u wrote:
BassFace wrote: I started the v0.0.4 to v1.0.2 update file last night. I'll continue with it tonight. 8) Update files are a lot harder to create than install files.


Hye BassFace,

Thnx for ur appreciation. Is that upgrading files ready plz upload them :neutral:
And plz upload the 0.0.4 installation instruction with it if the prob remains then i will try uninstall and then install ur latest ver.

Thnx 4 this gr8 mod


Almost done, tonight for certain. You can be the Update tester! 8)



I am gr8ful to be tester

Thnx

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

v0.0.4 to v1.0.2 Upgrade Package

Post by BassFace » Thu Mar 29, 2007 2:51 am

Here's the stuff you'll need to upgrade from v0.0.4 to v1.0.2.
PLEASE, backup the files you edit or replace before proceeding - this upgrade has not been tested!!!!
Also, be sure to report any issues here so I can help you fix it and update the Upgrade package.
I recommend, if at all possible, to uninstall v0.0.4 (don't change the db, just the files) and installing v1.0.2 (which installs with EasyMOD now 8) ) rather than using the upgrade package.

http://bassface3d.com/phoogle/v004_to_v102_upgrade.zip
Thanks,
Bass 8)

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 » Thu Mar 29, 2007 2:52 am

cherryworld,
Here's a link to the v0.0.4b package http://bassface3d.com/phoogle/phpbb_pho ... 0.0.4b.zip

Good luck!

Bass

User avatar
Aahz
Registered User
Posts: 39
Joined: Sun Nov 02, 2003 9:44 pm
Location: ...Behind The Curtain
Contact:

Re: [BETA] Phoogle (Google) Map

Post by Aahz » Thu Mar 29, 2007 9:58 am

I just installed this on my board (v1.0.2) and everything seems to be working fine except that the link to the map does not appear in my menu.

I am using the AcidTechBlood style. I realize you can't support all the styles, but I've managed to get other mods to appear in the menu, so if you could just point me to the right spot I could probably find the problem.

http://forum.itswickedfun.net

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 » Thu Mar 29, 2007 11:36 am

Aahz wrote: I just installed this on my board (v1.0.2) and everything seems to be working fine except that the link to the map does not appear in my menu.

I am using the AcidTechBlood style. I realize you can't support all the styles, but I've managed to get other mods to appear in the menu, so if you could just point me to the right spot I could probably find the problem.

http://forum.itswickedfun.net


Check the sections in the install file that have to do with:

includes/page_header.php
and
templates/subSilver/overall_header.tpl

But of course, substitute 'subSilver' for whatever theme you are using. 8)

gansert
Registered User
Posts: 581
Joined: Wed Mar 08, 2006 8:48 pm
Location: KÖLN, GERMANY
Contact:

Re: [BETA] Phoogle (Google) Map

Post by gansert » Thu Mar 29, 2007 2:31 pm

Aahz wrote: I just installed this on my board (v1.0.2) and everything seems to be working fine except that the link to the map does not appear in my menu.

I am using the AcidTechBlood style. I realize you can't support all the styles, but I've managed to get other mods to appear in the menu, so if you could just point me to the right spot I could probably find the problem.

http://forum.itswickedfun.net


Try this:
Open

Code: Select all

templates/subSilver/overall_header.tpl
Find:

Code: Select all

<a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a>
After ADD:

Code: Select all

<a href="{U_PHOOGLE}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_phoogle.gif" width="12" height="13" border="0" alt="{L_PHOOGLE}" hspace="3" />{L_PHOOGLE}</a>&nbsp;

User avatar
cherryworld4u
Registered User
Posts: 32
Joined: Wed Feb 14, 2007 7:39 pm

Re: [BETA] Phoogle (Google) Map

Post by cherryworld4u » Thu Mar 29, 2007 2:33 pm

BassFace wrote: cherryworld,
Here's a link to the v0.0.4b package http://bassface3d.com/phoogle/phpbb_pho ... 0.0.4b.zip

Good luck!

Bass


Thanx Bassface I Will Try It And Then Definately Reply here

User avatar
cherryworld4u
Registered User
Posts: 32
Joined: Wed Feb 14, 2007 7:39 pm

Re: [BETA] Phoogle (Google) Map

Post by cherryworld4u » Thu Mar 29, 2007 4:03 pm

BassFace wrote: cherryworld,
Here's a link to the .....................
Good luck!

Bass


Hey Bassface,

Thanx For Uploading this upgraded ver
I hav upgraded this ver but now the zooming bar is nt working and no member is displayed

Check this http://www.cherryworld4u.org/forum

But some what better than last one

Plz help Me BassFace

Post Reply

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

cron