News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Google Member Map

Started by Spuds, December 12, 2007, 01:49:12 PM

Previous topic - Next topic

2Ntense

Yep, you missed one edit.  Find:
'local_time' => timeformat(time() + ($profile['timeOffset'] - $user_info['time_offset']) * 3600, false),

after that add:
'googleMap' => array(
'latitude' => $profile['latitude'],
'longitude' => $profile['longitude'],
),


or just upload the new Load.php (already corrected)  O:)

ukcord_viper

You my friend are a superstar......

Thanks you very much. :D

celedhrim

Hi ,
this mod is a great mod ! thx

I integrate to my wow guild site but I have a small issue

my theme is very dark and googlemap background is very clear , but text keep my theme default (white) . So I can't see font

see screenshot , I use my mouse to highlight the begin of the name but the end still rest white on white

If someone could help me to change sidebar , bubble and bottom legend background to dark , It will very nice

ps: excuse me for my english , I'm french ^^


Omniverse

Heyas... I noticed lately that the map display has disappeared in my profile (or anyone's I look at). Not sure whats causing it. Couldn't find another that had something similar... so was wondering if this is something you have heard of.

brianjw

Have you done anything to your site lately?
- Change themes?
- Upgrade?
- Etc.

brianjw

Omniverse

Yes I have...

but I swear it worked when I was done hehe.

I even went through any files relating to the membermap in the profile, and its all there... so wasn't sure why it's not showing now.

brianjw

I don't know what to tell you. Can you PM me with ftp login information so I can see if the code is all there?

Omniverse

I'm going to be occupied for the rest of the day... I'll send a PM later (sometime in the next couple days if I don't forget) and we see if you can figure it out. :P

2Ntense

The map in the PROFILE SUMMARY doesn't have *anything* in it that should give you grief.  If it's been barfing then you have some SERIOUS issues on your forum.  The 'Profile Summary' map merely pulls the LAT/LON from the profile and then drops it into the small chunk of GoogleMap API script.  The map in your 'Forum Profile Information' goes a little farther, but unless you've added the SEARCH box then it's also very simple Javascript with a short chunk that loads the LAT/LON.

If you have issues with either of those, then the main MEMBER MAP must be falling over and dying.  If it's working OK then you've installed some new mod that buggered your profiles.  In that event you'll have to look very carefully at the two insert points in the Profile.template.php.  It's far less likely that any mod could mess up what changed in Profile.php.

Brian... your forum is still hosed.  All I get after a login is a white screen (obvious PHP parse error)

brianjw

2Ntense, check out my site. ;)

2Ntense

Been there several times in the last few days... same story with FF (the ONLY browser for everyday use) and IE6.  FF displays a blank page after login, and that's all I've ever seen.  IE6 does something similar, hangs and then eventually shows a broken URL and the stock "sorry, we can't connect to that page, maybe the server is experiencing difficulties, yadda, yadda, yadda."

here's the URL I get after IE login: http://www.gamerzgarage.com/index.php/action,login2.html
which looks to me like something is rewriting the URL incorrectly.  I suspect your portal, but that's a SWAG <Scientific Wild-#ssed Guess>

FF doesn't even show that... it hangs for about 20 seconds and then shows the previous URL but with a blank page.  I've tried clearing the cache repeatedly, no dice.  If I delete the cookie, all is well and the site comes back but I'm not logged in.

What I'm seeing WITHOUT logging in is that you've enabled the PHPSESSION function, which is probably crashing against the cookie for security.  Personally I'd disable the session ID, as it's easier to do some nasty hacks with that.  I backtracked and found out that one bright hacker kiddie had used that to backdoor our ADMIN login on an Invision Powerboard forum.

brianjw

The page is supposed to be loading as an html page. We have search engine friendly urls enabled, but after upgrading to 1.1.5 it made it work like this all the waty. :) Where can I disable the PHPSESSION

donato

Hello Thanks Brianjw for an amazing add-on to the board.
I need some help - my MemberMap is missing on my custom theme (PDX-DK)
when i switch to my default theme, the member map button/tab appears in the nav, but on my custom theme it does not.
I read over some of the posts and I confirmed that the data found in my default/index.template and my pdx/index.template are the EXACT same in regards to the button location - at least from what i can tell.

