Thanks Markwest and Slugger
My particular problem is that I don't particularly know the dynamics behind how postnuke create the page, I believe the index.php in PNAmazon does an include that calls header.php from the top level which in turn does an include of pntitle.php from the modules directory.
One problem that I've run into is that in my pntitle.php I need to do SOAP calls, but the include of nusoap.php is usually done in the PNAmazon index.php. If I include it again in the pntitle.php it barfs.
So I moved the include into the pntitle.php and removed it from the PNAmazon index.php to see if that did the trick but it doesn't seem to work either.
I don't really know
PHP, but I do know a fair amount of perl which is helping me to read the
PHP code and I am able to extract the pertinent parts of code from other peoples examples.
Here's what I have so far, perhaps someone could point me at where I may be going wrong....
<?php// File: $Id: pntitle.php,v 1.0 2004/06/02 10:30:41 jmvedrine Exp $// ----------------------------------------------------------------------// LICENSE//// This program is free software; you can redistribute it and/or// modify it under the terms of the GNU General Public License (GPL)// as published by the Free Software Foundation; either version 2// of the License, or (at your option) any later version.//// This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the// GNU General Public License for more details.//// To read the license please visit http://www.gnu.org/copyleft/gpl.html// ----------------------------------------------------------------------/**
* PostNuke Title Hack
*
* Show individual titles at your PostNuke pages.
*
* @package TitleHack
* @version $Id: pntitle.php,v 1.1 2003/10/09 08:19:41 jnapp Exp $
* @author Joerg Napp <jnapp@users.sourceforge.net>
* @link http://lottasophie.sourceforge.net Official Support Site
* @copyright Copyright (C) 2003 Joerg Napp
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
*/ /**
* Return the title for the PNAmazon Module
*
* This function returns the meaningful title for the current page
*
* @author Jean-Michel Vidrine
* @version $Revision: 1.0 $
* @return string The title for the current page
*/function PNAmazon_title
() {include("nusoap.php");
// create a instance of the SOAP client object$soapclient =
newsoapclient
("http://soap-eu.amazon.com/schemas3/AmazonWebServices.wsdl",
true);
// create a proxy so that WSDL methods can be accessed directly$proxy =
$soapclient->
getProxy();
list($asin) = pnVarCleanFromInput
('asin');
if ($asin) { $params =
array( 'asin' =>
$asin,
'tag' =>
'myaffiliateid',
'locale' =>
'uk',
'type' =>
'heavy',
'devtag' =>
'D27RKV4J59LC7X');
// invoke the method $titleresult =
$proxy->
ASINSearchRequest($params);
$titleitems =
$titleresult['Details'];
if ($titleitems[0]['ProductName']) { $title =
$titleitems[0]['ProductName'];
$result->
Close();
return pnConfigGetVar
('sitename') .
' :: '. pnVarPrepForDisplay
($title);
} return false;
} return pnConfigGetVar
('sitename') .
' :: '. pnVarPrepForDisplay
($asin);
}?>