Im making the Module_Tutorial and I ve a problem, becouse when i enter the Modul call nothin appears from the Text i want to be shown frontside.
Id looked @ my source and ive seen that theres a statement like this:""
What am I making wrong???? Ive simplified my version but Im not using now all my created Tables, couse I want to know how i can show me a simple message.
I hope someone can help me.
Code: Select all
<?php
/*******************************************************************
*
** Forum
*
**************************************************************/
/* Your initial Class declaration. This file's name must
be "[class's name].module.php", or, in this case,
Catlist.module.php
*/
class ATKForum extends CMSModule
{
/*---------------------------------------------------------
GetName()
must return the exact class name of the module.
If these do not match, bad things happen.
This is the name that's shown in the main Modules
page in the Admin.
---------------------------------------------------------*/
function GetName()
{
return 'ATKForum';
}
/*---------------------------------------------------------
GetFriendlyName()
This can return any string.
This is the name that's shown in the Admin Menus and section pages
(if the module has an admin component).
---------------------------------------------------------*/
function GetFriendlyName()
{
return 'ATKForum';
}
/*---------------------------------------------------------
GetVersion()
This can return any string, preferably a number or
something that makes sense for designating a version.
The CMS will use this to identify whether or not
the installed version of the module is current, and
the module will use it to figure out how to upgrade
itself if requested.
---------------------------------------------------------*/
function GetVersion()
{
return '0.0.1';
}
/*------------------------------------------------------
Install method
-------------------------------------------------------*/
function Install()
{
//Get a reference to the database
$db = $this->cms->db;
// mysql-specific, but ignored by other database
$taboptarray = array('mysql' => 'TYPE=MyISAM');
////////////////////////////////////////////////////
//Header
//Make a new "dictionary" (ADODB-speak for a table)
$dict = NewDataDictionary($db);
$flds = "id I KEY,
name C(200)";
$sqlarray = $dict->CreateTableSQL(cms_db_prefix().'ATK_Forum_Header', $flds, $taboptarray);
$dict->ExecuteSQLArray($sqlarray);
//Now create a "sequence", which is used internally by CMSMS and ADODB
// to increment our id value each time a new record is inserted into the table.
$db->CreateSequence(cms_db_prefix().'ATK_Forum_Header_seq');
//
//////////////////////////////////////////////////////
//Thread
$dict = NewDataDictionary($db);
$flds = "id I KEY,
name C(200),
admin C(200)";
$sqlarray = $dict->CreateTableSQL(cms_db_prefix().'ATK_Forum_Thread', $flds, $taboptarray);
$dict->ExecuteSQLArray($sqlarray);
//Now create a "sequence", which is used internally by CMSMS and ADODB
// to increment our id value each time a new record is inserted into the table.
$db->CreateSequence(cms_db_prefix().'ATK_Forum_Thread_seq');
//
//////////////////////////////////////////////////////
//Thema
$dict = NewDataDictionary($db);
$flds = "id I KEY,
name C(200),
author C(200),
views I";
$sqlarray = $dict->CreateTableSQL(cms_db_prefix().'ATK_Forum_Thema', $flds, $taboptarray);
$dict->ExecuteSQLArray($sqlarray);
//Now create a "sequence", which is used internally by CMSMS and ADODB
// to increment our id value each time a new record is inserted into the table.
$db->CreateSequence(cms_db_prefix().'ATK_Forum_Thema_seq');
//
//////////////////////////////////////////////////////
//Post
$dict = NewDataDictionary($db);
$flds = "id I KEY,
Inhalt X(200),
author C(200),
datum ". CMS_ADODB_DT;
$sqlarray = $dict->CreateTableSQL(cms_db_prefix().'ATK_Forum_Post', $flds, $taboptarray);
$dict->ExecuteSQLArray($sqlarray);
//Now create a "sequence", which is used internally by CMSMS and ADODB
// to increment our id value each time a new record is inserted into the table.
$db->CreateSequence(cms_db_prefix().'ATK_Forum_Post_seq');
//
/////////////////////////////////////////////////////////////////
//
$this->CreatePermission('Catlist Admin', 'Manage Catlist');
}
function Uninstall()
{
//Get a reference to the database
$db = $this->cms->db;
/////////////////////////////////////////////////////////
//Delete Header
//Remove the database table
$dict = NewDataDictionary( $db );
$sqlarray = $dict->DropTableSQL( cms_db_prefix().'ATK_Forum_Header' );
$dict->ExecuteSQLArray($sqlarray);
//Remove the sequence
$db->DropSequence( cms_db_prefix().'ATK_Forum_Header_seq' );
//
///////////////////////////////////////////////////////
//Delete Thread
$dict = NewDataDictionary( $db );
$sqlarray = $dict->DropTableSQL( cms_db_prefix().'ATK_Forum_Thread' );
$dict->ExecuteSQLArray($sqlarray);
//Remove the sequence
$db->DropSequence( cms_db_prefix().'ATK_Forum_Thread_seq' );
//
/////////////////////////////////////////////////////
//Delete Thema
$dict = NewDataDictionary( $db );
$sqlarray = $dict->DropTableSQL( cms_db_prefix().'ATK_Forum_Thema' );
$dict->ExecuteSQLArray($sqlarray);
//Remove the sequence
$db->DropSequence( cms_db_prefix().'ATK_Forum_Thema_seq' );
//
////////////////////////////////////////////////////
//Delete Post
$dict = NewDataDictionary( $db );
$sqlarray = $dict->DropTableSQL( cms_db_prefix().'ATK_Forum_Post' );
$dict->ExecuteSQLArray($sqlarray);
//Remove the sequence
$db->DropSequence( cms_db_prefix().'ATK_Forum_Post_seq' );
//
////////////////////////////////////////////////////
//Remove the permission
$this->RemovePermission('Catlist Admin');
}
/**************************************************************************
*
*
*
*
*************************************************************************/
function DoAction($action, $id, $params, $returnid=-1)
{
if ($action == 'default')
{
echo 'asdfasdf
asdfsa
asdf <br><br><br><br><br><br><br>afdasfasfd<br><br><br>adfdafasdfas';
}
return;
}
}
?>