One item i noticed that differs between the PDX and default themes are the div tags surrounding the tab buttons on PDK - and, as you know,  the google membermap link, it uses TD tags - could this be why? do I have to convert the code around the div class? if so, can anyone assist me on this? My knowledge of php is low

Here is an example of the member list button with the div class as appears on my custom theme:
// the [member] list button
if ($context['allow_memberlist'])
echo ($current_action == 'mlist' || $context['browser']['is_ie4']) ? '' : '' , '
<div class="maintab_' , $current_action == 'mlist' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=mlist">' , $txt[331] , '</a>
</div>' , $current_action == 'mlist' ? '<div class="seperator"><!--no content--></div>' : '<div class="seperator"><!--no content--></div>';


Here is the code around the memberlist tab on the default theme:

// the [member] list button
if ($context['allow_memberlist'])
echo ($current_action == 'mlist' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'mlist' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=mlist">' , $txt[331] , '</a>
</td>' , $current_action == 'mlist' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


Here is the code I manually added to my pdx/index.template.php file for the googlemember Map:

// Google Maps Mod
if (($modSettings['googleMapsEnable']) && (allowedTo('googleMap_view')))
echo ($current_action == 'googlemap' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'googlemap' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=googlemap">' , $txt['googleMap'] , '</a>
</td>' , $current_action == 'googlemap' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


Any help would be greatly appreciated!!!

2Ntense

Brian: I think the problem is in the SMF cookie itself, and may well be the SEF stuff... if I delete JUST the SMF cookie I can get your page to show again.


Donato:

The way I added it on all of my custom themes was to duplicate an existing button code FROM THE CUSTOM THEME, only replacing the bits that were specific to the GoogleMap.  I think your custom theme button code should be:

// the [member map] button
global $modSettings;
if (($modSettings['googleMapsEnable']) && (allowedTo('googleMap_view')))
      echo ($current_action == 'googlemap' || $context['browser']['is_ie4']) ? '' : '' , '
            <div class="maintab_' , $current_action == 'googlemap' ? 'active_back' : 'back' , '">
               <a href="', $scripturl, '?action=googlemap">' , $txt['googleMap'] , '</a>
            </div>' , $current_action == 'googlemap' ? '<div class="seperator"><!--no content--></div>' : '<div class="seperator"><!--no content--></div>';


I'll bet you forgot to add $modSettings to the GLOBAL at the top of the function, too.  Without that, the button will never show.  I'd seen FlashChat Integration do as I've shown above (adding the variable into the button), and it works fine.  It's supposed to go in the GLOBAL at the top of the function, but it works perfectly well down in the code, too; it's just sloppier code that way.


However, there's another thing you need to do in index.template.php.

At the top of that function (// Show the menu up top. Something like [home] [help] [profile] [logout]...)
you'll see the section that's setting the current action.  You need to add:
if ($context['current_action'] == 'googlemap')
$current_action = 'googlemap';

somewhere in there with the rest of the $current_action settings (they all look very similar).  It's not location-sensitive, just add it after any of the others.

All of the extra junk in the button code is how each specific theme creates the button strip, so you need to copy the method used in your custom theme as closely as possible.  Duplicating an existing button from the custom theme and just changing out the top line and then changing the CURRENT ACTION and TXT is all you normally should do.  I've changed about 15 themes to add the button.

2Ntense

celedhrim,

In themes/default/GoogleMap.template (near the top of the file),  replace that whole chunk of inline CSS with this:
/* Google Maps */
.googleMaps
{

font-size: small;
font-family: tahoma, sans-serif;
}
.googleMapsSidebar
{
   
    font-size: x-small;
    font-family: tahoma, sans-serif;
    margin: 0px;
   
    overflow: auto;
    width: 150px;
    height: 500px;
}
.googleMapsLegend
{
   
    font-size: x-small;
    font-family: tahoma, sans-serif;
    margin: 0px;
   
    overflow: auto;
}
/* Google Maps Links */
a.googleMapsLink:link, a.googleMapsLink:visited, a.googleMapsLink:hover
{

font-size: small;
font-family: tahoma, sans-serif;
}
/* Balloon text */
#map a:link{
    color: #476C8E;
}
#map a{
    color: #476C8E;
}

#map a:active{
    color: #ff0000;
}

