Jump to content
TNG Community
Carl Rhodes

After installing TNG v. 12.2 from v. 11.2, my custom pages not displaying right.

Recommended Posts

Carl Rhodes

 

Here is what the page looked like before upgrading to TNG V.12.2, (I have about 500-600, pages to update):

image.png

Here it is after:

"This is the address: http://rhodesfamily.org/bio_rufus_napoleon_rhodes.php"

image.png

 

This is the part of the code I used to integrate  it to my site: 

<?php
include("begin.php");
if ( !$cms['support'] )
    $cms['tngpath'] = "";  // set tngpath to current directory
include($cms['tngpath'] ."genlib.php");
include($cms['tngpath'] ."getlang.php");
include($cms['tngpath'] ."$mylanguage/text.php");
tng_db_connect($database_host,$database_name,
               $database_username,$database_password) or exit;
include($cms['tngpath'] ."checklogin.php");
include($cms['tngpath'] ."log.php");
// update guestbook.php file name to match the filename you create
// and the $text['MYgbtitle'] to use the same text string as you use for tng_header
//     in the $logstring line below
writelog($logstring);
preparebookmark($logstring);
   tng_header("Rufus Napoleon Rhodes,  b: 1856, Jackson Co., MS,  of Jefferson Co., AL",$flags );
echo "<h2><script type=text/javascript language=JavaScript>
document.write(document.title);</script></h2><hr size=1 />";

echo tng_coreicons();

?>

What changes do I need to make to have it display properly.

Thank you for reading this! 

 

 

 

 

 

image.png

Share this post


Link to post
Share on other sites
Ken Roy

Carl,

You may need to read the TNG Wiki article on TNG V12 Change Impacts  TNG now uses tng_begin.php for the historytemplate.php provided in TNG v11 and v12.

It was also recommend in the TNG v10.1 upgrade to remove the following from user-created pages

1 hour ago, Carl Rhodes said:

tng_db_connect($database_host,$database_name, $database_username,$database_password) or exit;

see Dealing with Mods in TNG 10.1  I recently got burned by not following my own advice when setting up a new Windows 10 Pro laptop where the previous tng_db_connect function no longer exists.  

Share this post


Link to post
Share on other sites
Carl Rhodes

Thank Ken,

I changed 

<?php
include("begin.php");

to 

<?php
include("tng_begin.php");

And the page quit working. Do you have what code I use to replace the code in my previous post?

Share this post


Link to post
Share on other sites
Ken Roy

Carl,

The new code should look something like the following

<?php
//include("begin.php");		change to use tng_begin.php
include("tng_begin.php");
if ( !$cms['support'] )
    $cms['tngpath'] = "";  // set tngpath to current directory
//include($cms['tngpath'] ."genlib.php");	// included in tng_begin.php
//include($cms['tngpath'] ."getlang.php");	// included in tng_begin.php
//include($cms['tngpath'] ."$mylanguage/text.php");	// included in tng_begin.php
//tng_db_connect($database_host,$database_name,		// obsolete TNG function for MySQL and not MySQLi
               $database_username,$database_password) or exit;
//include($cms['tngpath'] ."checklogin.php");	// included in tng_begin.php
//include($cms['tngpath'] ."log.php");	// included in tng_begin.php
// update guestbook.php file name to match the filename you create
// and the $text['MYgbtitle'] to use the same text string as you use for tng_header
//     in the $logstring line below
writelog($logstring);
preparebookmark($logstring);
   tng_header("Rufus Napoleon Rhodes,  b: 1856, Jackson Co., MS,  of Jefferson Co., AL",$flags );
echo "<h2><script type=text/javascript language=JavaScript>
document.write(document.title);</script></h2><hr size=1 />";

echo tng_coreicons();

?>

Note that I commented out the lines you were using which you could remove.  That might allow you to use a Search and Replace to fix your user pages

Cheers

Share this post


Link to post
Share on other sites
Carl Rhodes

Thank you so much, & Happy New Year!

Share this post


Link to post
Share on other sites
theKiwi

Your site's error log will tell you what the problem is - probably an unclosed <?php or mismatched ' or " or something causing the white page

Roger

Share this post


Link to post
Share on other sites
Carl Rhodes

The main issue is having the header of the page display completely, as seen in the images of the first post.

Share this post


Link to post
Share on other sites
theKiwi
47 minutes ago, Carl Rhodes said:

The main issue is having the header of the page display completely, as seen in the images of the first post.

Right now the main issue is that this page you referred us to is coming up blank, which indicates a PHP syntax error somewhere on the page

 http://rhodesfamily.org/bio_rufus_napoleon_rhodes--2.php

Roger

Share this post


Link to post
Share on other sites
Ken Roy

Carl,

You can copy the source of the PHP page i question, go to PHP Syntax Check site and it should indicate what the error is causing the problem.  Of course the error might also be in a text variable file.

As to the page header where was the text and the image coming from before the upgrade?  If it was coming from the Template Settings you need to check whether the information got converted to the tng_templates table.

Share this post


Link to post
Share on other sites
Carl Rhodes
14 minutes ago, Ken Roy said:

As to the page header where was the text and the image coming from before the upgrade?  If it was coming from the Template Settings you need to check whether the information got converted to the tng_templates table.

The  PHP Syntax Check came out ok on http://rhodesfamily.org/bio_rufus_napoleon_rhodes.php.  How do I check if it converted to the tng_templates table?

Share this post


Link to post
Share on other sites
Ken Roy
9 hours ago, Carl Rhodes said:

How do I check if it converted to the tng_templates table

The Admin > Setup > Template Settings should contain the correct information for the templates if the database update was done correctly. 

Share this post


Link to post
Share on other sites
Ken Roy

Carl,

Did you ever get to the bottom of your issue?  TNG v12 moved obtaining the $tmp (template variables) from begin.php to tng_begin.php see Templates V12

This has a major impact on user-created pages.  Sorry, I did not remember when you originally posted your issue, but as i get older I do not necessarily remember things from a year or two ago.

You may need to scan and replace begin.php with tng_begin.php in your user-created pages and then have to scan and replace to comment out the includes that are part of tng_begin.php.

Do you have access to your PHP error log? if not you may need to look at the Show PHP Error Log mod and the associated article on how to get access to the log

Share this post


Link to post
Share on other sites
Carl Rhodes

Thanks Ken,

I will work on that.

Thanks again,

Carl

 

 

On 1/1/2020 at 9:26 PM, Ken Roy said:

As to the page header where was the text and the image coming from before the upgrade?  If it was coming from the Template Settings you need to check whether the information got converted to the tng_templates table.

The  PHP Syntax Check came out ok on http://rhodesfamily.org/bio_rufus_napoleon_rhodes.php.  How do I check if it converted to the tng_templates table?

Share this post


Link to post
Share on other sites
Ken Roy
3 hours ago, Carl Rhodes said:

How do I check if it converted to the tng_templates table?

If you go to Admin > Setup > Template Settings, does it show the correct template as selected?  Are the entries for the template populated?

Share this post


Link to post
Share on other sites
Carl Rhodes

Yes it is fine. I tried tng_begin.php, but the page won't work with that in the page..

On 1/1/2020 at 9:26 PM, Ken Roy said:

As to the page header where was the text and the image coming from before the upgrade?  If it was coming from the Template Settings you need to check whether the information got converted to the tng_templates table.

The  PHP Syntax Check came out ok on http://rhodesfamily.org/bio_rufus_napoleon_rhodes.php.  How do I check if it converted to the tng_templates table?

Share this post


Link to post
Share on other sites
tngrlkrz

FWIW, this probably doesn't apply for your pathing, but the article Ken referenced about TNG12 impacts indicated:

The new historytemplate.php uses

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

 

vs. what you have in your code.

p.s. I know nothing about historytemplate pages.

 

Share this post


Link to post
Share on other sites
Carl Rhodes

Thanks, I tried it and and it didn't work, thanks the same tho.

 

 

On 1/1/2020 at 9:26 PM, Ken Roy said:

As to the page header where was the text and the image coming from before the upgrade?  If it was coming from the Template Settings you need to check whether the information got converted to the tng_templates table.

The  PHP Syntax Check came out ok on http://rhodesfamily.org/bio_rufus_napoleon_rhodes.php.  How do I check if it converted to the tng_templates table?

Share this post


Link to post
Share on other sites
tngrlkrz

Likely someone with expertise on historytemplates might be able to help by getting a peek at your site, since seems at a dead end here.

Ron

Share this post


Link to post
Share on other sites
Carl Rhodes

Thanks, This link is as good as any: http://rhodesfamily.org/bio_john_rhodes_of_dakota_county_mn.php

Thanks again

 

 

On 1/1/2020 at 9:26 PM, Ken Roy said:

As to the page header where was the text and the image coming from before the upgrade?  If it was coming from the Template Settings you need to check whether the information got converted to the tng_templates table.

The  PHP Syntax Check came out ok on http://rhodesfamily.org/bio_rufus_napoleon_rhodes.php.  How do I check if it converted to the tng_templates table?

Share this post


Link to post
Share on other sites
Carl Rhodes

The problem is the header not displaying,. 

Share this post


Link to post
Share on other sites
Ken Roy
3 hours ago, Carl Rhodes said:

The problem is the header not displaying,. 

Carl,

Do you have access to your PHP error log?  If so, does it indicate any errors? 

You never answered my previous question - where does the header information come from?  Is it from the Template Settings? or some place else.

The fact that in TNG v12, begin.php no longer provides access to the template variables might very well be at issue. When you indicate that using tng_begin.php does not resolve the issue, did you also comment out the duplicate files as I indicated in a prior answer?  If not you might be getting a PHP fatal error

Quote

PHP Fatal error: Cannot redeclare writelog() (previously declared

that prevents the page from being displayed.

Share this post


Link to post
Share on other sites
Carl Rhodes

I've got it figured out, I had to change more of my code then I thought.

This is the code I was using:
<?php
include("begin.php");
if ( !$cms['support'] )
    $cms['tngpath'] = "";  // set tngpath to current directory
include($cms['tngpath'] ."genlib.php");
include($cms['tngpath'] ."getlang.php");
include($cms['tngpath'] ."$mylanguage/text.php");
tng_db_connect($database_host,$database_name,
               $database_username,$database_password) or exit;
include($cms['tngpath'] ."checklogin.php");
include($cms['tngpath'] ."log.php");
// update guestbook.php file name to match the filename you create
// and the $text['MYgbtitle'] to use the same text string as you use for tng_header
//     in the $logstring line below
writelog($logstring);
preparebookmark($logstring);


And this is what I use now for the pages I macke:

<?php
 include( "tng_begin.php");
 writelog($logstring);
 preparebookmark($logstring);
On 1/1/2020 at 9:26 PM, Ken Roy said:

As to the page header where was the text and the image coming from before the upgrade?  If it was coming from the Template Settings you need to check whether the information got converted to the tng_templates table.

The  PHP Syntax Check came out ok on http://rhodesfamily.org/bio_rufus_napoleon_rhodes.php.  How do I check if it converted to the tng_templates table?

Share this post


Link to post
Share on other sites
Carl Rhodes

Thank everyone for their help! 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×