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

» Visit forum | » View latest posts

Looking for a block for php script  Bottom

  • I have a standalone phpBB2 forum in conjuction with our postnuke site.

    we want to add a who's online block to the postnuke home page, to show who is online in the forums. now I have working code to show this, but I cant seem to find a block that will take the code.

    the actual code is PHP script, when added to PHP page it shows the necessary information so the code works ok, but how can I add that code to a block? so that it shows this information, and what type of block do i need?

    the code in question is



    in case that is any help, as you can see its just a small snippet.

    if anyone can help I would be very gratefull.
  • You can do it by adding a new block in the administration -> blocks area. select 'Core/PHP Script' from the drop down menu.

    As far as I can work it out you don't need to write the whole

    Code

    <?php include("phpBB2/online.php"); ?>


    you should just write it as

    Code

    include("phpBB2/online.php");


    hope this helps - let me know if it does =OD
  • sadly not, in fact it lost all the content of the home page, everything went and i had to delete the block via the database just to get back into admin?

    and as I have tried this bloc with the full code, I know that doesn't work either? so i am stumped, however as this IS a core block i think i will move this to core block support and see if they can help there, thanx for trying anyway, much appreciated.
  • Odd - I tested it on my installation of postnuke [7.2] and it worked fine. perhaps its a glitch Hope you have more luck elsewhere :D
  • well it was certainly an odd reaction, and we are using 0.7.2.3, i tried three times and the same thing happened.
  • Why not do a test to see if it actually the postnuke acting up or an incompatibility with the file you are calling.

    write a test .php file

    Code

    <?php
    echo( "this is a test");
    ?>


    upload it to the root directory of your postnuke installation.

    Then call it in a PHP block

    Code

    include("test.php");


    if it works then there must be a problem with it actually reading your phpbb/online.php file

    just a suggestion :D

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