Topic: $customheader header processing with no iframe
mdlpuk

Posts: 14

Posted:
28.Jul 2007 - 06:25

Hi Wendell,

Contemplating updating PostNuke, pnTNG and TNG to latest versions I have done a test 'clean install' without additional 3rd party modules to check for problems in advance. I am currently running PostNuke 6.2 TNG 6.04 and pnTNG 2.14 without problems. Seeing your site and the echoing of the TNG title rather than Postnuke's I was keen to go down the no iframes' route.

Current site at :-
http://www.bols...module=pnTNG

test site at :-
http://www.mdlp...php?name=TNG

I have however hit a couple of difficulties using no iframes.

The appears to be a bleed from postukes stylesheet into the TNG display, I can overcome this by modifying the postnuke theme style sheet.

The one I cannot resolve is the fact that when not using iframes my topmenu.hmtl, ($customheader), is not being processed. This is called by genlib in tng and looking at your code I can't see where it is excluded. (my php knowledge is rather limited).

I use topmenu.html to call a sophisticated navigation bar.

Cheers Martyn

Bolstridge One-Name-Study
Searching for B O[u]L[e/d]S T R I D G E anywhere
Wendel

Posts: 82

Posted:
29.Jul 2007 - 14:42

Martyn,
First things first. By "latest", are you trying to upgrade to TNG 6.1.1 and pnTNG 3.10? I just wanted to make sure we are on the same page as we work through this.

I checked out your test site. It looks like you need to create and have the right permissions on the genlog.txt file.

On the header problem... I suspect it was not being included since it did not find the file. The "base" directories are different when running only under TNG and when running under PostNuke.

Try the following change in the customconfig.php file from pnTNG (first two lines given to help find the lines in the file):
Code
$documentpath    = $cms[tngpath] . $documentpath ;
$photopath       = $cms[tngpath] . $photopath ;

to
Code
$documentpath    = $cms[tngpath] . $documentpath ;
$photopath       = $cms[tngpath] . $photopath ;
$customheader    = $cms[tngpath] . $customheader ;
$customfooter    = $cms[tngpath] . $customfooter ;



Let me know if this helps.
- Wendel




edited by: Wendel, Jul 29, 2007 - 01:43 PM
mdlpuk

Posts: 14

Posted:
30.Jul 2007 - 18:49

Hi Wendel,

To confirm, the test site is running PostNuke 0.7.6.4, TNG 6.1.1 and pnTNG 3.10

I had already tried the fix you suggested to no avail. As my customconfig.php was heavily modified I have reloaded the one you supplied with the additions suggested but the problem persists. It all works perfectly using iframes !

I have also found another problem only experienced using the non - iframes option. If I am logged in as a user with full privaleges to view living individuals they will show up in the side block for birthdays correctly. Clicking on them we only get a 'living' person. Also within TNG I find I cannot access living individuals at all.

Cheers Martyn

Bolstridge One-Name-Study
Searching for B O[u]L[e/d]S T R I D G E anywhere
Wendel

Posts: 82

Posted:
30.Jul 2007 - 23:43

Martyn,
OK, great, we are on the same levels.
I'm still having trouble with your test site. I keep getting the notice
QuoteCannot open /home/mdlpuk/public_html/database/genlog.txt

I believe this indicates that the genlog.txt file does not exist or does not have the right permissions. Until this is fixed I can't see much of TNG on your test site.

The seeing (or not seeing) of living individuals is odd. It seems to indicate that the user information is not getting propagated from PostNuke to TNG. Just so be clear... you have a postnuke user id, under TNG that same user id has privileges to see living individuals. Then when logged in as that user, under postnuke that user id is not seeing living information.

I have not seen this before. I may need to get an id from you so I can take a closer look. If you are ok with that, you can email the information to me at pntng@voigtworld.com


Wendel

Posts: 82

Posted:
31.Jul 2007 - 00:17

Martyn,
Looking into the $customheader issue a bit more, it looks like the $customheader is always ignored by TNG whenever it is wrapped inside a CMS (like PostNuke). You can hack this in TNG by making the following change in genlib.php, in the function tng_header, about line 71. Change:
Code
if( !$cms[support] ) {
        echo "</head>\n";
        if( !$tngprint && !$flags[noheader] )
            include( $customheader );
        else
            echo "<body>\n";
    }

to
Code
if( !$cms[support] ) {
        echo "</head>\n";
        if( !$tngprint && !$flags[noheader] )
            include( $customheader );
        else
            echo "<body>\n";
    } else {
        if( !$tngprint && !$flags[noheader] )
            include( $customheader );
    }

That should use the $customheader even in PostNuke, except when trying to print or the $flags[noheader] flag is set to true (which is sometimes used on index pages in some themes.)
- Wendel
Guest 
Unregistered User

Posted:
1.Aug 2007 - 19:33

Hi Wendel,

Well at least I can now get it to load a custom header, although my DHTML menus won't load. I'll work on that the week end. There are a couple of other issues but I am rather pushed for time at the moment. Will post this week end.

Thank's for your help

Cheers Martyn
mdlpuk

Posts: 14

Posted:
23.Sep 2007 - 18:15

H Wendel,

After an enforced break I finally returned to getting my TNG site to work with PostNuke 0.7.6.4 and your module pnTNG 3.10. Unfortunately the test site had to be taken down as space was needed but I have got the original site up and running using upgrades rather than clean installs. I have had to carry out some odd ammendments to get things working successfully.

