Jump to content
TNG Community

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


Carl Rhodes

Recommended Posts

 

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

Link to comment
Share on other sites

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.  

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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. 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...