Joseph L. LeBlanc
homeportfoliojoomlabiocontactblog
articles
guides
tutorials
all
forum
Subscribe in NewsGator Online

Learning Joomla! for the first time? Buy the Joomla! 1.5 Essential training CD-ROM or watch it on Lynda.com.

 

Welcome to Joseph LeBlanc's Joomla resources. First time visitors will find the Daily Message Component Tutorial to be helpful. (Daily Message for Joomla 1.0 is also available, as well as many other tutorials based around it). In addition to the tutorials, there are articles covering conceptual topics, such as the oft-asked question "What is the difference between a component and a module?" To receive alerts for new tutorials and articles, choose a newsfeed at the right appropriate for your newsreader.

PDF Print E-mail

 

dailymessage.class.php

 

<?

 

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

 

Yet again, this code should not be called from outside Mambo.

 

class joeDailyMessage extends mosDBTable {

var $id = null;

var $message = null;

var $date = null;

var $published = null;

 

This class extends the mosDBTable class, which provides many useful functions that make it easier to transfer data to and from the database. First, the variables identical to those found in the database table are declared. This way, other pieces of code can create joeDailyMessage objects, load them up with the variables desired, then send them to the database.

 

function joeDailyMessage(&$db){

$this->mosDBTable('mos_joe_dailymessage', 'id', $db);

}

 

}

 

This constructor takes a database object passed by reference and passes it along to the inherited mosDBTable() constructor, along with the table name [#_ shorthand for 'mos'] we wish to reference and name of the field containing the primary key.

 

 

class joeDailyMessageConf extends mosDBTable {

var $bold = null;

var $italic = null;

var $underline = null;

var $showdate = null;

var $configid = null;

 

function joeDailyMessageConf(&$db){

$this->mosDBTable('mos_joe_dailymessage_conf', 'configid', $db);

}

}

 

The joeDailyMessageConf class works in exactly the same way as the joeDailyMessage class, containing the variables found in the mos_joe_dailymessage_conf table and referencing 'configid' as the key.

 

?>