Home Learn More Purchase Knowledge Base Support Contact

Community Forums

Forum » KBPublisher Code Hacks and Customization Discussion

php code in template

(2 posts)
  • Started 3 months ago by feroxltd
  • Latest reply from onesign

  1. feroxltd
    Member

    When trying to add some peace of php code it only shows up as blank.

    [code]<?php chdir("/var/wkscript/www/ads"); include_once("/var/wkscript/www/ads/mysimpleads.php");show_ad_group(4); ?> [/code]

    The cose is from my ad server.

    Anyone know how I can the php code to work and display the ads correctly?

    Posted 3 months ago #
  2. In template:
    {my_add_block}

    In appropriate view class:
    chdir("/var/wkscript/www/ads"); // why this?
    include_once("/var/wkscript/www/ads/mysimpleads.php");
    $tpl->tplAssign('my_add_block', show_ad_group(4));

    By the way in version 3.0 there is "Global Variable"
    example of adding global variable to template
    in template you should have a template tag, for example - {global_test}

    in index.php after $page = &new KBClientPageRenderer($view, $manager);

    $page->assign('global_test', '<b>test global variable</b>');

    Posted 3 months ago #

RSS feed for this topic

Reply

You must log in to post.

© 2008 Double Jade LLC | customer.service@kbpublisher.com