vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Mini Mods - [DBTech] Member Map v1 (vB4) (https://vborg.vbsupport.ru/showthread.php?t=293495)

DragonByte Tech 02-05-2015 09:05 PM

Quote:

Originally Posted by Gadget_Guy (Post 2536344)
I just installed mod_geoip on my server.

I think I did it correctly, however, the member map is no different afterwards.

Do I need to wait for it to update the member map?

Is there any way for me to test to see if it is working?

D.

Your best bet may be to try a reinstall, as I believe if the mod detects an IP can't be resolved it will flag it to avoid re-testing in the future.


Fillip

Gadget_Guy 02-05-2015 09:38 PM

Is there a DB table or file I can clear so that it does the lookup again?

When I run the Cron it returns a value of 0 probably because it has already looked up the IPs already.

D.

Scalemotorcars 02-11-2015 01:51 PM

Quote:

Originally Posted by Gadget_Guy (Post 2536362)
Is there a DB table or file I can clear so that it does the lookup again?

When I run the Cron it returns a value of 0 probably because it has already looked up the IPs already.

D.

Sounds like you have the same problem as me. No GeoIp on your server.

If you can't add it yourself or if your host will not then you're kind of screwed. Uninstall and move on is my best advice. :o

DragonByte Tech 02-11-2015 10:07 PM

Quote:

Originally Posted by Gadget_Guy (Post 2536362)
Is there a DB table or file I can clear so that it does the lookup again?

When I run the Cron it returns a value of 0 probably because it has already looked up the IPs already.

D.

Uninstall / reinstall is the fastest way of ensuring you start from scratch :)

I'm not the original developer of this modification, so I don't know the table name off the top of my head.


Fillip

SuperTaz 03-29-2015 02:25 AM

1 Attachment(s)
How do I make the background darker on the pin information area? It shows as white and I need it darker. screen shot is attached. And also how do I fix the icon to the left side?

xorlof 04-16-2015 03:38 PM

I made a couple of modifications to this mod which are reasonably straightforward. Here are few tips if you want to make similar ones:

1) We didn't want an opt-out system, we wanted an opt-in system. To do so, before installing edit the XML so that the opt-out database flag is "1" by default for all users. Then change geoip_locate.php so it does do a location lookup even if someone is opted out (otherwise all users will have to find their pins at latitude/longitude 0,0). Finally to edit the "opt out" phrase to say "Do not show me on this map". Unchecking that box is how people opt in.

2) I made it so that a user's own pin is a different color from the rest of the pins. To do that, I edited membermap.php, appending to $colors with a usergroupid of "9999" with a color of "79604c". Then in the template dbtech_membermap_info template I set the "data-ugid" to 9999 for the user's marker.

These aren't elegant ways to add those two features, but they are the simplest, requiring the least amount of code modification. I can type up step-by-step instructions to do the above if there are requests.

I've got a couple of other ideas that sound simple to implement too: 1) making sure a user's pin is always on top to make it easy to find and drag, and 2) when a user's location is detected, the detected latitude and longitude should be offset by a random small amount and have that stored to the database instead. That helps avoid having many map markers stacked exactly on top of each other for those times that the GeoIP database gives the exact same location to all users in a given city (for example).

xorlof 04-17-2015 02:10 PM

More fix-ups for this plugin. To make it work on phones, you need to do a couple of things:

1) fix the super zoomed in view of your template:

In the template dbtech_membermap_home, find the line that begins:

<meta name="viewport"

and replace it with:

<meta name="viewport" content="width=device-width, initial-scale=0.5, maximum-scale=0.5, user-scalable=no" />

Your site's style may not look perfect with this setting, but it will help a lot.

2) Make it so that you can select markers and see the users, find this block of code:
Code:

                                google.maps.event.addListener(marker, 'mouseover', function()
                                {        //set popups on hover
                                        if (lastopen != infowindow)
                                        {
                                                if (lastopen) lastopen.close();
                                                infowindow.open(map,marker);
                                                lastopen = infowindow;
                                        }
                                });

and after it, ADD this block of code
Code:

                                google.maps.event.addListener(marker, 'click', function()
                                {        //set popups on click
                                        if (lastopen != infowindow)
                                        {
                                                if (lastopen) lastopen.close();
                                                infowindow.open(map,marker);
                                                lastopen = infowindow;
                                        }
                                });

Huzzah, it works on mobile!

oldwillysforum 04-17-2015 02:26 PM

Quote:

Originally Posted by xorlof (Post 2543239)
I can type up step-by-step instructions to do the above if there are requests.

I'm a total hamb-fist when it comes to coding, but I'd love to change the user-pin color. A step by step tutorial would be great...

Thanks,

Pete

xorlof 04-17-2015 03:49 PM

Quote:

Originally Posted by oldwillysforum (Post 2543351)
I'm a total hamb-fist when it comes to coding, but I'd love to change the user-pin color. A step by step tutorial would be great...

Sure, it takes two steps:

STEP 1: In the template dbtech_membermap_info, find:
Code:

<div title="{vb:raw user.username}" data-latitude="{vb:raw user.dbtech_membermap_lat}" data-longitude="{vb:raw user.dbtech_membermap_lng}" data-ugid="{vb:raw user.usergroupid}" data-myself="<vb:if condition="$vbulletin->userinfo['userid'] == $user['userid']">1<vb:else />0</vb:if>" data-move="<vb:if condition="$moveable">1<vb:else />0</vb:if>">
and REPLACE it with this
Code:

<div title="{vb:raw user.username}" data-latitude="{vb:raw user.dbtech_membermap_lat}" data-longitude="{vb:raw user.dbtech_membermap_lng}" <vb:if condition="$vbulletin->userinfo['userid'] == $user['userid']">data-ugid="9999" data-myself="1"<vb:else />data-ugid="{vb:raw user.usergroupid}" data-myself="0"</vb:if>" data-move="<vb:if condition="$moveable">1<vb:else />0</vb:if>">
STEP 2: In membermap.php, find:
Code:

foreach ($vbulletin->usergroupcache AS $ugid => $uginfo)
{      //format the usergroup colors
        if (!($uginfo['dbtech_membermap_perms'] & 2))
        {      //not excluded
                $color = $uginfo['dbtech_membermap_color'];
                $groups .= '<option style="color: #' . $color . ';" value="' . $ugid . '">' . $uginfo['title'] . '</option>';
                $colors .= ", $ugid: '$color'";
                $validugs[] = $ugid;
        }
}

and after that ADD:
Code:

//Add in a special color representing the current user
$colors .= ", 9999: '79604c'";

the 79604c in the line above represents the color that the user's pin will appear as, which is a medium brown, but you can change it to whatever color you want. If you're not familiar with the scheme, just use one of the "hex codes" listed on this page, but exclude the pound sign.

Since these are manual edits, if you ever update the plugin to a new version, you may have to reapply these changes.

oldwillysforum 04-17-2015 07:51 PM

Quote:

Originally Posted by xorlof (Post 2543366)
Sure, it takes two steps

Awesome, thanks. Made the edits, and it works great.

Pete


All times are GMT. The time now is 11:50 PM.

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.01438 seconds
  • Memory Usage 1,760KB
  • 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
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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