|
DMCA stands for Dynamic Module and Component Administration动态模块儿和组件管理
现在还是用面向过程的方法编写的dmca.php,但是从
[code:1]
$Id: dmca.class.php,v 1.0.0 2005/3/11 8:46:37 sirtoozee Exp $
[/code:1]
开始将DMCA封装,提供丰富的API
面向过程的方法编写的dmca.php源代码是:
[code:1]
<?php
/***************************************************************************
* dmca.php
* -------------------
* begin : Staurday, March 5, 2005
* copyright : (C) 2005 The sirtoozee Group
* email : [email protected]
*
* $Id: dmca.php,v nature 2005/3/5 20:49:00 sirtoozee Exp $
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
***************************************************************************/
if ( !defined('IN_NATURE') ) {
die("Hacking attempt");
}
include_once($nature_root_path . 'mods/mod_login.php');
$sql = "SELECT mod_name
FROM " . TABLE_PREFIX . "modules
WHERE mod_visible = '1'
AND mod_side = '0'
ORDER BY mod_weight";
$mod_name = $db->getCol($sql);
for ($i = 0; $i < count($mod_name); $i++) {
include_once($nature_root_path . 'mods/mod_' . $mod_name[$i] . '.php');
}
for ($i = 0; $i < count($mod_name); $i++) {
$left_mod[$i] = 'mod_' . $mod_name[$i] . '.htm';
}
$template->assign("LEFT_MOD", $left_mod);
$sql = "SELECT mod_name
FROM " . TABLE_PREFIX . "modules
WHERE mod_visible = '1'
AND mod_side = '1'
ORDER BY mod_weight";
$mod_name = $db->getCol($sql);
for ($j = 0; $j < count($mod_name); $j++) {
include_once($nature_root_path . 'mods/mod_' . $mod_name[$j] . '.php');
}
for ($j = 0; $j < count($mod_name); $j++) {
$right_mod[$j] = 'mod_' . $mod_name[$j] . '.htm';
}
$template->assign("RIGHT_MOD", $right_mod);
?>
[/code:1]
我准备模仿phpGACL的类库架构,同样适用了数据抽象层ADOdb、模版引擎Smarty、面向对象的QuickForm等杰出的PHP类库
希望有爱好PHP编程的fans加入进来 |
|