The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Direct link to vbgooglemap location Details »» | |||||||||||||||||||||||||
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
|
Comments |
#12
|
|||
|
|||
Quote:
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 !! |
#13
|
||||
|
||||
Would it be possible to have it only show the pins of the member you are looking at?
|
#14
|
|||
|
|||
Quote:
|
#15
|
|||
|
|||
Quote:
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. . |
#16
|
|||
|
|||
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 |
#17
|
||||
|
||||
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.
|
#18
|
|||
|
|||
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?
|
#19
|
|||
|
|||
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. |
#20
|
|||
|
|||
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? |
#21
|
|||
|
|||
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. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|