News:

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

Main Menu

Location Mod

Started by Gobalopper, November 19, 2004, 01:43:12 AM

Previous topic - Next topic

zillion

I'm happy; the Mod's working perfectly for me  :)

But I'd like a zoomed-in map of north-west England since one of my Forums has most of its members in one small geographic area.  So I've cut 'n' copied a part of the UK map, managed to work-out the correct X & Y co-ordinates (well, near enough!), enlarged it to roughly the pixel-size of the UK map,  and the map works.  My intention is to add a few geographical features (maybe the motorway network) to help the geographically challenged to place their pins in something like the correct position!

The only trouble is it displays on-screen in a very small size, even though the gif file is of similar pixel size to the UK gif.  So does anyone know how to get the gif to display bigger on-screen?  I'm sure someone else has asked this before, but I'm beggared if I can find that post!

edi67

Quote from: din1031 on January 18, 2005, 12:40:00 AM
Search this in the who.template.php of you theme or in the default directory


<td width="25" align="center">', (empty($member['flag'][0]) ? '' : '<img src="' . $settings['default_images_url'] . '/flags/' . strtolower($member['flag'][0]) . '.png" alt="' . $member['flag'][1] . '" title="' . $member['flag'][1] . '" />'), '</td>


For somthing like this example:

Replace the code with this :)

<td width="25" align="center">', (empty($member['flag'][0]) ? '' : '<img src="' . $settings['default_images_url'] . '/flags/' . strtolower($member['flag'][0]) . '.png" alt="' . $member['flag'][1] . '" title="' . $member['flag'][1] . '" />'), '</td><td>


this is correctly that i want, i inserted it but not work for me....

i attach my code look:
Quote<?php

