PDA

View Full Version : Profile Enhancements - Member Info Map - display the location of the user with Google Maps


MrNase
11-29-2007, 10:00 PM
Hi there!

This mini mod allows you to place a map of the user location on the Member Info Page (aka profile).

The user can define his/her location and wether he/she wants to show a map or not in his/her profile. It uses the Google Maps API and jQuery.


You don't need to modify a template or a file, simply follow the instructions:


First step:
Go to the 'Plugins & Products' section in your AdminCP.
Click on 'Manage Products' and import the *.xml file I attached.


Second step:
Part 1:
Go to the 'User Profile Fields' section in your AdminCP.
Add a new User Profile Field -> Single-Line Text Box

Enter a title and a description.
Edit the following settings:
Field Searchable on Members List -> no
Show on Members List -> no

Click 'save'.
Note the ID/name of that profile field (field5, field100 or whatever)


Part 2:
Add a new User Profile Field -> Single-Selection Radio Button

Enter a title and a description.
Edit the following settings:
Options -> yes (next line) no
Field Searchable on Members List -> no
Show on Members List -> no

Click 'save'.
Note the ID/name of that profile field (field6, field100 or whatever)



Third step:
Apply for a Google Maps API-Key: http://code.google.com/apis/maps/signup.html

Put the attached file 'jquery-1.2.1.min.js' into the folder /clientscript/



Fourth step:
Go to the 'vBulletin Options' section in your AdminCP.
Select the settings 'User Listing & Profile Viewing'.
Copy and Paste the API-Key from step three to the input field (Member Info Map API-Key).
Copy and Paste the name/ID of the first profile field you created to the input field (Member Info Map Data Field)
My profile field for the location is called 'field5' so I put 'field5' into that input field.

Copy and Paste the name/ID of the second profile field you created to the input field (Member Info Map Enabled Field)
My profile field that defines wether the user enabled or disabled his map is called 'field6' so I put 'field6' into that input field.


Fifth step:
Enable it via the Member Info Map ENABLED-setting

Now, encourage your users to edit their profile and add a location. :)


Version 1.1:
Fixes a stupid bug.
To update, either import the attached *.xml again or change the plugin manually.

Manual update:
Edit the plugin 'Member Info Map - member.php'.
Set the Hook Location to 'member_execute_start'.

Replace the Plugin PHP Code with this code:
if(($userinfo[$vbulletin->options['memberinfo_map_fieldenabled']] == 'yes') AND ($vbulletin->options['memberinfo_map_enabled'])) {
$memberinfo_map_userlocation = $vbulletin->input->clean($userinfo[$vbulletin->options['memberinfo_map_fielddata']], 'TYPE_STR');
$memberinfo_map_apikey = $vbulletin->options['memberinfo_map_apikey'];
eval('$template_hook[memberinfo_additionalinfo] = "' . fetch_template('memberinfo_map') . '";');
eval('$headinclude .= "' . fetch_template('memberinfo_mapcode') . '";');
}






Install this Mini Mod at own risk. I tested it once and it worked. And don't forget to click 'install'!! :)

Magnumutz
12-01-2007, 05:06 AM
w00t, First install.
Thanks dude, it's a great asset.

Robru
12-01-2007, 07:27 AM
Thanks for this marvelous hack :)

Catziggy
12-01-2007, 03:07 PM
Works great thanks

MrNase
12-02-2007, 09:33 AM
I'm glad it works for you. :)


One thing makes me wanna cry: 31 downloads and only 8 installs?:mad:

Catziggy
12-02-2007, 04:50 PM
I might have an issue.

My own location shows up perfectly but when i look at other peoples locations they all show as mine and even if people turn off the googlemap i still see them as my locations. Any ideas?

MrNase
12-02-2007, 05:05 PM
That's strange. I'll look into it ASAP. :)


1.1 is out which fixes that stupid bug. I should have known that $vbulletin->userinfo and $userinfo are two different pair of shoes. ;)

Catziggy
12-02-2007, 05:34 PM
Is it the current download? If so do i uninstal it and then reinstal or just overwrite the files?

MrNase
12-02-2007, 06:12 PM
You might just overwrite the old product with the new product but then you'll need to configurate it again.

I have posted the instructions on how to manually update it, you need to edit one plugin and that's it. :)

Catziggy
12-02-2007, 06:52 PM
still doesnt seem to be working for me

tried to do it both ways

manual editing first then overwrite

http://www.timelessgaming.com

can you check it out?

Jimandbob
12-02-2007, 07:08 PM
I have installed as per instructions but cannot get the map to show at all :confused:

www.freeneasy.co.uk/forum

DrKNickel
12-03-2007, 01:16 PM
I Installed it too and it just doesnt show up... any ideas?

Rs06 Ant
12-15-2007, 05:42 AM
Any update. Doesnt seem to work for me either!

mhc1576
12-15-2007, 07:34 AM
I have already 3 fields that combined will give a good input to Google.
Is it possible to modify Member Info Map Data Field ('memberinfo_map_fielddata' ex. field5) to combine the fields (ex. field20+field21+field22) instead of using a single field.

This is the code snippet I think:

$memberinfo_map_userlocation = $vbulletin->input->clean($vbulletin->userinfo[$vbulletin->options['memberinfo_map_fielddata']], 'TYPE_STR');

Does this hack work on < 3.6.8, eg. 3.6.5

Raptor
01-15-2008, 05:24 AM
map doesnt show at all for me either

vb 3.6.4

foodie
03-24-2008, 08:38 AM
br0ken here too...

Boofo
03-24-2008, 10:01 AM
I'm working on getting this to work on 3.7. I got it to show up but I need to get it in the right area now with the new profile. I'll let you know how I did it when I get it. ;)

Jens*
03-24-2008, 10:55 AM
Nase, very nice addon :)

Boofo, what did you do that it works with 3.7?

Boofo
03-24-2008, 11:30 AM
I had to edit the memberinfo_block_aboutme template and xml file but it is showing up. I just can't seem to get the arrow to point and saying which city it is over the map. I was thinking about putting it in one of the block boxes on the right. I also have the timezone hack installed so I have that too to contend with.

PGAmerica
06-13-2008, 08:50 PM
Can you at least tell us how you got it working in 3.7?

Cust0ms
02-15-2009, 09:26 AM
What is the link to the map on my board? :D

yahooooh
12-27-2009, 06:33 PM
i need this , any update to 3.8 plz