TNG V12 Change Impacts

From TNG_Wiki
Revision as of 22:02, 3 October 2018 by Robinrichm (talk | contribs) (Added a section on the new cust_text.php search strings)
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

Impact

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("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" );

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.

Impact

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 a new guideline for mods that install language strings in cust_text.php files. This change specified a new target location search string for cust_text.php files:
//Mods should put their changes before this line, local changes should come after it.

The purpose of the new search string is for mods to install new language strings above that line, and to leave the space below that line free for language strings that are installed manually by TNG administrators.

However, the TNG new-version upgrade scripts generally do not touch cust_text.php files. The TNGv12 upgrade script followed that tradition, and did not add the new search string to cust_text.php files. TNG sites that installed TNGv12 using the full installation process most likely did get new cust_text.php files, which have been changed from older TNG versions in the following ways:

  1. They contain the new target location search string listed above,
  2. All cust_text.php files contain the same search string, without language translations, and
  3. The old two-line comment that some mods use 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).

Impact

  1. Mods that search for the string ?> as the presumed last line of cust_text.php files will continue to work, whether the new search string is in the targeted cust_text.php file or not.
  2. Mods that search for just the first of the two old lines, //Put your own custom messages here, like this: will also continue to work.
  3. Mods whose cust_text.php search strings include the text //$text[messagename] = "This is the message"; will not work.
  4. On TNG sites where the cust_text.php files have not been upgraded to contain the new search string, mod that have been upgraded to use the new search string will not work.

Action Required

  1. All TNGv12 mods should, over an unspecified time frame, be changed 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 text //$text[messagename] = "This is the message"; in their cust_text.php search strings 'must be upgraded immediatedly if they are to work on new TNGv12 sites.
  3. TNG administrators for sites that have upgraded to TNGv12 should run a utility program that adds the new search string to all cust_text.php files. That utility program is available at the "Recommended Updates" tab in Mod Manager. (That program adds the new search string only after making sure the new string is not present. As a result, there is no harm in running the utility more than once.)
  4. At some some point, Darrin, or perhaps a committee of TNG mod programmers, needs to declare when mod programmers will be expected to have upgraded their mods to use the new TNGv12 cust_text.php target location search string.