// The only template in the file.
function template_main()
{
   global $context, $settings, $options, $scripturl, $txt;

   // Display the table header and linktree.
   echo '
   <div style="padding: 3px;">', theme_linktree(), '</div>
   <table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder">
   <tr>
   <td class="catbg">', $txt['users'] , '</td></tr></table>
   <table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder">
      <tr class="titlebg">
         <td width="30%"><a href="' . $scripturl . '?action=who;start=', $context['start'], ';sort=user', $context['sort_direction'] == 'down' && $context['sort_by'] == 'user' ? ';asc' : '', '">', $txt['who_user'], ' ', $context['sort_by'] == 'user' ? '<img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>
         <td style="width: 14ex;"><a href="' . $scripturl . '?action=who;sort=time', $context['sort_direction'] == 'down' && $context['sort_by'] == 'time' ? ';asc' : '', '">', $txt['who_time'], ' ', $context['sort_by'] == 'time' ? '<img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>
         <td>', $txt['who_action'], '</td>
      </tr>';

   // This is used to alternate the color of the background.
   $alternate = true;

   // For every member display their name, time and action (and more for admin).
   foreach ($context['members'] as $member)
   {
// Skip anyone who is a guest.
if ($member['id'] == 0)
   continue;

      // $alternate will either be true or false.  If it's true, use "windowbg2" and otherwise use "windowbg".
      echo '
      <td width="25" align="center">', (empty($member['flag'][0]) ? '' : '<img src="' . $settings['default_images_url'] . '/flags/' . strtolower($member['flag'][0]) . '.png" alt="' . $member['flag'][1] . '" title="' . $member['flag'][1] . '" />'), '</td>
      <tr class="windowbg', $alternate ? '2' : '', '">
         <td>';

      // Guests don't have information like icq, msn, y!, and aim... and they can't be messaged.
      if (!$member['is_guest'])
      {
         echo '
            <div style="float: right; width: 14ex;">
               ', $context['can_send_pm'] ? '<a href="' . $member['online']['href'] . '" title="' . $member['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $member['online']['image_href'] . '" alt="' . $member['online']['text'] . '" border="0" align="middle" />' : $member['online']['text'], $context['can_send_pm'] ? '</a>' : '', '
               ', $member['icq']['link'], ' ', $member['msn']['link'], ' ', $member['yim']['link'], ' ', $member['aim']['link'], '
            </div>';
      }

      echo '
            <span', $member['is_hidden'] ? ' style="font-style: italic;"' : '', '>', $member['is_guest'] ? $member['name'] : '<a href="' . $member['href'] . '" title="' . $txt[92] . ' ' . $member['name'] . '"' . (empty($member['color']) ? '' : ' style="color: ' . $member['color'] . '"') . '>' . $member['name'] . '</a>', '</span>';

      if ($context['user']['is_admin'])
      {
         $user_agent = isset($member['query']['USER_AGENT']) ? $member['query']['USER_AGENT'] : '';
         $agent = '';

         $known_agents = array('Firefox','Firebird', 'Opera', 'Safari', 'Googlebot', 'Googlebot-Image', 'Mediapartners-Google', 'Netscape', 'MyIE2', 'Konqueror', 'Galeon', 'Inktomi Slurp', 'Ask Jeeves', 'ia_archiver', 'Scooter', 'FAST-WebCrawler', 'Yahoo! Slurp', 'MSNBot', 'NG/2.0');
         foreach ($known_agents as $known)
            if (strpos(strtolower($user_agent), strtolower($known)) !== false)
            {
               $agent = $known;
               break;
            }

         if ($agent == '')
         {
            if (strpos($user_agent, 'Mozilla/4.') !== false)
               $agent = 'Netscrape 4';
            if (strpos($user_agent, 'Gecko') !== false)
               $agent = 'Mozilla';
            elseif (preg_match('~(MSIE\s+[^;)]+)~', $user_agent, $match) == 1)

               $agent = $match[1];
            elseif ($user_agent != '')
               $agent = 'MSIE';
            else
               $agent = '???';
         }

         echo ' <br /> <span class="smalltext">(<b><a href="' . $scripturl . '?action=trackip;searchip=' . $member['ip'] . '" target="_blank" title="' . $member['ip'] . '" class="smalltext2">' . $member['ip'] . '</a></b>, <acronym title="' . $user_agent . '">' . $agent . '</acronym>)</span>';

         unset($member['query']['USER_AGENT']);
         $query = '';
         foreach ($member['query'] as $k => $v)
            $query .= $k . ($v == '' ? '' : '=' . $v) . ';';
         $member['action'] = '<span title="' . $scripturl . '?' . substr($query, 0, -1) . '">' . $member['action'] . '</span>';
      }

      echo '
         </td>
         <td nowrap="nowrap">', $member['time'], '</td>
         <td>', $member['action'], '</td>
      </tr>
      
      ';

      // Switch alternate to whatever it wasn't this time. (true -> false -> true -> false, etc.)
      $alternate = !$alternate;
   }
   echo '<tr class="titlebg">
         <td colspan="3"><b>', $txt[139], ':</b> ', $context['page_index'], '</td>
      </tr>
   </table><br>

   <table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder">
   <tr>
   <td class="catbg">', $txt['guests'] , '</td></tr></table>
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder">
      <tr class="titlebg">
         <td width="30%">&nbsp;</td>
         <td style="width: 14ex;"><a href="' . $scripturl . '?action=who;sort=time', $context['sort_direction'] == 'down' && $context['sort_by'] == 'time' ? ';asc' : '', '">', $txt['who_time'], ' ', $context['sort_by'] == 'time' ? '<img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" border="0" />' : '', '</a></td>
         <td>', $txt['who_action'], '</td>
      </tr>';

   // This is used to alternate the color of the background.
   $alternate = true;

   // For every member display their name, time and action (and more for admin).
   foreach ($context['members'] as $member)
   {
// Skip anyone who is not a guest.
if ($member['id'] != 0)
   continue;

      // $alternate will either be true or false.  If it's true, use "windowbg2" and otherwise use "windowbg".
      echo '
      <td width="25" align="center">', (empty($member['flag'][0]) ? '' : '<img src="' . $settings['default_images_url'] . '/flags/' . strtolower($member['flag'][0]) . '.png" alt="' . $member['flag'][1] . '" title="' . $member['flag'][1] . '" />'), '</td>
      <tr class="windowbg', $alternate ? '2' : '', '">
         <td>';

      // Guests don't have information like icq, msn, y!, and aim... and they can't be messaged.
      if (!$member['is_guest'])
      {
         echo '
            <div style="float: right; width: 14ex;">
               ', $context['can_send_pm'] ? '<a href="' . $member['online']['href'] . '" title="' . $member['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $member['online']['image_href'] . '" alt="' . $member['online']['text'] . '" border="0" align="middle" />' : $member['online']['text'], $context['can_send_pm'] ? '</a>' : '', '
               ', $member['icq']['link'], ' ', $member['msn']['link'], ' ', $member['yim']['link'], ' ', $member['aim']['link'], '
            </div>';
      }

      echo '
            <span', $member['is_hidden'] ? ' style="font-style: italic;"' : '', '>', $member['is_guest'] ? $member['name'] : '<a href="' . $member['href'] . '" title="' . $txt[92] . ' ' . $member['name'] . '"' . (empty($member['color']) ? '' : ' style="color: ' . $member['color'] . '"') . '>' . $member['name'] . '</a>', '</span>';

      if ($context['user']['is_admin'])
      {
         $user_agent = isset($member['query']['USER_AGENT']) ? $member['query']['USER_AGENT'] : '';
         $agent = '';

         $known_agents = array('Firefox','Firebird', 'Opera', 'Safari', 'Googlebot', 'Googlebot-Image', 'Mediapartners-Google', 'Netscape', 'MyIE2', 'Konqueror', 'Galeon', 'Inktomi Slurp', 'Ask Jeeves', 'ia_archiver', 'Scooter', 'FAST-WebCrawler', 'Yahoo! Slurp', 'MSNBot', 'NG/2.0');
         foreach ($known_agents as $known)
            if (strpos(strtolower($user_agent), strtolower($known)) !== false)
            {
               $agent = $known;
               break;
            }

         if ($agent == '')
         {
            if (strpos($user_agent, 'Mozilla/4.') !== false)
               $agent = 'Netscrape 4';
            if (strpos($user_agent, 'Gecko') !== false)
               $agent = 'Mozilla';
            elseif (preg_match('~(MSIE\s+[^;)]+)~', $user_agent, $match) == 1)

               $agent = $match[1];
            elseif ($user_agent != '')
               $agent = 'MSIE';
            else
               $agent = '???';
         }

         echo ' <br /> <span class="smalltext">(<b><a href="' . $scripturl . '?action=trackip;searchip=' . $member['ip'] . '" target="_blank" title="' . $member['ip'] . '" class="smalltext2">' . $member['ip'] . '</a></b>, <acronym title="' . $user_agent . '">' . $agent . '</acronym>)</span>';

         unset($member['query']['USER_AGENT']);
         $query = '';
         foreach ($member['query'] as $k => $v)
            $query .= $k . ($v == '' ? '' : '=' . $v) . ';';
         $member['action'] = '<span title="' . $scripturl . '?' . substr($query, 0, -1) . '">' . $member['action'] . '</span>';
      }

      echo '
         </td>
         <td nowrap="nowrap">', $member['time'], '</td>
         <td>', $member['action'], '</td>
      </tr>';

      // Switch alternate to whatever it wasn't this time. (true -> false -> true -> false, etc.)
      $alternate = !$alternate;
   }
   echo '<tr class="titlebg">
         <td colspan="3"><b>', $txt[139], ':</b> ', $context['page_index'], '</td>
      </tr>
   </table>';
}

