Fork me on GitHub

Watch

GitHub Core

Show your support for Zikula! Sign up at Github account and watch the Core project!




GitHub Modules

Forum Activity

Forum feed
  • mesteele101 created topic »«
  • mesteele101 responded to »«
  • mdee created topic »«
  • nestormateo responded to »«
  • damon responded to »«
  • frw responded to »«
  • mdee responded to »«

» Visit forum | » View latest posts

Zikula Blog

  • on Mar 07
  • on Mar 01
  • on Feb 24
  • on Jan 13
  • on Nov 12
  • on Aug 17
  • on Aug 07

WANTED: pntitle.php for pnAmazon  Bottom

  • Has anyone written a pntitle.php that works for the pnAmazon module?
    I've made a couple of attempts myself but they just break my website, which was not the desired affect wink

    For those about to ask, pntitle.php is for the TitleHack that you'll find over at lottasophie.sourceforge.net

    Thx
  • Rather than give up completely why not try to work through the problems? Perhaps post on Jorg's site (lottasophie.sourceforge.net) and ask for help debugging your existing code. Once complete you could then contribute this back to community.

    -Mark

    --
    Visit My homepage and Zikula themes.
  • I assume getting the titlehack to read the module name is isn't what you're having a problem with. I'm guessing you want the product name to show in your title bar like the title shows when you view a story.

    For most modules, the information is pulled from you PN database for pntitle.php but, in pnAmazon, there are no nuke_ data tables to pull from since the information is coming from Amazon. So I think you'll need to pass the item name from index.php to the copy of pntitle.php in your pnAmazon directory, so the product name will show up in your title when you publish the detail on index2.php.


    Slugger
  • 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....

    Code

    <?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 = new
    soapclient("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);    
    }

    ?>
  • Markwest/Slugger,

    Any feedback on this one please.
  • I still think you'd do better by passing the product name from index1 than by moving your SOAP functions into pntitle.php. I haven't done it but that is how I'd approach it.

    Slugger
  • Forgive my ignorance, but if this is prividing the
  • 0 users

This list is based on users active over the last 60 minutes.