用户名 密码 记住我 还未注册?

文章管理 - 如何用article模块替代新闻管理

文章管理 :: 文章管理

如何用article模块替代新闻管理


article是一个完善的文章、新闻以及blog管理模块。可以采用article替代XOOPS传统的news模块,主要涉及到数据的转换、相关模块wfdownloads的调整和backend.php的修改
news article
第一步:按照模块克隆指南的说明复制"news"模块

第二步:(如果是全新安装news,可以跳过此步)运行 XOOPS/modules/news/import/news.php

第三步:升级(或全新安装)news模块

第四步:设置/调整模块权限和区块设置

第五步:修改XOOPS/backend.php(代码附后)

第六步:如果使用wfdownloads模块,用后边的代码替换 /wfdownloads/admin/newstory.php 的内容


附一:将下列代码添加到XOOPS/backend.php头部

chdir
("./modules/news/");
$_SERVER'PHP_SELF' ] = dirname($_SERVER'PHP_SELF' ])."/modules/news/xml.php";
$_SERVER'REQUEST_URI' ] = $_SERVER'PHP_SELF' ]."?rss";
include 
"xml.php";
exit();


附二:用下列代码替换/wfdownloads/admin/newstory.php
<?php
$category_handler 
=& xoops_getmodulehandler("category""news");
$cat_id = isset($_POST["cat_id"]) ? intval($_POST["cat_id"]) : ;
$category_obj =& $category_handler->get($cat_id);
$isModerator $category_handler->getPermission($category_obj"submit");
if( !
$category_handler->getPermission($category_obj,"submit") ) {
    return;
}

$article_handler =& xoops_getmodulehandler("article""news");
$article_obj =& $article_handler->create();
$article_obj->setVar("art_title"$title);
$art_summary $_POST["description"]. "rnrn".$title."";
$article_obj->setVar("art_summary"$art_summary);
$article_obj->setVar("cat_id"$cat_id);
$article_obj->setVar("uid"$xoopsUser->getVar("uid"));
$article_obj->setVar("art_time_create"time());
$article_obj->setVar("art_time_submit"time());
$article_obj->setVar("art_time_publish"time());
$art_id_new $article_handler->insert($article_obj);

$cats[$cat_id] = array( "status" => 1"uid" => $article_obj->getVar("uid") );
$article_handler->registerCategory($article_obj$cats);
$article_handler->updateCategories($article_obj);

$text_handler =& xoops_getmodulehandler("text""news");
$text_obj =& $text_handler->create();
$text_obj->setVar("art_id"$article_obj->getVar("art_id"));
$text_obj->setVar("dobr"1);
$text_obj->setVar("text_body"$art_summary);
$text_id $text_handler->insert($text_obj);

$article_obj->setVar("art_pages", array($text_id), true); // NOT GPC, important!
$article_handler->insert($article_obj);
?>
<< 文章管理模块评测报告
分类
Xoops 模块 模块Hack

跟踪网址
  • 文章地址: http://xoops.org.cn/modules/article/view.article.php/c2/16
  • 跟踪地址: http://xoops.org.cn/modules/article/trackback.php/16
API: 工具箱 短消息 Email PDF 书签 打印 | RSS | RDF | ATOM
Copyright© D.J. & XOOPS CHINA
网友个人意见,不代表本站立场。对于发言内容,由发表者自负责任。
发表者 树状展开
WOC
发表日期: 11月07日 14:54  更新: 11月07日 14:54
高级会员
注册日期: 08月23日
来自:
发表总数: 143
 评: 如何用article模块替代新闻管理
打字有错?复制article模块而不是news?
WOC
发表日期: 11月08日 13:28  更新: 11月08日 13:28
高级会员
注册日期: 08月23日
来自:
发表总数: 143
 评: 如何用article模块替代新闻管理
明白了,是指把article复制成为名叫news的模块。然后取代原来的news。
ffxk
发表日期: 01月19日 00:56  更新: 01月19日 00:56
项目管理员
注册日期: 07月19日
来自: 重庆
发表总数: 1273
 评: 如何用article模块替代新闻管理
article模块替代新闻管理?
这样来说就是原来在使用news模块,现在要放弃使用news但是又要保留数据的情况下转到article上,那么
引用:
第二步:(如果是全新安装news,可以跳过此步)运行 XOOPS/modules/news/import/news.php

这个含义是什么,为什么别人要全新安装news后又转到article上了,那不是多找事情吗?

后面的更不明白了。
D.J.
发表日期: 01月19日 11:02  更新: 01月19日 11:02
网站管理员
注册日期: 06月25日
来自:
发表总数: 5950
 评: 如何用article模块替代新闻管理
意思是全新安装用article改装的news
是有些模糊
domecc
发表日期: 01月19日 13:04  更新: 01月19日 13:04
网站管理员
注册日期: 10月29日
来自: 北京
发表总数: 2214
 评: 如何用article模块替代新闻管理
同样的一个名称news,代表了新旧两个不同的news,以后应该写得更明确些。
ffxk
发表日期: 01月29日 04:23  更新: 01月29日 04:23
项目管理员
注册日期: 07月19日
来自: 重庆
发表总数: 1273
 评: 如何用article模块替代新闻管理
试着做了一次转换,没有成功,我用article 1.0克隆为NEWS后,升级后原news的数据没有了。

谁来完善这个教程,说得更具体点.