?>
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Midgard

http://www.forumzoneru.25.com1.ru/index.php?action=mm

An Error Has Occurred!
You cannot view the member map. 

My permissions... Not allowed me... ;)

edi67

Quote from: Midgard on January 18, 2005, 06:33:37 AM
http://www.forumzoneru.25.com1.ru/index.php?action=mm

An Error Has Occurred!
You cannot view the member map. 

My permissions... Not allowed me... ;)

allowed to full forum now
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

edi67

this errors means that there is some problem putting the flag in profile ?

Jessy   Oggi alle 12:31:27 
213.82.100.243     fc8027aeec9749248748445087476580 
http://www.forumzoneru.25.com1.ru/index.php?action=profile 
8: Undefined index: name
File: /home/forumzo7/public_html/Sources/Load.php
Linea: 617

   caco   Oggi alle 12:33:25 
80.105.56.49     2ab3ce4261079e2b38e662131d5e1cc4 
http://www.forumzoneru.25.com1.ru/index.php?action=profile;u=105 
8: Undefined index: country
File: /home/forumzo7/public_html/Sources/Load.php
Linea: 616
 

???
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Midgard

Quote from: edi67 on January 18, 2005, 06:42:25 AM
Quote from: Midgard on January 18, 2005, 06:33:37 AM
http://www.forumzoneru.25.com1.ru/index.php?action=mm

