Thread: [phpMP-CVS] CVS: phpMP/docs MODULES,1.3,1.4
Status: Pre-Alpha
Brought to you by:
heimidal
From: Brian R. <hei...@us...> - 2002-07-21 22:29:27
|
Update of /cvsroot/phpmp/phpMP/docs In directory usw-pr-cvs1:/tmp/cvs-serv1644 Modified Files: MODULES Log Message: Might as well update this as I go along. Index: MODULES =================================================================== RCS file: /cvsroot/phpmp/phpMP/docs/MODULES,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** MODULES 21 Jul 2002 21:43:33 -0000 1.3 --- MODULES 21 Jul 2002 22:29:23 -0000 1.4 *************** *** 18,22 **** <? ! $mod_id = 'SAMPLE'; // File this code is contained in. class Module { // Standard. ALWAYS included. --- 18,26 ---- <? ! $mod_id = 'MP_SAMPLE'; // Mod ID. ! // When creating unofficial mods, please prepend this with a ! // (hopefully) unique developer id (just like tables and ! // other such things). In this case 'MP' is the ! // developer id. class Module { // Standard. ALWAYS included. *************** *** 31,35 **** // If you need to call other functions after this one, call them at the end. global $Template; // Makes the $Template class global. ! $Template->Blocking('BeginBig', array(PAGETITLE => $this->pagetitle)); // Begins a 'big' middle block. print "This is a test...<br>This is only a test...<br>\n"; // Prints a line. --- 35,41 ---- // If you need to call other functions after this one, call them at the end. global $Template; // Makes the $Template class global. ! ! // Begins a 'big' middle block. ! $Template->Blocking('BeginBig', array(PAGETITLE => $this->pagetitle)); print "This is a test...<br>This is only a test...<br>\n"; // Prints a line. *************** *** 46,50 **** Note that all modules must reside in the modules/ directory within ! the phpMP root. Alrighty...so. I guess the template object should be explained a bit. --- 52,63 ---- Note that all modules must reside in the modules/ directory within ! the phpMP root. In addition, a module must register with the phpMP ! Module Database, also known as the phpmp_modules table in the user's ! database. This contains the module's name, filename, Unix-qualified ! identifier, information on whether or not the module is actuve, and ! any data the module wishes to store in a single-string variable (which ! can be split, exploded, that sort of thing). ! ! Access the data string through $MPCONF['MOD']['data']. Alrighty...so. I guess the template object should be explained a bit. *************** *** 53,62 **** 1. $Template->PrintHeader() - Prints everything up to the left-side menu. 2. $Template->CreateSide('left') - Creates the left-side menu and table. ! 3. $Template->Blocking('BeginMain') - Begins the main/mid section of the table. Used for main content. If this is not called, most designs will be thrown COMPLETELY out of whack. ! 4. $Module->MakeContent() - Creates module content. Should contain BeginBig and EndBig statements. 5. $Template->Blocking('EndMain') - Ends the main/mid section of the table. 6. $Template->CreateSide('right') - Creates the left-side menu and table. 7. $Template->PrintFooter() - Prints copyright and any additional info needed. Next I'll explain the DBA class. It is used to access databases. --- 66,81 ---- 1. $Template->PrintHeader() - Prints everything up to the left-side menu. 2. $Template->CreateSide('left') - Creates the left-side menu and table. ! 3. $Template->Blocking('BeginMain') - Begins the main/mid section of the table. ! Used for main content. If this is not called, most designs will be thrown COMPLETELY out of whack. ! 4. $Module->MakeContent() - Creates module content. Should contain BeginBig and ! EndBig statements. 5. $Template->Blocking('EndMain') - Ends the main/mid section of the table. 6. $Template->CreateSide('right') - Creates the left-side menu and table. 7. $Template->PrintFooter() - Prints copyright and any additional info needed. + + Note that in future versions this order might (almost definitely) change. In that case, + your module will cease to function correctly. In the near future, version limitations + will be added so you won't have to worry about such things occuring. Next I'll explain the DBA class. It is used to access databases. *************** *** 89,93 **** These values are: ! $blockname - Title that is displaye in headerbar of block. $content - The HTML used to produce the main content of the block. --- 108,112 ---- These values are: ! $blockname - Title that is displayed in headerbar of block. $content - The HTML used to produce the main content of the block. *************** *** 120,129 **** To make the block actually appear, you must add a row to the phpmp_blocking table. ! This is the following format for a typical blocked module row: ! blockname - Used if $blockname can be static. You may then ommit the $content var. ! side - Right or Left. Self Explanatory. weight - lowest number comes first i.e. a module with a weight of 1 is displayed ! above one with a weight of 2. content - If block is COMPLETELY static with no PHP, you may put the $content here. is_php - Set to one if using external file. Set to 0 if content column is set. --- 139,152 ---- To make the block actually appear, you must add a row to the phpmp_blocking table. ! Eventually this will be handled by the administration area, but for now we get to ! do it manually! This is the following format for a typical blocked module row: ! blockname - $blockname is initially set to this. If creating a file-based block, ! you may override it (for dynamic change of the blockname) by setting ! $blockname to something else. ! side - Right or left. Self Explanatory. weight - lowest number comes first i.e. a module with a weight of 1 is displayed ! above one with a weight of 2. If two or more modules have the same weight, ! they will be sorted in the order in which they were added to the database. content - If block is COMPLETELY static with no PHP, you may put the $content here. is_php - Set to one if using external file. Set to 0 if content column is set. |