#map a:hover{
    color: #000;
}


The older versions of the mod had color assignments for the font and background, which conflicted with whatever theme you were using.  This way the sidebar and legend font colors and background inherit from the theme.  I *think* that this has changed in the current beta version; if not then the fix above will correct it.

Note that I also did not add any of the css changes to any of my custom themes, only the changes that were done to the default theme style.css.

The /* Balloon text */ part above that Brian had pointed out only corrects the information balloon on the map itself, and for this balloon the color MUST be inside this template so that your theme does not try to override it.  I played around trying to get the balloon to inherit your theme background, and could not get it to work so this locks the text and link font colors.

donato

Hey 2Ntense - awesome response and appreciate the time!
However, i tired implementing your change but to no avail.
I get the following error when I implemented your code rework:

QuoteTemplate Parse Error!
There was a problem loading the /Themes/pdx-dk115v1/index.template.php template or language file. Please check the syntax and try again - remember, single quotes (') often have to be escaped with a slash (\). To see more specific error information from PHP, try accessing the file directly.

You may want to try to refresh this page or use the default theme.
--------------------------------------------------------------------------------

syntax error, unexpected T_BOOLEAN_AND


To add more info, I did already have the function calls listed:

// The main sub template above the content.
function template_main_above()
{
global $context, $settings, $options, $scripturl, $txt, $forum_version, $language, $modSettings, $colorpath, $buttonpath;


and here...
// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;


And also listed the context call:
if ($context['current_action'] == 'googlemap')
$current_action = 'googlemap';


I also tried what you suggested by looking at a previous buttons listed in my custom theme (using BeyondCompare) and found no real difference to what you created except for the "global $modSettings;" line. My small little edit:

// Google Maps Mod
if (($modSettings['googleMapsEnable']) && (allowedTo('googleMap_view')))
      echo ($current_action == 'googlemap' || $context['browser']['is_ie4']) ? '' : '' , '
            <div class="maintab_' , $current_action == 'googlemap' ? 'active_back' : 'back' , '">
            <a href="', $scripturl, '?action=googlemap">' , $txt['googleMap'] , '</a>
                      </div>' , $current_action == 'googlemap' ? '<div class="seperator"><!--no content--></div>' : '<div class="seperator"><!--no content--></div>';


...this too produced the same error. I really do not see a difference in your change to what the buttons already look like.
Note: If i change the membermap button to the default recommended values from the instructions, the parse error goes away - so i do believe this is the only file to edit
Again anyhelp would be much appreciated.
Thanks again mate!

Force73

#457
Hi :-) Nice work, but a stupid problem ...

there where a installed Mapmod in my Board, some months ago. Then I installed 1.1.4 completly new, only the DB-settings of the where intact I think. Today I updated to 1.1.5 and installed the new version of this mod.

Its running fine, but I cannot re-set my PIN (new position will not be saved). Also new members cannot set their Pin, it will not be saved also.

There are 30 people on board with Pin-Settings, the Map show them all, but mh... no one new can enter and no one on the Map can change position.


What I know:

In Userprofile (if I click on a new map position) the javascript works well and set the input-type:hidden files for longitude and latitude to the new value,
but not within the

//<![CDATA[
function LoadMap() {

(there are the last actual values)

But then, after "save", it will not be written to the member-Table in the DB. :-(


Can anyone help me out with this?

brianjw

Are you saying that the map is in the profile, but when you change the position it doesn't save?
Hmmm, I am not quite sure. It's definitely a db issue but I don't know how to solve it..

Force73

Quote from: brianjw on June 04, 2008, 02:28:14 PM
Are you saying that the map is in the profile, but when you change the position it doesn't save?
Hmmm, I am not quite sure. It's definitely a db issue but I don't know how to solve it..

Read again please, within the function loadMap it does'nt put the new values in.
Where is the position in the scripts, where data will be saved?

Advertisement: