TNG V12 Change Impacts

From TNG_Wiki
Jump to navigation Jump to search

reCaptcha v2 Included

TNG v12 now includes the No Captcha reCAPTCHA Add-on or reCaptcha v2

History of captcha in TNG is as follows:
  • In TNG v6, Brian McFadyen convinced Darrin to add the hooks for a TNG captcha in the Register for User Account and in the Contact Us and Suggest modules. TNG did not provide any of the code to make the captcha work. It only provided the hooks.
  • Several different captcha mods were over the years added. First Brian's mod, then Roger Moffat's reCaptcha v1 mod, and then several others. They all use the TNG_captcha.php module which is what the TNG hook calls.
  • Each mod distributes their own version of the TNG_captcha.php file. Maybe enough users have complained about getting spam that Darrin finally decided to install a captcha module. In order for the captcha installed in TNG to work, one still needs to request the reCaptcha v2 keys.
Any other captcha mods can be installed, except Roger's reCaptcha v1 mod since it no longer works, but in order to do so the distributed TNG_captcha.php should probably be renamed to TNG_captcha_v12.php rather than doing a Clean Up in the captcha mod one wants to install (see exception for Image_Captcha v12 below.)

Required Action

  • If you want to use the TNG_captcha.php included with TNG v12, you need to request the reCaptch v2 keys
  • If you want to use a different Captcha Mods, with the exception of Image_Captcha v12, you will need to rename the distributed TNG_captcha.php
  • Image Captcha v12 modifies the distributed TNG_captcha.php and will restore it upon removal of the mod

Template Settings Table

TNG moved the Template Settings from the templateconfig.php file to a new Templates table in the TNG database - tng_templates


Several mods that added or modified entries in the templateconfig.php no longer work unless a TNG 12.x version is installed.
  • Scrollbox mod * versions for TNG 12.0 and TNG 12.01 are available.
  • Winter template * no version yet available.
  • any personal mod that changed or added to the Template Settings templateconfig.php
Templates NearDark and NearDawn can be used with installations that have upgraded to TNG 12 (instructions on the Wiki pages). The template support mod NearD Support has been updated to v12.0.0.3-rc1.

Minimizing Impact

To minimize the impact of the Template Settings move to the TNG database, the following steps are recommended as part of the upgrade:

  1. Copy your templateconfig.php file to a backup location before you do anything else with the upgrade
  2. Backup your configuration, template files, and TNG database tables
  3. Uninstall all your TNG Installed mods and Clean Up all Partially Installed mods
  4. Follow instructions in upgrade readme Step 2 through 5
  5. Before Step 6 in the upgrade readme, copy the templateconfig.php file you saved in step 1 above back to your config file location
    which could be your TNG root folder or you Config Path folder
  6. Perform your DB Upgrade
    your templateconfig.php changes should have been copied to the new Template (tng_templates) table
IMPORTANT. If you want the TNG 11.0 version of Scrollbox mod to work on TNG v12, you need to have followed the above steps. It is recommended to install the TNG 12.0 or TNG 12.01 version of the Mod after completing the upgrade. Also, the Template Manager mod is intended to minimize future issues with mods which alter template settings.

Impact on User Created Pages

If you created user pages years ago from the historytemplate.php file in use at the time, prior to TNG v11, you will be severely impacted by the template settings moved to the tng_templates table because the template variables are not created in the begin.php file like they were previously but rather in the tng_begin.php file where the tng_templates table is now processed.

The old historytemplate.php used

include($cms[tngpath] . "genlib.php");
include($cms[tngpath] . "getlang.php");
include($cms[tngpath] . "$mylanguage/text.php");
include($cms[tngpath] . "checklogin.php");
include($cms['tngpath'] . "log.php" );

Action Required

You need to update all your user created pages to now include the tng_begin.php instead of the begin.php. You will also need to remove the includes that are done in the tng_begin.php file to prevent fatal errors, such as

Fatal error: Cannot redeclare writelog() (previously declared in D:\wamp\www\tng\log.php:2) in D:\wamp\www\tng\log.php on line 143

The new historytemplate.php uses

$cms['tngpath'] = "../";
include( "../tng_begin.php");

Not only do you need to replace the include ("../begin.php"), you need to remove the includes that are now part of tng_begin.php

* //include($cms[tngpath] . "genlib.php");
* //include($cms[tngpath] . "getlang.php");
* //include($cms[tngpath] . "$mylanguage/text.php");
* //include($cms[tngpath] . "checklogin.php");
* //include($cms['tngpath'] . "log.php" );

If you previously commented out the checklogin.php page to allow visitors to view a user created page on a site that requires user login, you can accomplish that in TNG v12 by setting the new $nologin flag to 1 before the include of tng_begin.php as shown in the new historytemplate.php file

//1a: If you want to skip the login check when displaying this page, remote the comment marks from this line:
//$nologin = 1;

Update User Records

TNG v12 changed the Edit Profile privilege to correctly reflect that the privilege also controls the user's ability to request a password change. The message now shows Allow to edit user profile and change password

72. Users: It was not obvious that a user's ability to edit their profile also controlled the user's ability to request a password change. Text on the Admin/Users pages has now been changed to reflect this.

Action Required

If you previously did not grant the Edit Profile privilege to your users, you will need to update your User records to check the box in front of Allow to edit user profile and change password if you want your users to be able to request password changes.

jQuery Library Updates

33. Miscellaneous: The jQuery and jQueryUI libraries have been upgraded to versions 3.3.1 and 1.12.1 respectively.


If you use jQuery in some of your personal mods, they may no longer work

Action Required

The following sites might provide helpful information in upgrading your personal jQuery scripts:

New cust_text.php search string

TNGv12 has introduced new guidelines for mods that install language strings in cust_text.php files to use a new target location search string in cust_text.php files. The intent of this guideline is for mods to install new language strings above the new search string, and to leave the space below the new search string free for language strings that are installed manually by TNG administrators, or that are added to override the custom text used in a mod.

The cust_text.php files installed by full installations TNGv12+ are compliant with the new guidelines. However, the TNG new-version upgrade scripts generally do not touch cust_text.php files. The TNGv12 upgrade script followed that tradition. The NOTES section of the upgrade readme files for TNG v12+ indicate that you should use the Mod Manager Recommended Updates tab to update cust_text.php files to be compliant with the new TNGv12 guidelines.

Compliant TNGv12 cust_text.php files are different from older cust_text.php files in the following ways:

  1. They contain the new target location search string
    //Mods should put their changes before this line, local changes should come after it.
  2. All cust_text.php files contain the same search string, without language translations, and
  3. The old two-line comment that some mods have used as a target location search string has also changed. The second of the two comment lines has been changed from //$text[messagename] = "This is the message"; to //$text['messagename'] = "This is the message"; (with single quotes in the $text subscript).


  • Mods that search for the string ?> as the presumed last line of cust_text.php files
    • will continue to work on TNGv12 (whether the cust_text.php files have been upgraded or not),
    • but will not achieve the intent of the design change.
  • Mods that use the string //$text[messagename] = "This is the message"; within their search text
    • will not work on TNGv12 sites whose cust_text.php files have been updated.
  • Mods that have been upgraded to TNGv12 specifications
    • will not work on sites whose cust_text.php files have NOT been updated.

Action Required

  • By TNG site administrators:
    1. On sites that have upgraded to TNGv12+, the administrator needs to use the Mod Manager's new "Recommended Updates" tab to run a utility program that updates all cust_text.php files on the site. (It is safe to run the upgrade program multiple times.)
  • By Mod programmers:
    1. All TNGv12+ mods should, over an unspecified time frame, be updated to use the new cust_text.php target location search string, //Mods should put their changes before this line, local changes should come after it.
    2. All TNGv12 mods that use the string //$text[messagename] = "This is the message"; within their search text should be updated immediately to use the TNGv12 cust_text.php target location search string.

Also, at some some point, Darrin, or perhaps a committee of TNG mod programmers, needs to declare when mod programmers will be expected to have updated their mods to use the new cust_text.php target location search string.

Example of a TNGv12-compliant cust_text.php target location

[Show/Hide Example]


//Mods should put their changes before this line, local changes should come after it.

################### Strings used by the Regroup Person Profile Mod
$text['rrrpp-otherevents'] = "Other Personal Events";
$text['rrrpp-hidemap'] = "Hide Event Map";
$text['rrrpp-showmap'] = "Show Event Map";
################### End of Strings used by the Regroup Person Profile Mod


(The blank lines in the insertion text provide useful whitespace between each mod's strings, and the comments above and after the block of strings serve to document the source of the strings within the cust_text.php file.)

[Hide Example]