I come here for ask something that have me in a trouble.
I started to code a module. I read many manuals and study the whole Example mod. When I finished the pntables and pninit files, I tried to initialize it but nothing happens. The postnuke 0.762 installation is correct (other mods. start correctly)
The mod folder's name is revist.
Here you are the content of both files. What I done wrong?
pntables.php
Code
pninit.php
Code
<?php
function revist_init()
{
$dbconn =& pnDBGetConn(true);
$pntable =& pnDBGetTables();
$revtable = &$pntable['revista'];
$revcolumn = &$pntable['revista_column'];
$dict = &NewDataDictionary($dbconn);
$taboptarray =& pnDBGetTableOptions();
$flds = "
$revcolumn[rid] I NOTNULL AUTOINCREMENT PRIMARY,
$revcolumn[rurl] C NOTNULL DEFAULT '',
$revcolumn[rfecha] D NOTNULL DEFDATE,
$revcolumn[rimagen] C NOTNULL DEFAULT ''
";
$sqlarray = $dict->CreateTableSQL($revtable, $flds, $taboptarray);
if ($dict->ExecuteSQLArray($sqlarray) != 2) {
pnSessionSetVar('errormsg', _EXAMPLECREATETABLEFAILED);
return false;
}
return true;
}
function revist_delete()
{
$dbconn = pnDBGetConn(true);
$pntable = pnDBGetTables();
$revtable = $pntable['revista'];
$dict = &NewDataDictionary($dbconn);
$sqlarray = $dict->DropTableSQL($revtable);
if ($dict->ExecuteSQLArray($sqlarray) != 2) {
pnSessionSetVar('errormsg', _EXAMPLEDROPTABLEFAILED);
return false;
}
return true;
}
function revist_update()
{
return true;
}
?>
function revist_init()
{
$dbconn =& pnDBGetConn(true);
$pntable =& pnDBGetTables();
$revtable = &$pntable['revista'];
$revcolumn = &$pntable['revista_column'];
$dict = &NewDataDictionary($dbconn);
$taboptarray =& pnDBGetTableOptions();
$flds = "
$revcolumn[rid] I NOTNULL AUTOINCREMENT PRIMARY,
$revcolumn[rurl] C NOTNULL DEFAULT '',
$revcolumn[rfecha] D NOTNULL DEFDATE,
$revcolumn[rimagen] C NOTNULL DEFAULT ''
";
$sqlarray = $dict->CreateTableSQL($revtable, $flds, $taboptarray);
if ($dict->ExecuteSQLArray($sqlarray) != 2) {
pnSessionSetVar('errormsg', _EXAMPLECREATETABLEFAILED);
return false;
}
return true;
}
function revist_delete()
{
$dbconn = pnDBGetConn(true);
$pntable = pnDBGetTables();
$revtable = $pntable['revista'];
$dict = &NewDataDictionary($dbconn);
$sqlarray = $dict->DropTableSQL($revtable);
if ($dict->ExecuteSQLArray($sqlarray) != 2) {
pnSessionSetVar('errormsg', _EXAMPLEDROPTABLEFAILED);
return false;
}
return true;
}
function revist_update()
{
return true;
}
?>
Please help!! THANKS!
edited by: SiCk949, Jun 28, 2006 - 02:50 PM
