Not signed in (Sign In)

Categories

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorcxcool
    • CommentTimeNov 5th 2005
     # 1
    please help me...

    it is needed in my host
    • CommentAuthorSirNot
    • CommentTimeNov 5th 2005 edited
     # 2
    I believe you can add a control to the to page to be executed either on the Page_Unload or Foot_Render events, depending upon where you want your code to be added.

    So, it could look something like the following (mind you, this might be buggy, haven't actually tested it yet):

    class AddAdCode extends Control
    {
    function AdCode(&$Context)
    {
    $this->Context = &$Context;
    }

    function Render()
    {
    $this->Context->Writer->Write('whatever you want to add here');
    }
    }

    $AdCode = $Context->ObjectFactory->NewContextObject($Context, 'AddAdCode');
    $Page->AddControl('Foot_Render', $AdCode);
    //OR $Page->AddControl('Page_Unload', $AdCode);
    • CommentAuthorcxcool
    • CommentTimeNov 5th 2005
     # 3
    oh, but please tell me which page should i put these code in.

    thank you
    • CommentAuthorSirNot
    • CommentTimeNov 6th 2005
     # 4
    It's probably easiest to just put it in as an extension. Pop this into a file in the extensions/ dir (obviously replacing the written string with the actual code) and enable it in the administration panel. Should work.


    <?php
    /*
    Extension Name: Ad Code
    Extension Url: mailto:sirnot@gmail.com
    Description: Adds ad code to all pages.
    Version: 1.0
    Author: SirNot
    Author Url: mailto:sirnot@gmail.com
    */

    class AddAdCode extends Control
    {
    function AdCode(&$Context)
    {
    $this->Context = &$Context;
    }

    function Render()
    {
    $this->Context->Writer->Write('whatever you want to add here');
    }
    }

    $AdCode = $Context->ObjectFactory->NewContextObject($Context, 'AddAdCode');
    $Page->AddControl('Foot_Render', $AdCode);
    //OR $Page->AddControl('Page_Unload', $AdCode);

    ?>
Add your comments
    Username Password
  • Format comments as