可以在主管理界面增加和编辑全站文章分类。
用户每发表一篇文章需要选定系统分类。
5.5.1. 修改文件:
class/controller/ admincontrollermap.properties.php.class 中增加
$actions["newGlobalArticleCategory"] = "AdminNewGlobalArticleCategoryAction";
// adds the category to the db
$actions["addGlobalArticleCategory"] = "AdminAddGlobalArticleCategoryAction";
// shows the category of the blog
//edit globalarticle categories.
$actions["editGlobalArticleCategories"] = "AdminEditGlobalArticleCategoriesAction";
// deletes an article category from the database
$actions["deleteGlobalArticleCategory"] = "AdminDeleteGlobalArticleCategoryAction";
$actions["deleteGlobalArticleCategories"] = "AdminDeleteGlobalArticleCategoryAction";
// edits an article category
$actions["editGlobalArticleCategory"] = "AdminEditGlobalArticleCategoryAction";
// updates the category
$actions["updateGlobalArticleCategory"] = "AdminUpdateGlobalArticleCategoryAction";
templates/admi/menu.xml
<manageGlobalArticleCategory ignoreBreadCrumbs="1">
<editGlobalArticleCategories url="?op=editGlobalArticleCategories" />
<newGlobalArticleCategory url="?op=newGlobalArticleCategory" />
</manageGlobalArticleCategory>
5.5.2. 增加文件
目录class/action/Admin
class/action/admin/AdminNewGlobalArticleCategoryAction.class.php
class/action/admin/AdminAddGlobalArticleCategoryAction.class.php
class/action/ admineditglobalcategoriesaction.class.php
class/action/ admineditglobalcategoryaction.class.php
class/action/admindeleteglobalarticlecategoryaction.class.php
class/action/adminupdateglobalarticlecategoryaction.class.php
Class/aciton/admin/adminaddpostaction.class.php
Class/action/admin/adminpostmanagementcommonacion.class.php
目录:class/view
class/view/ adminglobalarticlecategorieslistview.class.php
Class/view/Adminnewpostview.class.php
Class/view/Admineditpostview.class.php
目录:class/dao
class\dao\globalarticlecategory.class.php
class\dao\globalarticlecategories.class.php
Class/dao/article.class.php
Class/dao/articles.class.php
目录:template/admin/
templates/admin/globalsettings_articlecategoreis.template
templates/admin/globalsettings_editarticlecategoreis.template
templates/admin/globalsettings_newArticlecategory.template
Templates/admin/newpost.template
Templates/admin/editpost.template
5.5.3. 数据库
数据库中增加字段:
ALTER TABLE `plog_article_categories_link` ADD `global_category_id` INT( 10 ) DEFAULT '0' NOT NULL ;
增加数据表:
CREATE TABLE `plog_global_articles_categories` (
`id` int(10) unsigned NOT NULL auto_increment,
`name` varchar(255) NOT NULL default '',
`url` varchar(255) NOT NULL default '',
`last_modification` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
`parent_id` int(10) NOT NULL default '0',
`description` text NOT NULL,
`properties` text NOT NULL,
`mangled_name` varchar(255) NOT NULL default '',
PRIMARY KEY (`id`),
KEY `parent_id` (`parent_id`),
KEY `mangled_name` (`mangled_name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
然后修改locale文件;
修改class/summary/dao下的summarystat.class.php增加按系统分类查询文章的功能,修改class/summary/view/defaultactionview.class.php 增加调用,修改templates/summary/index.template增加显示,以实现在summary 页面上
按系统分类显示文章。
效果如下:
www.vVlogger.com——自己不知道怎么打开debug,所以调试的很慢,开发的工作量比我想象的大的多,累得吐血。
MARK,你看这样的系统分类方式是否符合PLOG的开发目标,如果符合怎样提交给PLOG。