Fork me on GitHub

module pntable.php for .8 module  Bottom

  • I for the life of me cant get this to work. i have tried all kinds of different combinations, but whenever i print the $pntables array in the module, i only get one result back for the MemberList module and its empty.

    Code

    function MailingLists_pntables()
    {
        $pntable = array();

        $mailinglist_membership = pnDBGetTablePrefix('mailinglist_membership')  . '_mailinglist_membership';
        $pntable['mailinglist_membership'] = $mailinglist_membership;
        $pntable['mailinglist_membership_column'] = array ('mid' => 'pn_mid',
                                                     'uid' => 'pn_uid');

        $mailinglists = pnDBGetTablePrefix('mailinglists') . '_mailinglists';
        $pntable['mailinglists'] = $mailinglists;
        $pntable['mailinglists_column'] = array ('mid'          => 'pn_mid',
                                           'name'         => 'pn_name',
                                           'mtype'        => 'pn_mtype',
                                           'description'  => 'pn_description',
                                           'prefix'       => 'pn_prefix',
                                           'state'        => 'pn_state',
                                           'nbuser'       => 'pn_nbuser',
                                           'nbumax'       => 'pn_nbumax',
                                           'link'         => 'pn_link',
                                           'uidmaster'    => 'pn_uidmaster');

        $mailinglist_applications = pnDBGetTablePrefix('mailinglist_applications') . '_mailinglist_applications';
        $pntable['mailinglist_applications'] = $mailinglist_applications;
        $pntable['mailinglist_applications_column'] = array ('app_id'      => 'pn_app_id',
                                                       'uid'         => 'pn_uid',
                                                       'mid'         => 'pn_mid',
                                                       'application' => 'pn_application',
                                                       'status'      => 'pn_status');

        return $pntable;
    }


    Can someone look it over and give me some tips?

    Thanks,
    MACscr
  • BTW, im trying to access the table in another module by using this:

    Code

    $result =& $dbconn->Execute("SELECT $column[mid], $column[name] FROM $pntable[mailinglists] ORDER BY $column[name]");
        while(list($mid, $mname) = $result->fields) {
        $mailinglistnames[$mid] = $mname;
        $result->MoveNext();
        }
        $pnRender->assign('mailinglistnames', $mailinglistnames);
  • woo hoo, figured it out. had to load pnModDBInfoLoad('MailingList'); before my dbconn

    Just had to do some creative searching in the forums =P
  • There's no difference between .8 and .762 in this regard. Only modules in the system directory have their pntables.php included by default.

    --
    itbegins.co.uk - Zikula Consulting

    birtwistle.me.uk - Personal Blog


    Please read the Support Guide
  • yep, i figured that out. I wasnt really trying to point out that it was an issue with .8, its just that was what i was developing on.
  • 0 users

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