Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Direct link to vbgooglemap location Details »»
Direct link to vbgooglemap location
Version: 1.0.0, by stonyarc stonyarc is offline
Developer Last Online: Aug 2013 Show Printable Version Email this Page

Version: 3.5.4 Rating:
Released: 04-14-2006 Last Update: Never Installs: 23
Template Edits
 
No support by the author.

Direct link to the vbgooglemap location

Function:

Display a direct link in the postbit to the vbgooglemap location.


Prerequisits:

The forum must be running vbgooglemap 2.0.2 or higher.
Click https://vborg.vbsupport.ru/showthread.php?t=99920

Don't forget to hit install here and on the vbgooglemap thread !!!!!!!





Steps:

Add a field to your user (editable in profile) =>

vBulletin features a wide array of input options for you to gather information from your members through the creation of custom profile fields. With these fields you can present a list of options for the user to choose from or you can ask the user to give their own input.

STEP 1

Go to the adminCP and add a custom field => User Profile fields => Add New User Profile Field

You need a "Single-Line Text Box"

Title => googlemap
Description => vbgooglemap direct link
Default Value => Leave empty
Max length of allowed user input => 150
Display Size => 30
Display Order => put something like 10 or 15
Field Required => No as default but you can change if you want
Field Editable by User => Yes
Private Field => No the field is public
Field Searchable on Members List => No
Show on Members List => Yes
Regular Expression => leave empty

Save the field

Go to the User Profile Field Manager and look for your custom field you just added and look for the name column there is an ID for the field.
Something like "fieldXX" where XX is a number. Make sure you remember this value.


STEP 2

Go to the template you are using (Styles & Templates/Style Manager) and select Edit templates.

Go to "postbit templates" and select the template you are using (probably postbit or postbit_legacy).
and add the following code:

fieldXX is the field value you got from step 1.

You can embed the code in a div or a special table construction but that is up to you.

Code:
<if condition="$post[fieldXX]">
<a href="$post[fieldXX]" target=?_self?>$post[username]?s location</a>
</if>

(TIP: You can add this also to the MENBERINFO)

Entry of the data:

Go to ?your entry? on the googlemap (you have to logged in)
If you haven?t set your marker before the form will detect that. If you did enter the information you?ll see 3 text input boxes on top of the smaller map. The third on gives you the full URL to your location.

You can increase the zoom if you want, the link will adapt.

Make the user copy the string and go to the USER CP or edit profile

In USER CP paste the string in the googlemap field and you?re done. The postbit will now show a direct link to the map location for that user.

Feel free to support this mod and make a donation to admin@stonyarc.com



All code is (c)2006 StonyArc.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 04-17-2006, 05:56 PM
stonyarc stonyarc is offline
 
Join Date: Aug 2005
Location: Leuven (Belgium)
Posts: 930
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by cuphongle
very nice
Thanks Cuphongle,

I know it's a bit of work to install both the vbgooglemap 2.0.2 and this template modifications but I think it's worth it.

I find it very handy to be able to directly click on a postbit or memberinfo and get transfered to that users geo location on the map.

PS: I know I'm repeating myself but support for the map is in the other thread !!
Reply With Quote
  #13  
Old 04-17-2006, 06:28 PM
caliman's Avatar
caliman caliman is offline
 
Join Date: Jan 2005
Location: California
Posts: 256
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Would it be possible to have it only show the pins of the member you are looking at?
Reply With Quote
  #14  
Old 04-20-2006, 12:05 PM
stonyarc stonyarc is offline
 
