Fork me on GitHub

Where's the php Block ? I need to include php scripts too  Bottom

  • I need a block for my external bannerscript that is able to include this small PHP snipped.
    The variable is necessary to set the output value.


    Code

    <?
    $ANZEIGE = "1";
    include('/www/htdocs/.../anzeige.php');
    ?>


    Copying this into a .php file and call it using the external file block doesn't work.
  • Take the pnRender Block and include that code there. The PHP block was removed due to insolveable security issues.

    --
    best regards from Kiel, sailing city

    Steffen Voss

    Member of the Zikula Steering Committee
    Read The Zikulan's Blog "If you want people to RTFM, make a better FM!"
  • The block doesn't give me space to include. It only let me includ parameters but I don't know how that should be filled as there's no info in the pnRender module iteself on how to work with the block.

    Code

    Modulname:
    Template-Datei:    
    (die Template-Datei muss im /pntemplates Verzeichnis des Moduls sein)
    Parameter (Format: assign=value;assign2=value2...):
  • The best way to deal with this is to create a very simple block yourself which contains your banner code - use the blocks in system/Blocks/pnblocks as a basis

    --
    itbegins.co.uk - Zikula Consulting

    birtwistle.me.uk - Personal Blog


    Please read the Support Guide
  • Ok, I modyfied the HTMLblock to

    Code

    <?php

    function Blocks_phpblock_init()
    {
        // Security
        pnSecAddSchema('PHPblock::', 'Block title::');
    }

    function Blocks_phpblock_info()
    {
        return array('text_type'      => 'PHP',
                     'module'         => 'Blocks',
                     'text_type_long' => 'PHP',
                     'allow_multiple' => true,
                     'form_content'   => true,
                     'form_refresh'   => false,
                     'show_preview'   => true);
    }

    function Blocks_phpblock_display($blockinfo)
    {
        if (!SecurityUtil::checkPermission('PHPblock::', "$blockinfo[title]::", ACCESS_OVERVIEW)) {
            return;
        }

    $ANZEIGE = "1";
    include('/www/htdocs/techno/tb2008/bannerdealer/anzeige.php');

    }

    what gives me correct output on the right side (the 2 banners under each other) at http://www.technobilder.de/tb2008

    ... but now the Blockheader is missing icon_frown
  • Same problem here. I tried

    Code

    <?php
    include('/home/www/web699/html/cdxroster/index.php?sortcol1=Owner&sortdir1=asc&sortcol2=Guild%20Rank&sortdir2=asc');
    ?>

    inside the HTML block but its just not showing anything. So how do I get this content shown up inside my page?

    I tried to make an additional block as well:

    Code

    <?php

    $blocks_modules['guild_rosterblock'] = array (
        'func_display' => 'blocks_rosterblock_display',
        'func_add' => 'blocks_rosterblock_add',
        'func_update' => 'blocks_rosterblock_update',
        'func_edit' => 'blocks_rosterblock_edit',
        'text_type' => 'guild_rosterblock',
        'text_type_long' => 'VG Roster',
        'allow_multiple' => true,
        'form_content' => false,
        'form_refresh' => false,
        'show_preview' => true
    );

    function Blocks_rosterblock_init()
    {
        // Security
        pnSecAddSchema('rosterblock::', 'Block title::');
    }

    function Blocks_phpblock_info()
    {
        return array('text_type'      => 'PHP',
                     'module'         => 'Blocks',
                     'text_type_long' => 'PHP',
                     'allow_multiple' => true,
                     'form_content'   => true,
                     'form_refresh'   => false,
                     'show_preview'   => true);
    }

    function Blocks_rosterblock_display($blockinfo)
    {
        if (!SecurityUtil::checkPermission('rosterblock::', "$blockinfo[title]::", ACCESS_OVERVIEW)) {
            return;
        }

        include('/home/www/web699/html/cdxroster/index.php?sortcol1=Owner&sortdir1=asc&sortcol2=Guild%20Rank&sortdir2=asc');
    }


    But there is just an empty block in this case.
    And using finclude-block doesn't work too, it writes the include line down instead of showing the content.



    edited by: Horian, Mar 26, 2008 - 09:30 PM
  • 0 users

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