Including customheader not using iframes was fixed using your hack to genlib.php. A bit more work on my postnuke theme has got all dhtml menus working correctly.

Could not get the mod to work without using iframes because of the genlog.txt error you pointed out. Permissions were actually fine but the path passed using iframes was wrong. A quick fix was to include the path in TNG admin genlog setup ie modules\tng\genlog.txt. There were no such problems using iframes. I can't understand why no one else has had this problem.

The resulting access log entries contained only the $currentuser ie all bots had a guest identification and could not be excluded from the log. The following alterations to log.php about line 34 cured the problem :-

// MP Remmed out for PostNuke to get Log to work
// if( $cms[support] && $currentuser )
// $string .= " $text[accessedby] $text[user]: $currentuser";
// else {
$string .= " $text[accessedby] $remhost";
if( $currentuser ) $string .= " ($text[user]: $currentuserdesc)";
// }

All in all I am very pleased with the latest tng module and find google et al has already linked certain areas.

Site as it stands now at www.bolstridge.co.uk/genealogy

Bolstridge One-Name-Study
Searching for B O[u]L[e/d]S T R I D G E anywhere
Wendel

Posts: 82

Posted:
24.Sep 2007 - 00:44

Martyn,
I'm glad to see you got it all working. Just a few comments:
QuoteCould not get the mod to work without using iframes because of the genlog.txt error you pointed out. Permissions were actually fine but the path passed using iframes was wrong. A quick fix was to include the path in TNG admin genlog setup ie modules\tng\genlog.txt. There were no such problems using iframes. I can't understand why no one else has had this problem.
Is the above statement right? "Permissions were actually fine but the path passed using iframes was wrong." Did you mean to say when not using frames? If so, this is odd. It suggests a problem with the TNG root path. Are you getting all green lights under the pnTNG admin?


QuoteThe resulting access log entries contained only the $currentuser ie all bots had a guest identification and could not be excluded from the log. The following alterations to log.php about line 34 cured the problem :-

// MP Remmed out for PostNuke to get Log to work
// if( $cms[support] && $currentuser )
// $string .= " $text[accessedby] $text[user]: $currentuser";
// else {
$string .= " $text[accessedby] $remhost";
if( $currentuser ) $string .= " ($text[user]: $currentuserdesc)";
// }

Yes, unless you hack TNG as you have done, there is no direct way to distinguish a "guest" user that is a human from a "guest" that is a bot in the log. I may try this out myself. It might be a good one to pass on to Darrin.

I checked out your site. It's looking real good. You may want to send in your site to Darrin as another example of what can be done with TNG. Good work.

- Wendel
mdlpuk

Posts: 14

Posted:
24.Sep 2007 - 20:41

Hi Wendel,
QuoteIs the above statement right? "Permissions were actually fine but the path passed using iframes was wrong." Did you mean to say when not using frames? If so, this is odd. It suggests a problem with the TNG root path. Are you getting all green lights under the pnTNG admin?


You are right I did mean without iframes.

The paths are all there correctly, no red lights until I set the public Log File Name to "modules/tng/genlog.txt" in the log config setup. Darrin's diagnostics screen possibly can't cope with a path, but the files have all the correct permissions, it works and the log is written to.

I little bit more information: I was confused earlier on when you said you were getting a genlog.txt error as I could not replicate it. I now find that this was because I had excluded my own IP address in the host exclusions section. This really is logical as excluded hosts are not writen to the log file. This means the error earlier was on a clean install without any of my own trivial hacks.

The error generated without entering the path of genlog.tx relative to postnuke is :
Cannot open /home/mdlpuk/public_html/genealogy/genlog.txt ie its looking for genlog.txt in my postnuke root.

I uploaded a little help script to try to understand what's going :
http://www.bols...ng&file=test



If you could provide me with an email address I can set up an admin account for you.
QuoteI checked out your site. It's looking real good. You may want to send in your site to Darrin as another example of what can be done with TNG. Good work.


Thanks for that I might when I think it's getting close to being finished !!

Thanks for all your help.

Bolstridge One-Name-Study
Searching for B O[u]L[e/d]S T R I D G E anywhere
Wendel

Posts: 82

Posted:
24.Sep 2007 - 22:16

Martyn,
OK, I figured out what is going on. You are correct on all accounts. The genlog.txt does indeed reside in the PostNuke directory at this point. I had not noticed it there. I kept seeing the one in my TNG directory but did not look at the date/time stamp.

The quick-fix work around is just as you described. Change the log file name to be modules/{tng}/genlog.txt where {tng} is the name of the TNG module that is created. (tng in your case, TNG in mine.)

For the other file names, I was able to automatically make the corrections (you can see the code in the customconfig.php file.) However, the name of the log file is saved in the logconfig.php file instead of the config.php file. And the way it is used/saved I can't do this fix automatically in the customconfig.php. I'll have to work with Darrin to see if there is a way to have this done automatically. If that doesn't work, I'll have to change the pnTNG documentation to warn people about this. Thanks for your help in this!

- Wendel
Guest 
Unregistered User

Posted:
26.Sep 2007 - 19:43

Hi Wendel,

I'm quite happy now, everything appears to be working ok now.
As I seem to have drifted away from the title of this thread, any other queries I'll start afresh.
Keep up the good work

Regards Martyn