Google Maps - Update Place Levels Mod

From TNG_Wiki
Jump to: navigation, search
Update Place Levels Mod
Summary This mod provides a couple of database update scripts used to update the Google Maps Place Levels
Validation not applicable
Mod Updated {{{mod_last_update}}}
Download link TNG Google maps Update Place Levels for
TNG 9.0

TNG Google maps Update Place Levels for
TNG 8.0
Download stats {{{download_stats}}}
Author(s) Roger Moffat
Homepage Google Maps - Update Place Levels Mod
Mod Support TNG Community Forums
Contact Developer
Latest Mod 9.0.0. for TNG 9
8.2.0 for TNG 8
Min TNG V 8.0.0
Max TNG V 9.x.x
Files modified
Related Mods
Notes
This mod can be Removed and Deleted after updating your place levels


Purpose of the mod

This mod is provided to help you update your TNG place levels to either

Developer

This mod was developed by Roger Moffat

Requirements

  • A working TNG installation. Automated installation has been tested on TNG Version 8.1.3 and TNG 9.0.0.
  • A backup of the TNG modules involved - see below.
  • An installed current version of the Mod Manager (note this is built into TNG since TNG V8).

Automated Installation

  1. Download the file from config file from the Mod Summary in the upper right hand corner of this page
  2. Extract the downloaded config file into your mods folder.
  3. Follow the normal automated installation for Mod Manager, as shown in the example Mod Manager - Installing Config Files to install the gmaps_update_placelevels.cfg config file.

After Installation

Changing Place Levels

• Mostly Automatic

This section applies to the Google Maps - More Place Levels Mod only.

Go to TNG Admin ------> Utilities and make a backup of your Places table (while you're there why not back up all the tables?).

Because this mod adds 4 new place levels to the series used by TNG, you will want to re-align the place levels assigned to your places. The new default sequence this mod creates is

Address, Cemetery, Farm, Town, Parish, City, County/Shire, State/Province, Country, Region, Not Set

and so if you have up until now used the default TNG sequence of

Address, Location, City/Town, County/Shire, State/Province, Country, Not Set

If you are happy with this new series, you can achieve this realignment for many of your places by clicking the link in the "To update your current place levels automatically click this link" part of the notes on the Mod Manager page. This will run a script that will edit the placelevel number for County/Shire, State/Province and Country to their new values.

UpdatePlaceLevels.png

You will need to decide how to split up the places you currently have assigned placelevel2 and placelevel3 (Location and City/Town) to the new placelevel2, placelevel3, placelevel4 and placelevel5, and either apply these changes manually through the TNG Admin ------> Places interface, or perhaps using phpMyAdmin to edit the tng_places table directly as described in the Mass_Updates_of_Place_Level_and_Zoom article.

• Automatic and Manual

This section applies to both the Google Maps - More Place Levels Mod and the Google maps 15 mod.

If you have already used a different sequence of place levels, or want to now switch to using a different sequence of place levels, there are several things you will need to do.

  1. Go to English/cust_text.php and find the block of place level lines that have been added at the end of the file, and edit the various entries there to define the new sequence of placelevels that you want to use. Note that if you do make changes directly in cust_text.php after the Mod is installed, it will cause the Mod Manager to say that the Mod is not properly installed. There are 2 possible work arounds for this:
    1. Copy the lines that you want to change and then paste them into cust_text.php again after the block of lines added by the Mod. Then make your changes there, in the second instance of the lines you want changed
    2. Edit the .cfg file and make the changes in the .cfg file prior to installing the Mod. This will then let the Mod control what goes in cust_text.php without creating the errors
  2. If you support other languages, copy this block of text to the cust_text.php file for your other languages and provide translations of the words/phrases
    1. Note that 1.2 and 2 above here can both be accomplished if you create another Mod that writes the text you want to display into the cust_text.php file for any/all languages. As long as you create this Mod so that it will write the new lines AFTER the lines added by this Mod, your changes will be in effect. Should you remove and reinstall this Mod, you would then need to remove and reinstall your Mod for writing just the lines to cust_text.php AFTER you install this Mod.
  3. Decide if any of your previous place levels align directly to the new ones - note that place levels are defined by the number you see on each line in the cust_text.ph file - Country used to be Level 6 and is now Level 9 for example.
  4. If your old sequence of place levels 4, 5 and 6 equate directly to the new levels 7, 8 and 9 you can update these automatically by using the step described above to update the place levels automatically. (applies to the Google Maps - More Place Levels Mod only)
  5. If you have a different alignment of old and new placelevels you can use the capability built into the Mod Manager file to change your place levels 1 at a time. After the Mod is installed, (This section applies to both the Google Maps - More Place Levels Mod and the Google maps 15 mod.)
    • Make sure the file update_ChangePlaceLevels.php placed into your TNG folder by this mod is writeable - permissions should be 666.
    • click the Edit button that appears in the right most column. By default it will open a window that lets you change current place level 6 (Country) to new place level 9 (Country).
    • Click the Confirm Edit button, and this will update the database update script,
    • Click this link which will open a new window and run the database update script and update your tng_places table.
You can then repeat the steps above and change level 5 to 8, then 4 to 7, or any other realignments that suit how you have used the Place Levels in the past and how you might want to use them with the new capabilities. This method is shown in the image below.
You can also run the Auto Place level update script to change place levels 4,5, and 6 and then Edit the parameters for the individual place level script to change level 3 to level
  • 4, as shown in the image on the right, if the predominate number of your Town/City places are Towns, or to level
  • 6 if the predominance are Cities.

You will still need to update the exceptions manually within TNG, or using a procedure similar to the one described in the Mass_Updates_of_Place_Level_and_Zoom article, where you

  • export the Places table to an Excel spreadsheet and then
  • make your updates and
  • re-import the table.
Add Place Levels edit place level.jpg

Security

When you have finished updating the place levels, it is recommended that you Remove and then Delete this mod which will remove the 2 update_ files that were added by the Mod. These are update_ChangePlaceLevels.php and update_ChangePlaceLevelsAuto.php. Doing this will prevent you from accidentally upgrading all your place levels again when you didn't want to.

In the event of a problem

  • Try using the Mod Manager Remove capability
  • Or copy the backup versions of the TNG modules involved.

Side effects

  • Happiness that your Maps are much more attractive and informative :-)
  • Since the place level updates are made to your TNG database, these changes will survive TNG upgrades provided you use the upgrade and will require that you re-implement the Google Maps - More Place Levels Mod or the Google maps 15 mods.

Sites using this mod

If you download and install this mod, please add your TNG site to the table below

URL User Note Mod-Version TNG-Version User-language
Roger's Online Genealogy Roger Moffat The mod developer. 9.0.0.0 9.0.0 EN
Our Roy and Boucher Family Ken Roy 9.0.0.0 9.0.0 EN, FR
... ... ... ... ...

TNG modules Involved

  • adds a comment to languages/English/cust_text.php and languages/English-UTF8/cust_text.php
  • installs two database update scripts