Join Date: Aug 2005
Location: Leuven (Belgium)
Posts: 930
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mini2
Or, you could have two custom user fields, one the automatic one above, and another that users check themselves (radio button) called "link to location" or something, so they get a say in whether the icon shows up or not (of course, you just check for both in the postbit(_legacy).

I might do this myself if I get the time. I just feel your way involves too much effort on the part of the forum user.
I'll have a check if I can cook up something in the future version on vbgooglemap itself
Reply With Quote
  #15  
Old 04-28-2006, 11:18 AM
JoeWho JoeWho is offline
 
Join Date: Oct 2005
Posts: 77
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mini2
Have you considered making this automatic?

You could disable the field (not editable) run a check via scheduled tasks for an entry in the database and update the profilefield with the correct URL if there is one. Much the same way as I worked my vbadvanced gallery link in postbits (IF they have any images uploaded). Save user input, which is usually a good thing in my view.
mini2,

I agree...
I think this is a must, "making this automatic" or at lest make it so the default domain-address is automatic and the user just adds the data (lat=13.84411462921368&lng=-17.89286017417908&zoom=6) that would help!

Note: a user could put any web-address in the box... I don't have time to check them... do you want a link to a XXX web-site on your forum?:surprised:

Don't get me wrong I really like the idea of the link being in postbit's, but currently I consider this a security risk, what kind of data can be entered into that field, and what damage could be cause?

I just tested it, if the user hasn't filled in the information and someone clicks on a link in postbit it will open a blank page. I did set new registration to the default map page (Default Value = http//www.yourwebsite.com/forums/vbgooglemap.php) but what about all the users that are registered prior to this install, there is no data in that field. Yes... I know I could go into the database and manually insert this information... Oh' more fun.

.
Reply With Quote
  #16  
Old 04-28-2006, 12:46 PM
stonyarc stonyarc is offline
 
Join Date: Aug 2005
Location: Leuven (Belgium)
Posts: 930
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just to let you know that this feature will be default in the next version of the member map and manageable from backend.

No more copy thingy.

Still working on the best way to do it but mini and you have some nice ideas going on.

/EDIT
I'll try to make it so that no additional datamanipulation is needed.

Brrrr is that a plugin that I feel there
Reply With Quote
  #17  
Old 04-28-2006, 01:25 PM
rinkrat's Avatar
rinkrat rinkrat is offline
 
Join Date: Jan 2002
Location: Long Beach
Posts: 530
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm hitting Install but I'll wait till the info is automated if they have entered the info in the googlemap already. Great idea, this hack is a real community builder.
Reply With Quote
  #18  
Old 05-01-2006, 03:52 AM
randy. randy. is offline
 
Join Date: Apr 2006
Location: Ireland
Posts: 50
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

on my instalation all i get on the edit profile section is a textbox... where is the map??? i thought a link is to appear?
Reply With Quote
  #19  
Old 05-14-2006, 05:15 PM
volarium volarium is offline
 
Join Date: Mar 2005
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay guys, I'm having the strangest problem. I installed Mini2's version of the hack, and it appeared to be working perfectly. Then I realized that I was getting SQL errors on some threads. Not all threads, only some threads. Here is the error I'm getting:

Invalid SQL:
SELECT userid,lat_map,username,lng_map FROM googlemapme WHERE userid =;

Since this is the query from googlemap_check.php, I'm assuming it has to do with this hack. After trying for hours to resolve the issue, in the interest of fixing my board, I finally decided to uninstall. So I turned off the scheduled task, I removed the code from postbit_legacy, and I actually removed the custom user profile field completely.

The problem is still there! I don't understand how pulling up a specific thread would execute this query at all. The whole reason Mini2 did it this way is to AVOID executing a query everytime a thread is opened. I've looked everywhere, and I can't figure out where this query is being executed when opening a thread. I suspect no one can help me with this mystery, but I just thought I'd ask. I'm sure it's something stupid that I missed, but I'm at a loss as to what to try next.

http://vfrworld.com/forums/vbgooglemapme.php

Thanks for any thoughts you may have.
Reply With Quote
  #20  
Old 05-16-2006, 11:20 PM
volarium volarium is offline
 
Join Date: Mar 2005
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Update. I've narrowed down the problem to threads that contain a post by a user without a userID. Why would a user not have a userID? Two reasons:
1. I imported my boards from YABB, and some threads lost their corresponding user information (because the users had removed their accounts). These threads show up as being posted by "Guest".
2. I import messages from an external Listserv. These messages show the username from the Listserv, but since they were not posted by a user of my board, they do not have a userID.

However, I still can't figure out why the query would be executing. I removed the code from the postbit template, and removed the userfield containing the HTML.

Any ideas now?
Reply With Quote
  #21  
Old 05-17-2006, 12:37 AM
volarium volarium is offline
 
Join Date: Mar 2005
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey Mini! I really appreciate your reply. Here is what I modified your script to:

<?^M
////////////////////////////////////////////^M
// MAKE SURE YOU EDIT THIS WHERE STATED //^M
// Then upload to /includes/cron/ //^M
////////////////////////////////////////////^M
^M
// Edit - Make sure this is correct^M
define('FILE_VERSION', '3.5.2'); // this should match install.php^M
^M
error_reporting(E_ALL & ~E_NOTICE);^M
if (!is_object($vbulletin->db))^M
{^M
exit;^M
}^M
^M
// Edit this line to reflect your database structure^M
$map_query=$vbulletin->db->query_read("SELECT userid,lat_map,lng_map FROM ".TABLE_PREFIX."googlemapme");^M
^M
// Make sure you set this field to the correct number! and set the link URL to your own map!^M
while ($inids = $vbulletin->db->fetch_array($map_query)) {^M
$posid = $inids[userid];^M
$vbulletin->db->query_write("UPDATE ".TABLE_PREFIX."userfield SET field8 = '<a href=\"http://www.vfrworld.com/forums
/vbgooglemapme.php?lat=$inids[lat_map]&lng=$inids[lng_map]&zoom=9\"><u>Find Me!</u></a>' WHERE ".TABLE_PREFIX."userfield
.userid = $posid");^M
}^M
^M
log_cron_action("map task updated", $nextitem);^M
?>

I changed your mod to point to googlemapme, so I still think it might be related. I don't know why vbgooglemap would be causing problems in showthread.php. Does my code above help at all? I'm really at a loss. :-(

I appreciate you trying to help, even if we can't figure it out.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:25 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.05988 seconds
  • Memory Usage 2,313KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete