Fork me on GitHub

PNphpBB2 Multi-block in Zikula 1.2.2  Bottom

  • I posted this over on the zafenio site forums, but they seem fairly dead, so I'm hoping for better luck here and apologize for the cross-posting. I also recognize this problem is related to this post discussing W3C compliancy where multi-block is recognized as being a very old script.

    Multi-block does not seem to be working in the latest zikula. The existing multi-block on my index page does not appear, and when I try to create a new block, PNphpBB2/Multi-block does not appear as an option.

    I've attempted to follow the zikula wiki entry on block creation, which appears to have some different language/procedures than that in the latest release of the multiblock.php file. I'm not a coder, however, and haven't been successful in modifying the file. Have I diagnosed this problem correctly or is there another explanation for why my multi-block doesn't work?

    I'm running zikula 1.2.2 and PNphpBB2 1.4i patch4rc2, and some manner of displaying the latest forum posts on my index page is critical!

    Thank you.
  • I can confirm this problem, latest version of Zikula to use the Multiblock is 1.1.2. Unfortunately this is very old code which never validated correctly. We would need a complete re-write for > 1.2.0, and there is no developer ATM interested in doing it. So, sorry - no Multiblock in PNphpBB2 if you use Zikula > 1.1.2.
    Greetings,
    Chris

    --
    an operating system must operate
    development is life
    my repo
  • I did not realize that the block cannot even be created anymore in Zikula 1.2+. Slam, can you confirm this?
    Rewriting that beast to follow W3 standards is one thing, but I thought at least the back-end worked correctly.

    Since I use PNphpBB2 on two of my sites (one of them is 1.1.2, waiting to upgrade to 1.2), I'll try and see if I can come up with something...

    --
    -- Teb
    -- Dutch Zikula Community


    Support questions in a Personal Message will be ignored. Use the forums at all times!
  • Yes, confirmed. I also started to hack the block to get it working "somehow" again in 1.2.2, but run out of time.
    Greetings,
    Chris

    --
    an operating system must operate
    development is life
    my repo
  • As an interim solution, I managed to adapt a recent posts script for phpbb2, upload it to my root as a PHP file, and use the Zikula Simple File Include block to get the latest forum posts on my homepage. Thought I'd share.

    Change the dbuser, dbpasswd, and dbname places with your DB info. And you may need to change the first part of table_prefix from 'nuke' to whatever your prefix is (i.e. PN, zk, etc.). Change topicnumber to the number of recent posts you want displayed.

    Edit...for some reason, the < br> tags in the code below are being parsed and not displayed. To get them to show I've added a /, so before use, convert the code < /br> to < br>.

    Code

    <?php
        // How Many Topics you want to display?
        $topicnumber = 5;
        // Change this to your phpBB path
        $urlPath = "/index.php?name=PNphpBB2";
     
        // Database Configuration (Where your phpBB config.php file is located)
    $dbhost      = 'localhost';
    $dbuser    = 'yourdbusername';
    $dbpasswd  = 'yourdbpassword';
    $dbname  = 'yourdbname';
     
        $table_prefix = "nuke_phpbb_";
        $table_topics = $table_prefix."topics";
        $table_forums = $table_prefix."forums";
        $table_posts = $table_prefix."posts";
        $table_users = $table_prefix."users";
        $link = mysql_connect("$dbhost", "$dbuser", "$dbpasswd") or die("Could not connect");
        mysql_select_db("$dbname") or die("Could not select database");
     
        $query = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username
        FROM $table_topics t, $table_forums f, $table_posts p, $table_users u
        WHERE t.topic_id = p.topic_id AND
        f.forum_id = t.forum_id AND
        t.forum_id != 4 AND
        t.topic_status <> 2 AND
        p.post_id = t.topic_last_post_id AND
        p.poster_id = u.user_id
        ORDER BY p.post_id DESC LIMIT $topicnumber"
    ;
        $result = mysql_query($query) or die("Query failed");                                    
     
        print "<table cellpadding='0' cellSpacing='0' width='100%'>";
        while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
     
        echo  "<tr valign='top'><td style='border-bottom: 1px dotted #CCCCCC'><a href=\"$urlPath&file=viewtopic&t=$row[topic_id]\">" .
       
        $row["topic_title"] .
        "</a></br><small> by: " .
        $row["username"] .
        "</br>" .
        date('F j, Y, g:i a', $row["post_time"]) .
        "</td></tr></small>";
        }
        print "</table><ul><li><a href=\"/index.php?name=PNphpBB2\">All Discussion Forums</a></li></ul>";

        ?>




    edited by: drgop, datetimebrief

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