Fork me on GitHub

Adding a new item to incoming content of menu/incoming block  Bottom

  • Hi all,

    I'm trying to add interfaces to some 3rd party modules for the incoming content area of the menu block. I've followed the code in /includes/blocks/menu.php that supports the core modules but I've run into a problem. One of the modules I tried was for incoming business listings in the bizpages module. It only works when I'm on the bizpages module page. If I'm on the home page or any other page it will not display the incoming content on the menu or incoming block. The core module stuff works no matter what page you have loaded. I've referenced http://community.pos…pic-topic-49229.htm for DB connection information but still cannot understand why it only works when the module is loaded. Is the database tables for 3rd party modules loaded only when the page is loaded and not global like the core module tables ?? Any help with clues on this problem would be appreciated.

    Here is my code:

    Quote

    // bizpages module :: Pending new and changed bizpage listings.
    ///////////////////////////////////////////////////////////////
    if (pnSecAuthAction(0, "bizpages::", '::', ACCESS_ADD) && pnModAvailable('bizpages')) {
    $result =& $dbconn->Execute("SELECT count(1) FROM $pntable[bizpages_bizpending]");
    if ($dbconn->ErrorNo() == 0) {
    list($fnum) = $result->fields;
    $result->Close();
    if ($fnum) {
    $waiting .= addMenuStyledUrl($vars['style'], "BizPages: $fnum", "index.php?module=bizpages&type=admin&func=bizselect&swhere=pending&bfield=status&btable=bizpending", "");
    }
    }


  • shameless bump since 1 month no posts in this forum
  • You would be better off writing a module API function and calling that to get your items...

    --
    itbegins.co.uk - Zikula Consulting

    birtwistle.me.uk - Personal Blog


    Please read the Support Guide
  • Good call. Thanks HammerHead. I'll do that and post the code here in case anybody is interested. Still wondering about how and when module-specific database tables are loaded for other projects. Are all the core tables loaded globally for some reason but 3rd party are not? I saw in code for PNphpBB2 when they check private messages they have access to the 'Messages' module tables and column, but it wouldn't work like that for when I tried to change it to the new 'pnMessages' tables and columns. Luckily due to your suggestion I realize that was the wrong approach anyways and should do as you suggest in your reply for that also. However I'm still curious to know more about why some seem accessible and others arent? Just to get better at Postnuke development overall. I read in the dev docs that tables get loaded when the module get loaded but this leaves me confused about how sometimes the table for the core modules seem accessible?

    Shortly after posting this I may have found my own answer. Is this it?

    Quote

    pnModLoad('pnMessages');




    edited by: pnDev, Nov 04, 2006 - 12:33 AM
  • pnDev,I'm really looking forward to your code.

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