An Error Has Occurred!
You cannot view the member map. 

My permissions... Not allowed me... ;)

allowed to full forum now

Woow! Thank you...

Midgard

Quote from: edi67 on January 18, 2005, 06:43:33 AM
this errors means that there is some problem putting the flag in profile ?

Jessy   Oggi alle 12:31:27 
213.82.100.243     fc8027aeec9749248748445087476580 
http://www.forumzoneru.25.com1.ru/index.php?action=profile 
8: Undefined index: name
File: /home/forumzo7/public_html/Sources/Load.php
Linea: 617

   caco   Oggi alle 12:33:25 
80.105.56.49     2ab3ce4261079e2b38e662131d5e1cc4 
http://www.forumzoneru.25.com1.ru/index.php?action=profile;u=105 
8: Undefined index: country
File: /home/forumzo7/public_html/Sources/Load.php
Linea: 616
 

???

You find 'name' and 'country'

Normal: name
Normal: country

Replace with: 'name'
Replace with: 'name'

(you add single quote item ('))

edi67

mh i have tehm so:

   'country' => $profile['country'],
'name' => $profile['name'],


i think already correct.
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

ディン1031

#188
Quote from: edi67 on January 18, 2005, 07:02:38 AM
mh i have tehm so:

   'country' => $profile['country'],
'name' => $profile['name'],


i think already correct.
Watch the Post #167 in this thread and you have the answer ;)

----

Quote from: edi67 on January 18, 2005, 06:28:30 AM
Quote from: din1031 on January 18, 2005, 12:40:00 AM
Search this in the who.template.php of you theme or in the default directory
.......

a i found it ;).

Old one from your template ->

// Skip anyone who is a guest.
if ($member['id'] == 0)
   continue;

      // $alternate will either be true or false.  If it's true, use "windowbg2" and otherwise use "windowbg".
      echo '
      <td width="25" align="center">', (empty($member['flag'][0]) ? '' : '<img src="' . $settings['default_images_url'] . '/flags/' . strtolower($member['flag'][0]) . '.png" alt="' . $member['flag'][1] . '" title="' . $member['flag'][1] . '" />'), '</td>
      <tr class="windowbg', $alternate ? '2' : '', '">
         <td>';

      // Guests don't have information like icq, msn, y!, and aim... and they can't be messaged.


I only put the flagline 1 line after <tr class="windowbg', $alternate ? '2' : '', '">
New one from your template ->

// Skip anyone who is a guest.
if ($member['id'] == 0)
   continue;

      // $alternate will either be true or false.  If it's true, use "windowbg2" and otherwise use "windowbg".
      echo '
      <tr class="windowbg', $alternate ? '2' : '', '">
      <td width="25" align="center">', (empty($member['flag'][0]) ? '' : '<img src="' . $settings['default_images_url'] . '/flags/' . strtolower($member['flag'][0]) . '.png" alt="' . $member['flag'][1] . '" title="' . $member['flag'][1] . '" />'), '</td>  // This Line is one line later :)
         <td>';

      // Guests don't have information like icq, msn, y!, and aim... and they can't be messaged.
Support only via MOD Thread! NO PM Support!
My Forum: ayu][kult Forum
My Mods: My Small Mod Collection
My Parser: DIN1031's ModParser
Current Info: More away the next days, because i've to much work to do :x

edi67

i solved in another way thank anyway



CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Gobalopper

If you have this error:
Column count doesn't match value count at row 1

See this post:
http://www.simplemachines.org/community/index.php?topic=20168.msg192808#msg192808



Ravey76, I think your problem is with your javascript file. I don't think it has been updated with the functions that position the pins in their correct location. I can't know this for sure as your website seems to be down right now.



zillion all maps have x/y co-ordinates as well as a scale value. So if you cut the map and enlarge it be sure to also increase the scale value. As for why the image itself is the wrong size it may be caused by the scale being off...

Ravey76

#191
@ Gobalopper:

Okay, I checked all javascript-files on my board; I found following files:

- fader.js
- script.js
- spellcheck.js

and they really haven't been updated to the newest version (date: Oct' 2004). This seems to be a problem of the packet manager, from where I made this update to SMF1.0.1.

