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

casp3r

Thanks that works (SMF 2.0)
Noticed that there's also a 'Member Map' in 'Modifications' and this works fine.
Aviation forum & gallery
www.niaviation.co.uk

SgtMic

Quote from: casp3r on July 31, 2008, 04:26:06 PM
Thanks that works (SMF 2.0)
Noticed that there's also a 'Member Map' in 'Modifications' and this works fine.

Had to use that section for all the admin stuff as well.
Thanks brianjw for getting this out for us 2.0 users.
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)

brianjw

I hope you all enjoy it and I know how much you guys wanted it lol. So I worked on it all day today. I almost didn't eat lunch lol. :P

There is no admin panel for the member map in features and options in 2.0. It was moved to a location where it should be in 2.0 which is under the 'Modifications' menu.

SgtMic

Quote from: brianjw on July 31, 2008, 07:41:01 PM
I hope you all enjoy it and I know how much you guys wanted it lol. So I worked on it all day today. I almost didn't eat lunch lol. :P

There is no admin panel for the member map in features and options in 2.0. It was moved to a location where it should be in 2.0 which is under the 'Modifications' menu.

Will you be deleting that link in options then? It's a little misleading if you don't know to look in the mod section.

Also, where do you change the color for the sidebar? I looked in googlemap.template but did not see it.
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)

brianjw

@SgtMic:
Yes. I miscoded in the ManageSettings.php file. I will fix it real quick and upload it to the modsite and will post a manual fix here.

You cannot change the color for the sidebar, it is part of the page. I guess you can add a background to the div for it though. The div for it is <div id="sidebar" just add some kind of style for a background or something. ;)

brianjw

Ok, here's the fix for ManageSettings.php which will be updated on the modsite in a minute..
Open ManageSettings.php which is in ./Sources/
FIND

'googlemap' => array(
'label' => $txt['googleMapFO'],
'href' => $scripturl . '?action=admin;area=modsettings;sa=googlemap;sesc=' . $context['session_id'],
),


REMOVE IT

FIND

// Load up all the tabs...
$context[$context['admin_menu_name']]['tab_data'] = array(
'title' => &$txt['admin_modifications'],
'help' => 'modsettings',
'description' => $txt['modification_settings_desc'],
'tabs' => array(
'general' => array(
),

ADD THE FOLLOWING AFTER THE ABOVE


'googlemap' => array(
),


That should fix it. :)

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)

cubetgio

#507
Ho Great !!!!   :) :) :)

It work now with new version !! 

I have a last question, it's about uninstalling the mod :

i'had duplicate the code because installing and uninstalling the MOD seferal time.

I decided to do the cleaning of the file (duplication) and i have got this now when uinstalling:

Execute Modification ./index.php Test successful
7. Execute Modification ./Sources/Load.php Test failed
8. Execute Modification ./Sources/ManagePermissions.php Test successful
9. Execute Modification ./Sources/ModSettings.php Test successful
10. Execute Modification ./Sources/Profile.php Test successful
11. Execute Modification ./Themes/default/index.template.php Test failed
12. Execute Modification ./Themes/default/Profile.template.php Test failed
13. Execute Modification ./Themes/default/languages/Modifications.english.php Test failed

Can i go ahead  with uninstalling ? then installing again to get all successful test ?

The mod is operating very well...




brianjw

You should probably uninstall, and manually check to see if the mod is installed. Or if you have no other mods installed, then you can just uninstall and replace those files with fresh install files.

2Ntense

With that many errors, yeah, I'm with Brian.  I'd revert to the SMF 'default' theme, dump your current file set and replace with a clean set of files, then re-install all the other mods and theme(s) again.  If you truly have a bunch of duplicated code then that's the only (somewhat) safe thing to do, but I'd still make a backup first.  Uninstalling at this point could quite likely break your forum.

Quote7. Execute Modification ./Sources/Load.php Test failed
11. Execute Modification ./Themes/default/index.template.php Test failed
12. Execute Modification ./Themes/default/Profile.template.php Test failed
13. Execute Modification ./Themes/default/languages/Modifications.english.php Test failed

The only error above that's somewhat safe to ignore is the one for Modifications.english.php as it'll probably just leave in some strings that you don't need.  Any of the others could easily make your forum fall over and *die* if you ignore errors and press the [UNINSTALL NOW] button.  I've done it myself more than once.  ;D

Most often those errors are caused by installing and uninstalling modifications out of order, which SMF 1.x exacerbates by not keeping track of what you've installed in which order.  I don't recall if 2.0 is any better in that regard.  I keep a separate list on my forum of what I've done and when, so I can reverse the changes later.


Folks, since we're now supporting both 1.x and 2.x, please let us know which forum version you're on!

brianjw

Since he has a link to his site, I believe it is 1.1.5

digit

Any chance we can just display who's on our buddy list?

Happily using a heavily modified 1.1.16 version of SMF!

2748011 Posts in 320998 Topics by 50986 Members


SOLD my website - thanks it was a good run - they converted to vbadvanced. (and screwed it up good!)

brianjw

On the main member map?

No, because the member map is public and everyone can add pins to it. I guess it is possible but it would be way out of my way to code something like this.

edi67

CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

2Ntense

Quote from: digit on August 05, 2008, 11:15:15 AM
Any chance we can just display who's on our buddy list?

There's a real handy link to each pinned member's PROFILE inside the info balloon that'll get that for ya. ;)

Otherwise you'd have to go inside GoogleMaps.php and change around the section that collects the info for the ballooon.  The code is wide open, and it's pretty easy to get any of the variables in the 'members' table.  That's the only table we're reading, and you're on your own for the change 'cos *I* sure can's see any use for it.  You'd have to explode the array for buddies and then convert the ID numbers back into names.

Changing around the info in the sidebar could get ugly, mostly because it's only so wide and the information would start to wrap or cause a horizontal scrollbar at some point.

It's not that hard to modify the info balloon... that section is mostly just HTML with a few IFs, look just under the comment that says // Lets accualy start making XML Mr. PHP

Enough people have asked about the info balloon, so here's the entire code for it:

    // Lets accualy start making XML Mr. PHP
echo '<?xml version="1.0" encoding="', $context['character_set'], '"?' . '>
<markers>';

if (isset($data)) {
// Assuming we have data to work with...
    foreach ($data as $marker) {
$datablurb = '
<table class="googleMaps" border="0">
<tr>
    <td style="white-space: nowrap;" align="left"><a href="' . $marker['online']['href'] . '"><img src="' . $marker['online']['image_href'] . '" alt="' . $marker['online']['text'] .'" class="avatar" border="0" /></a> <a href="' . $marker['href'] .'">' . $marker['name'] . '</a></td>
<td rowspan="3"><img src="' . $marker['avatar']['href'] . '" height="80" /></td>
</tr><tr>
    <td style="white-space: nowrap;"><font color="#000000">' . $marker['title'] . '</font></td>
    </tr><tr>
<td style="white-space: nowrap;" align="center">
' . $marker['icq']['link'] . '
' . $marker['aim']['link'] . '
' . $marker['yim']['link'] . '
' . $marker['msn']['link'] . '
</td>
</tr><tr>
<td style="white-space: nowrap;" colspan="2" align="left">';
if (($marker['website']['url'] != '') && ($marker['website']['title'] != ''))
$datablurb = $datablurb . '<a href="' . $marker['website']['url'] . '">' . $marker['website']['title'] . '</a>';
$datablurb = $datablurb . '</td>
</tr><tr>
    <td style="white-space: nowrap;" colspan="2" align="left"><font color="#000000">' . $marker['blurb'] . '</font></td>
</tr>
</table>';

// This is to help against those funky chars... and protect against those " errors in XML!
$datablurb = htmlspecialchars($datablurb);

// Lets bring it all together...
$markers = '<marker lat="' . $marker['googleMap']['latitude'] . '" lng="' . $marker['googleMap']['longitude'] . '" ';

if ($marker['gender']['name'] == $txt[238]) {
$markers = $markers . 'gender="1"';
} elseif ($marker['gender']['name'] == $txt[239]) {
$markers = $markers . 'gender="2"';
} else {
$markers = $markers . 'gender="0"';
}

$markers = $markers . ' label="' . $marker['name'] . '" html="'. $datablurb . '" />';

echo $markers;
}
}
    echo '
    </markers>';


The $datablurb is what's displayed as the HTML for the marker info balloon.

The section underneath // Lets bring it all together... is what sets the color of the pin.  If you can read HTML then changing this isn't rocket science... and you have access to ANY of the fields in the 'members' table:

ID_MEMBER, memberName, dateRegistered, posts, ID_GROUP, lngfile, lastLogin, realName, instantMessages, unreadMessages, pm_ignore_list, emailAddress, personalText, gender, birthdate, websiteTitle, websiteUrl, location, ICQ, AIM, YIM, MSN, hideEmail, showOnline, timeFormat, signature, timeOffset, avatar, pm_email_notify, karmaBad, karmaGood, usertitle, notifyAnnouncements, notifyOnce, ID_THEME, ID_MSG_LAST_VISIT, additionalGroups, smileySet, ID_POST_GROUP, totalTimeLoggedIn, messageLabels, buddy_list, notifySendBody, notifyTypes, longitude, latitude

I've removed the few fields that are related to security, like passwd.  You have NO business displaying that kind of data on any of your members.  Likewise, you shouldn't be displaying their IP address without their consent.  Also, if you want to display their e-mail link then you should first qualify that with the hideEmail flag.

(note to self: I think I just spotted a bug... we're not checking the 'hide online status', unless $marker['online']['image_href'] already qualifies that.)

As other mods are installed, new 'members' fields become available for use inside the info balloon.   One fun mod might be JayBachatero's 'Country Flags', although..... gee, you're ON a map, and you can SEE what country they're in....  :P

tk2012

I'm finally able to install this today on my new forum.

I'm using v2.0 b3.1 and it failed two tests when trying to load.  The first one was Sources/Profile-Modify.php which was the 2nd edit to "replace".  The second fail was in Themes/default/languages/manageSettings.english.php which is the 1st edit to "add after"

I went ahead and installed anyway and will go back and manually edit both of these areas.  When it redirected me, I was taken to the admin section.  The only problem with that is that there were no words showing up as in your attached pic.  The checkboxes and text boxes were present, but there were no words appearing to the left.  Also, there was one extra checkbox that is not in the reference pic.  Between the API key and the max pins box, I have two checkboxes that appear instead of one.  Not sure which is gender and which is extra at this point.  Perhaps after doing the manual edits it will show?

Going to work on it now hopefully before the Comcast Tech arrives to fix my internet connection!

brianjw

This is a language file problem. Please make sure that all the language strings are in Modifications.<your_language>.php. It is possible you are using utf-8. If this is true, then make sure the edits are also in Modifications.<your_language>-utf8.php

The screenshots are outdated at the moment, I will fix them ASAP.

tk2012

#517
Hey there

I have the ADVANCED REPUTATION mod installed and it looks like it interferes with those two edits that failed.  I think this is what needs to be done in order to complete the install.

For the 2nd edit of the Sources/Profile-Modify.php, find this:


setupProfileContext(
array(
'avatar_choice', 'personal_text', 'hr',
'bday1', 'location', 'gender', 'hr',
'icq', 'aim', 'msn', 'yim', 'hr',
'usertitle', 'signature', 'hr',
'karma_good', 'karma_disabled', 'hr',
'website_title', 'website_url',
)


and then add the following line to it.


'latitude',


(The other edits in that file were done correctly already.)




Then, for the second test fail, you need to look for this code in your  Themes/default/languages/manageSettings.php file:


$txt['karmaLabel'] = 'Reputation label';
$txt['karmaApplaudLabel'] = 'Reputation applaud label';
$txt['karmaSmiteLabel'] = 'Reputation smite label';


and THEN put the following after it:


$txt['googleMapsEnable'] = 'Enable the Google Member Map'; $txt['googleMapsEnableLegend'] = 'Show a Pin Legend'; $txt['googleSidebar'] = 'Where to show sidebar'; $txt['googleMapsKey'] = 'The key from the Google Maps API Page'; $txt['googleMapsPinGender'] = 'Should the pins reflect users gender?'; $txt['KMLoutput_enable'] = 'Should the compressed KML output be allowed? (KML is a file that is downloadable on the Google Map page that displays all the member pins inside Google Earth)'; $txt['googleMapsPinNumber'] = 'Number of max pins to show on map'; $txt['googleMapsType'] = 'The map type to show'; $txt['googleMapsDefaultLat'] = 'The default Latitude'; $txt['googleMapsDefaultLong'] = 'The default Longitude'; $txt['googleMapsDefaultZoom'] = 'The default Zoom'; $txt['googleMapsEnableClusterer'] = 'Enable Pin Clustering'; $txt['googleMapsMinMarkerCluster'] = 'Minimum Pins Per Cluster'; $txt['googleMapsMaxVisMarker'] = 'Maximum Visible Pins On Map'; $txt['googleMapsMaxNumClusters'] = 'Max Number of Clusters'; $txt['googleMapsMaxLinesCluster'] = 'Max Number of lines in Cluster Info Box'; $txt['googleMapFO'] = 'Member Map';


tk2012

Quote from: brianjw on August 11, 2008, 04:27:15 PM
This is a language file problem. Please make sure that all the language strings are in Modifications.<your_language>.php. It is possible you are using utf-8. If this is true, then make sure the edits are also in Modifications.<your_language>-utf8.php

The screenshots are outdated at the moment, I will fix them ASAP.

Not sure I understand..

My default/languages directory only has the following utf8 files:  ManageAwards.english-utf8.php & UsersOnlineToday.english-utf8.php

Everything else is standard .english.php files.

I'm going to go back and check all the edits.  I'm using the default theme on v2.0 b3.1  I did the previous two edits I posted, but see no change to anything.  Also, when going to the profile section, I see the bog square where the map is to be placed, but no map or way to place your pointer. 

Also, when clicking the main MEMBER MAP tab, I see the map and that's it.  I can go in and out, but there's still no words anywhere on the page.  I can usually do edits when told where to look, but in this case I don't see any other utf8 files anywhere.

brianjw

Okay, well then try checking ManageSettings.english.php for the google map edits.

Advertisement: