News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Google Member Map

Started by Spuds, December 12, 2007, 01:49:12 PM

Previous topic - Next topic

TW1ST3D

You don't have to edit the settings.bak.php template, it is a backup file that you may need to refer to if things don't work out.
Running 2.0 Gold.......SMF Rocks!!

forummaker

Google Member Map with Ultimate Profile question.
I installed the Google Member Map a few weeks ago... and it works great!
I recently installed the Ultimate Profile mod (manual install). It too works great!
The problem is... while viewing a members profile, the map does not show at the bottom of a members profile. I've searched for a solution to this, but couldn't find anything.
What file would I change to add the google map to the bottom of a members profile? Thanks in advance for any help with this.

smf 1.1.8
tp 1.0.5
googlmap 1.0 beta 4
ult profile 0.8.5

brianjw

It would need to be Profile.template.php

forummaker

brianjw,
Thanks for such a fast response. I've browsed through the files to ensure I wasn't missing any of the code, and everything seems to be in order. I don't understand why the map isn't showing up....hmmmm.
All the code seems to be present for the google member map in profile.template.php.

brianjw

It might be because I haven't updated the mod for SMF 1.1.8 and 2.0 RC1. I will try to get at this as soon as I can. I believe spring break I will get a chance to update this stuff for you. And thanks to everyone for being patient!

forummaker

#885
Everything else works... it just won't show while viewing a members profile. And all the permissions are set accordingly.
When a member goes to "forum profile information" they can set their location. And again. everything else is working with the map.
I wish I knew enough about coding to help you with this mod.
Anyhow. Thanks for your help. Still love the mod. I'll check back later for updates.

Edit:
Ok. Here's what I did to add the Google Map with the Ultimate Profile Mod.
In UltimateProfile.template.php

Find:
if (($modSettings['profile_allow_mediabox'] == 1) && (!empty($context['member']['options']['media'])))

echo '

<br />



<table border="0" cellpadding="4" cellspacing="1" class="bordercolor" width="100%" id="media">

<tr>
<td class="titlebg" height="26" align="center">
', $txt['profile_media'] ,'
</td>
</tr>

<tr>

<td class="windowbg">

', un_htmlspecialchars ($context['member']['options']['media']) ,'

</td>

</tr>

</table>';


Add after:
// this is the start of the googlemap code