I uploaded the new javascripts, but it had no effect. Do I have uploaded the right files? Are there any other javascript-files I missed?

Additional steps I tried:
- uploaded again membermap.php / template / maps&flags > nothing changed.

Could it maybe be a database problem?

Kind regards,
Ravey

PS.: My board is still up  ;)

Direct Link: http://www.bmw-einzylinder.de/forum/index.php?action=mm
URL: http://www.bmw-einzylinder.de/index2.php > Foren > Einzylinder-Forum > MemberMap

Gobalopper

This javascript file:
http://www.bmw-einzylinder.de/YaBBSE155/Themes/default/script.js

Needs to have the javascript functions that come with the mod. The modificatoin will only edit the default theme so if your javascript file is not in that directory it will not work. If that isn't the default theme's directory try finding it and replacing it with the the one I link to above.

Slack

I've got the Mod installed, but whenever I try to Place a Pin - the Map jumps back to world view from what ever map I'm tring to place the pin on.   Any ideas?  Guest access to give it a try here:

http://weeniecampbell.com/yabbse/index.php?action=mm

Thanks!
slack

Gobalopper

Can you send me a PM with a test account login?

Slack

You bet, coming right up.

Ravey76

Quote from: Gobalopper on January 18, 2005, 08:02:52 PM
This javascript file:
http://www.bmw-einzylinder.de/YaBBSE155/Themes/default/script.js

Needs to have the javascript functions that come with the mod. The modificatoin will only edit the default theme so if your javascript file is not in that directory it will not work. If that isn't the default theme's directory try finding it and replacing it with the the one I link to above.

@ Gobalopper:   

:-*

This was the right direction! The file from the link didn't work, but you've been right; the problem was this javascript-file.

Okay, here as a summary what went wrong:
- Package Manager didn't install the files right (error messages), so I had to install it by hand
- After making all necessary changes by hand I uploaded all files, but at the javascript-file >>I<< made a mistake; instead of taking the modified javascript-file I uploaded my backup-file (unmodified) of it, so the location mod had no chance to run properly!

As far as I could check it the MemberMap now works fine again  :)

Thanks a lot for your help, Gobalopper  :D

Best wishes,
Ravey

Artras

I'm getting nuts here. I installed the mod (which I like very much, so thanks for the hard work!), but I keep getting problems. First there where several problems with installing. But after 2 weeks of trial and error I succeeded. (where problems with the server settings). So now I got it installed and working under the default board theme I have (SMF Default Theme). But I have several other themes installed and I just can't get the button in them. :'(

I have looked at (and tried several times) what is mentioned HERE.
I copied and pasted the codes mentioned there to the two files, but I still do not see a button to the "members map". If I put "action=mm" after the 'standard' url to my board it is working. I can also see the setting options in the admin section. So the mod is installed correctly.

It probably is something easy I forget to do or overlook. But I really can't find out what.

Do I need to copy all the (new) files from the default theme folder to the other theme folders or is it just a matter of editing the index.template.php file? (which I suspect it is)

Please help me, I don't know anything about php, but I am not afraid to change something. I do have a reasonable amount of experience time with computers and applications.

oscar2001

Quote from: Artras on January 19, 2005, 04:49:09 AM
I'm getting nuts here. I installed the mod (which I like very much, so thanks for the hard work!), but I keep getting problems. First there where several problems with installing. But after 2 weeks of trial and error I succeeded. (where problems with the server settings). So now I got it installed and working under the default board theme I have (SMF Default Theme). But I have several other themes installed and I just can't get the button in them. :'(

I have looked at (and tried several times) what is mentioned HERE.
I copied and pasted the codes mentioned there to the two files, but I still do not see a button to the "members map". If I put "action=mm" after the 'standard' url to my board it is working. I can also see the setting options in the admin section. So the mod is installed correctly.

It probably is something easy I forget to do or overlook. But I really can't find out what.

Do I need to copy all the (new) files from the default theme folder to the other theme folders or is it just a matter of editing the index.template.php file? (which I suspect it is)

Please help me, I don't know anything about php, but I am not afraid to change something. I do have a reasonable amount of experience time with computers and applications.

Have you uploaded the map button/s to the various themes images directory?

Artras


Advertisement: