Author Topic: [MOD] ZIP Code display on Germany map  (Read 15488 times)

0 Members and 1 Guest are viewing this topic.

Offline PartyPix

  • Newbie
  • *
  • Posts: 42
    • View Profile
[MOD] ZIP Code display on Germany map
« on: October 31, 2006, 12:31:00 PM »
Hi
this is my first MOD and I hope you will like this. I dont know whetter its perfect but on my page it gone. You can help me and make this code better or so.

Description / Beschreibung

Eng:
In this MOD you can allow your users to display the ZIP Code on the member_profile on the GERMAN map.

Ger:
In diesem MOD ist es möglich die PLZ (die der User bei der Registrierung eingibt) auf der deutschen Karte anzuzeigen.


Change files:

member.php
includes/db_field_definitions.php
includes/page_header.php
lang/deutsch/main.php
templates/default/register_form.html
templates/default/member_profile

New Folder:

templates/default/images/plz

1.)

open includes/db_field_definitions.php

add in the end just before ?> this code
Code: [Select]
$additional_user_fields['plz'] = array($lang['plz'], "text", 1);

2.)

open member.php

and after
Code: [Select]
if (!empty($user_row['user_email']) && (!isset($user_row['user_showemail']) || (isset($user_row['user_showemail']) && $user_row['user_showemail'] == 1))) {
      $user_email = $user_row['user_email'];
      $user_email_save = str_replace("@", " at ", $user_row['user_email']);
      if (!empty($url_mailform)) {
        $user_mailform_link = $site_sess->url(preg_replace("/{user_id}/", $user_row['user_id'], $url_mailform));
      }
      else {
        $user_mailform_link = $site_sess->url(ROOT_PATH."member.php?action=mailform&".URL_USER_ID."=".$user_row['user_id']);
      }
      $user_email_button = "<a href=\"".$user_mailform_link."\"><img src=\"".get_gallery_image("email.gif")."\" border=\"0\" alt=\"".$user_email_save."\" /></a>";
    }
    else {
      $user_email = REPLACE_EMPTY;
      $user_email_save = REPLACE_EMPTY;
      $user_mailform_link = REPLACE_EMPTY;
      $user_email_button = REPLACE_EMPTY;
    }

add this
Code: [Select]
// PLZ 2 Stellen
$max_string_laenge = 3;
if(strlen($user_row['plz'])>$max_string_laenge) $postleitzahl = substr($user_row['plz'],0,($max_string_laenge-1))."...";
else $postleitzahl = $user_row['plz'];


// PLZ 1 Stelle
$max_string_laenge = 2;
if(strlen($user_row['plz'])>$max_string_laenge) $postleitzahl_1 = substr($user_row['plz'],0,($max_string_laenge-1));
else $postleitzahl_1 = $user_row['plz'];


// PLZ Ende

find
Code: [Select]
$site_template->register_vars(array(
      "user_id" => $user_row['user_id'],
      "user_name" => (isset($user_row['user_name'])) ? format_text($user_row['user_name'], 2) : REPLACE_EMPTY,

and insert below
Code: [Select]
"postleitzahl" => $postleitzahl,
"postleitzahl_1" => $postleitzahl_1,


3.)
open templates/default/register_form.html

after
Code: [Select]
<tr>
            <td class="row1"><b>{lang_email}</b></td>
            <td class="row1">
              <input type="text" name="user_email" size="30" class="input" value="{user_email}" />
            </td>
          </tr>
add this
Code: [Select]
<tr>
            <td class="row1"><b>{lang_plz}</b></td>
            <td class="row1">
              <input type="text"  maxlength="5" name="plz" class="input_register_plz" value="{plz}">
            </td>
          </tr>


4.)
open includes/page_header.php

find
Code: [Select]
$site_template->register_vars(array(
  "lang_site_stats" => $lang['site_stats'],

and insert below
Code: [Select]
  "lang_plz" => $lang[plz],


5.)
open lang/deutsch/main.php

add at the end just before ?> this
Code: [Select]
$lang['plz'] = "PLZ";

6.)

open templates/member_profile.html

add after
Code: [Select]
<tr>
          <td class="row2"><b>{lang_icq}</b></td>
          <td class="row2">{if user_icq}<a href="http://www.icq.com/people/about_me.php?uin={user_icq}" target="_blank">{user_icq}</a> (<b>{user_icq_status}</b>){endif user_icq}</td>
        </tr>

this
Code: [Select]
<tr>
          <td class="row1"><b>{lang_plz}</b></td>
          <td class="row1">{postleitzahl}</td>
        </tr>
 <tr>
          <td class="row1">&nbsp;</td>
          <td class="row1"><img src="{template_url}/images/plz/{postleitzahl_1}.png"></td>
        </tr>


7.)
Download the files , extract it in templates/default/images/plz


8.)
Upload all files you change and upload the new files,too.


9.)
go to your phpmyAdmin to the _user table and add 1 new field:

Name: plz
Typ: Varchar
Länge: 5
Standart: D

10.) Now finish. Register a new user and test it out.

I dont know whetter i have all here but i think so. I have test it on 4images 1.7.3 width a lot of MOD's like photo, bday, guestbook, pm, gender ....

Please help to make this better or something other. ;)

Greetz
« Last Edit: November 02, 2006, 02:23:27 PM by PartyPix »

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: MOD ZIP Code display on Germany map
« Reply #1 on: October 31, 2006, 05:02:55 PM »
Ist im falschen Forum gelandet oder?

Weil die Veröffentlichungen kommen eigentlich in dieses Forum:
http://www.4homepages.de/forum/index.php?board=15.0

Offline PartyPix

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: MOD ZIP Code display on Germany map
« Reply #2 on: October 31, 2006, 05:24:39 PM »
Ja ich weiß aber konnte in dem Forum kein neues Thema eröffnen
keine Ahnung warum deshalb hab ich es hier hin geschrieben ;)

Offline FunnyUser

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: [MOD] ZIP Code display on Germany map
« Reply #3 on: January 10, 2007, 08:05:06 PM »
Hey,

ich schreibe mal auf Deutsch. Ich denke der MOD wird eh nur von Deutschen benutzt:

Ihr könnt die Deutschlandkarte auch als .gif- Format einbinden. Um sie Karte transparent einzubinden:

1. Downloade das Packet: Anhang

2.öffne templates/member_profile.html

Code: [Select]
<tr>
          <td class="row1"><b>{lang_plz}</b></td>
          <td class="row1">{postleitzahl}</td>
        </tr>
 <tr>
          <td class="row1">&nbsp;</td>
          <td class="row1"><img src="{template_url}/images/plz/{postleitzahl_1}.png"></td>
        </tr>

Ändere .png zu .GIF .

Dateien aus plz.zip hochladen: templates/<your folder>/images/plz

FERTIG.

FunnyUser
« Last Edit: February 05, 2007, 03:28:45 PM by FunnyUser »

Offline Jasi

  • Jr. Member
  • **
  • Posts: 74
    • View Profile
Re: [MOD] ZIP Code display on Germany map - Austria and Swis MAP möglich
« Reply #4 on: February 11, 2008, 11:05:29 AM »
@ All

wie kann man das erweitern auf Österreich (Austria) und die Schweiz (Swiss) ?

Beispiel:

Mitglied gibt bei der Regsitrierung anstatt Deutschland, Österreich oder Schweiz an, dass dann anstatt der German-MAP die für Östereich oder der Schweiz angezeigt wird?

Finde den MOD suppi, jedoch hab ich das kleine Problemchen, dass bei den Mitglieder die nicht aus Deutschland sind logisch so je nach PLZ die Deutschland-Karte ausgegeben wird.

Danke schon mal allen Helfern und Codern ;)
« Last Edit: February 11, 2008, 11:18:38 AM by Jasi »
LG Jasi