vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=192)
-   -   Show Thread Enhancements - Clickable user location using google maps (https://vborg.vbsupport.ru/showthread.php?t=145323)

4x4 Mecca 04-19-2007 10:00 PM

Clickable user location using google maps
 
Introduction:
Have you ever wondered where Orange, CA was? Well now you can click on a users location and it'll bring it up in a new window via google maps.

Hack Requirements:
None

Original Version 1.0
Installation:
Find
Code:

<if condition="$post['field2']"><div>$vbphrase[location_perm]: $post[field2]</div></if>
Replace it with
Code:

<if condition="$post['field2']"><div>$vbphrase[location_perm]: <a href="http://maps.google.com/maps?f=q&hl=en&q=$post[field2]" title="Find $post[username] on Google Maps!" target="_blank">$post[field2]</a></div></if>
UPDATE:
I've changed it from the complete location being a link, to an image of a globe before their location. The globe is now the link, it's a much cleaner install

Upgrade instructions:
FIND in your postbit, or postbit_legacy
Code:

<if condition="$post['field2']"><div>$vbphrase[location_perm]: <a href="http://maps.google.com/maps?f=q&hl=en&q=$post[field2]" title="Find $post[username] on Google Maps!" target="_blank">$post[field2]</a></div></if>
REPLACE WITH
Code:

<if condition="$post['field2']">
<div>$vbphrase[location_perm]: <a href="http://maps.google.com/maps?f=q&hl=en&q=$post[field2]" title="Find $post[username] on Google Maps!" target="_blank"><img class="inlineimg" src="images/globe.gif" alt="Find $post[username] on Google Maps!" border="0" /></a> $post[field2]
</div></if>


Fresh install of new version

FIND in your postbit, or postbit_legacy
Code:

<if condition="$post['field2']"><div>$vbphrase[location_perm]: $post[field2]</div></if>
REPLACE WITH
Code:

<if condition="$post['field2']">
<div>$vbphrase[location_perm]: <a href="http://maps.google.com/maps?f=q&hl=en&q=$post[field2]" title="Find $post[username] on Google Maps!" target="_blank"><img class="inlineimg" src="images/globe.gif" alt="Find $post[username] on Google Maps!" border="0" /></a> $post[field2]
</div></if>


Demo:
4x4Mecca.com

4x4 Mecca 04-20-2007 04:48 AM

I don't need to reserve this post :)

HMBeaty 04-20-2007 04:58 AM

To work with MEMBERINFO, change
HTML Code:

$post['field2']
To
HTML Code:

$userinfo['field2']

4x4 Mecca 04-20-2007 05:01 AM

Thanks! I'm new to this, should I update the mod with that option for users with an older version or something?

HMBeaty 04-20-2007 05:03 AM

Quote:

Originally Posted by 4x4 Mecca (Post 1231730)
Thanks! I'm new to this, should I update the mod with that option for users with an older version or something?

MEMBERINFO should be in all in versions. Thats the template for the members profile page. The postbit and profile page just use 2 different variables

EDIT: However, you may want to rephrase your installation instructions and change "Find" to something like "In postbit/posbit_legacy find...."

PoetJA-1975 04-26-2007 03:51 AM

Thanx for sharing this modification.
Question: What if someone has a "parody" as their location?
example = Location: Cyberspace, Tennessee

Jacquii.

4x4 Mecca 04-28-2007 10:52 PM

Then google maps finds some silly results.... A member on my board has "So Cal"
Another has "At Home"

PoetJA-1975 04-29-2007 02:39 AM

LOL - OK - Thanx for the mod ;)

Jacquii.

Chicago_VLNU_4s 05-07-2007 10:53 PM

seems decent but if people are spelling their city, not everyone will spell it right meaning no results. Like for example, Chicago. Some of us spell it "Chicago", "Chi-Town", "Chi Town", "Windy City", "The GO" ect.

l3it3r 05-08-2007 10:20 AM

And you'll get interesting results in google.
I made a similar mod for phpBB3 nice work.


All times are GMT. The time now is 09:09 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02007 seconds
  • Memory Usage 1,739KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (2)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete