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

Module Programming  Bottom

  • I put that code in and I'm getting no error at all... I see my module in the modules list, it says Uninitialised, I click on Initialise and the page reloads and says "Module Initialised' and I can even activate it, but, alas, no DB tables are being made....

    Here's the table definition from pntables.php:

    Code

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

        $boxes = pnConfigGetVar('prefix') . '_boxes';

        $pntable['boxes'] = $boxes;

        $pntable['boxes_column'] = array('boxid' => $boxes . '.pn_boxid',
                                         'placer' => $boxes . '.pn_placer',
                                         'maintainer' => $boxes . 'pn_maintainer',
                                         'reg_date' => $boxes . '.pn_reg_date',
                                         'street_address' => $boxes . '.pn_address',
                                         'street_address1' => $boxes . '.pn_address1',
                                         'city' => $boxes . '.pn_city',
                                         'state' => $boxes . 'pn_state',
                                         'zip_code' => $boxes . 'pn_zip',
                                         'county' => $boxes . 'pn_county',
                                         'notes' => $boxes . 'pn_notes',
                                         'status' => $boxes . 'pn_status');
        return $pntable;
    }


    and here's the pnint function from pninit.php:

    Code

    function boxes_init()
    {
        list($dbconn) = pnDBGetConn();
        $pntable = pnDBGetTables();

        $boxestable = $pntable['boxes'];
        $boxescolumn = &$pntable['boxes_column'];
        $sql = "CREATE TABLE $boxestable (
                $boxescolumn[boxid] int(10) NOT NULL auto_increment,
                $boxescolumn[placer] varchar(32) NOT NULL default '',
                $boxescolumn[maintainer] varchar(32) NOT NULL default '',
                $boxescolumn[reg_date] date NOT NULL default '',
                $boxescolumn[street_address] varchar(64) NOT NULL default '',
                $boxescolumn[street_address1] varchar(64) NOT NULL default '',
                $boxescolumn[city] varchar(32) NOT NULL default '',
                $boxescolumn[state] varchar(2) NOT NULL default '',
                $boxescolumn[zip] varchar(9) NOT NULL default '',
                $boxescolumn[county] varchar(32) NOT NULL default '',
                $boxescolumn[notes] mediumtext NOT NULL default '',
                $boxescolumn[status] int(2) NOT NULL default 0,
                PRIMARY KEY(pn_boxid))"
    ;
        $dbconn->Execute($sql);

            if ($dbconn->ErrorNo() != 0) {
            pnSessionSetVar('errormsg',  _CREATETABLEFAILED.' '. $sql.' '.$dbconn->ErrorMsg());
            return false;
        }

        pnModSetVar('boxes', 'bold', 0);
        pnModSetVar('boxes', 'itemsperpage', 10);

        return true;
    }


    Any and all help is appriecated here!
  • 0 users

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