if (($modSettings['googleMapsEnable']) && (allowedTo('googleMap_view'))) {
if(isset($context['member']['googleMap']['latitude']) && isset($context['member']['googleMap']['longitude'])) {
echo '

<br />
<table border="0" cellpadding="4" cellspacing="1" class="bordercolor" width="100%" id="googleMap">
<tr>
<td class="titlebg" height="26" align="center">My Location
</td>
</tr>

<tr>
<td class="windowbg" colspan="2">
<script src="http://maps.google.com/maps?file=api&v=2&key=' . $modSettings['googleMapsKey'] . '" type="text/javascript"></script>
<div id="map" style="width: 600px; height: 350px; color: #000000;"></div>
<input type="hidden" name="latitude" size="50" value="', $context['member']['googleMap']['latitude'], '" />
<input type="hidden" name="longitude" size="50" value="', $context['member']['googleMap']['longitude'], '" />
<script type="text/javascript">';

//Evil hack on this!!!
        echo '
//' . chr(60) . chr(33) . chr(91) . chr(67) . chr(68) . chr(65) . chr(84) . chr(65) . chr(91);

echo "
function LoadMap() {
var map = new GMap2(document.getElementById(\"map\"));
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(" . $context['member']['googleMap']['latitude'] . "," . $context['member']['googleMap']['longitude'] . "), 13, ". $modSettings['googleMapsType'] .");
var point = new GLatLng(" . $context['member']['googleMap']['latitude'] . "," . $context['member']['googleMap']['longitude'] . ");
var marker = new GMarker(point);
map.addOverlay(marker);
}

if (GBrowserIsCompatible()) {
window.onload=LoadMap;
}";

//Lets make another evil hack!
echo '
//' . chr(93) . chr(93) . chr(62);
echo "
            </script>
</td>
</tr>";
}
}

//this is the end of the googlemap code


Doing this also moves the comments section over to the right side in the profile, instead of showing across the bottom of the profile. Not sure what to change to correct that part.

kyinhi

Could someone please help with the following errors? Everything appears to be working fine but they are clogging up my error log.

Thanks!

Quote8: Undefined index: MemberMap
/independentmamas.com/redux/Themes/default/Admin.template.php (eval?)
Line: 575


8: Undefined index: MemberMap
/independentmamas.com/redux/Themes/girlyman/BoardIndex.template.php (eval?)
Line: 575


8: Undefined index: MemberMap
/independentmamas.com/redux/Themes/default/Search.template.php (eval?)
Line: 575


8: Undefined index: MemberMap
/independentmamas.com/redux/Themes/default/Errors.template.php (eval?)
Line: 575

kyinhi

Bump. Anyone? I'm deleting a thosand or so pages of errors a day and they are all like that. I gather that something is missing from my themes. But I have no idea what.

Dejv

#888
Quote from: Dejv on February 28, 2009, 01:22:21 PM
Hi,

is anybody using googlemap in smf multisite?
Has anybody managed to place all variables (api, zoom, lat, long) in settings.php and settings.bak.php?

Thanks


Hi,
so, for multisite purpouse, I changed all

$modSettings['googleMapsKey']
$modSettings['googleMapsDefaultZoom']
$modSettings['googleMapsDefaultLat']
$modSettings['googleMapsDefaultLong']

to

$googleMapsKey
$googleMapsDefaultZoom
$googleMapsDefaultLat
$googleMapsDefaultLong

and created those new variables in Settings.php

$googleMapsKey = 'xxxxxxxxxxxxxx';
$googleMapsDefaultZoom = 5;
$googleMapsDefaultLat = 50.1111;
$googleMapsDefaultLong = 10.11;

But I am still missing something, maybe to define a global?
I am getting this error message in all browsers:
Sorry, the Google Maps API is not compatible with this browser

Thanks
SMF 1.1.20

BuzzBoy

Hi I am getting an error on the Profile.template.php when installing thru the package parser...

I tried to do the suggested edits manually but the find snippet of code was not there...how can I make it work as I was getting a template error on the two spots that I tried I am running RC1 and PortaMx

FIND
  // Now print the second column where the members avatar/text is shown. echo ' <td class="windowbg" valign="middle" align="center" width="150">  ', $context['member']['avatar']['image'], '<br /><br />  ', $context['member']['blurb'], ' </td>  </tr>'; 

ADD AFTER
if ($modSettings['googleMapsEnable'] && allowedTo('googleMap_view')) { if (isset($context['member']['googleMap']['latitude']) && isset($context['member']['googleMap']['longitude'])) { echo ' <tr> <td class="windowbg" colspan="2"> <script src="http://maps.google.com/maps?file=api&v=2&key=' . $modSettings['googleMapsKey'] . '" type="text/javascript"></script> <div id="map" style="width: 600px; height: 350px; color: #000000;"></div> <input type="hidden" name="latitude" size="50" value="', $context['member']['googleMap']['latitude'], '" /> <input type="hidden" name="longitude" size="50" value="', $context['member']['googleMap']['longitude'], '" /> <script type="text/javascript">'; // Evil hack on this!!! echo ' //' . chr(60) . chr(33) . chr(91) . chr(67) . chr(68) . chr(65) . chr(84) . chr(65) . chr(91); echo ' function LoadMap() { var map = new GMap2(document.getElementById("map")); map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); map.setCenter(new GLatLng(' . $context['member']['googleMap']['latitude'] . ',' . $context['member']['googleMap']['longitude'] . '), 13, '. $modSettings['googleMapsType'] . '); var point = new GLatLng(' . $context['member']['googleMap']['latitude'] . ',' . $context['member']['googleMap']['longitude'] . '); var marker = new GMarker(point); map.addOverlay(marker); } if (GBrowserIsCompatible()) { window.onload=LoadMap; }'; // Let's make another evil hack! echo ' //' . chr(93) . chr(93) . chr(62); echo ' </script> </td> </tr>'; } } 



SgtMic

There is nothing more deadly than a US Marine and his rifle.
A close second is a US Marine and his K-BAR.
2/5 Fox Co.  (BlackHearts)
FAST Co. 5th Plt. (FIDO)

BuzzBoy

I did get everything installed accept that part "Profile"  :'(

...any ideas to make the profile work? The error on the template was "unexpected close" I tried to place the code in two different spots. Unsuccessful both times... :-[

Thanks,

BB


SgtMic

No idea. I'm waiting for the updated version.
There is nothing more deadly than a US Marine and his rifle.
A close second is a US Marine and his K-BAR.
2/5 Fox Co.  (BlackHearts)
FAST Co. 5th Plt. (FIDO)

endiZ

Great mod. Can't wait for google latitude support XD

TheDel

OK I cant get my map to show pins any longer-
The only thing I believe I did was upgrade to 1.1.8

BUT the map still works in Profiles- just not the main one.
Any ideas?

9210

How can I get the 'Member Map'-link to show up when using a different language than English?

Which files need to be edited (using Dutch)?


brianjw

I would guess that Modifications.dutch.php needs to be edited for the Dutch language.

9210

Did that...copied the entire 'googleMaps' section and converted it to Dutch....Still don't see it in the menu-bar 9see a little extra space ther, though..)

Redryder

Any word on 2.0 RC 1 update?

It is a good mod BTW, and works with 2.0 RC 1, but it does not show in the profile summery screen with the 2.0 RC 1 profile being different.

I see one has fixed this, can you pass on the changes we need to do, it would help.


brianjw

Not sure when I can get this to you guys. I have limited time right now. None of my mods are up to date. I have alot of WORK in real life to deal with right now. When I get a free spot, the first thing I will try to do is this.

I really cannot promise anything at this point. I will still manage this mod and others but I will need a little more time. I am sorry to keep you all waiting!

Advertisement: