存档

文章标签 ‘drupal’

drupal向wp的移植过程

2008年5月24日 robertbao 3 条评论

终于下了决心把drupal整个换为wp了。

1、wp的表结构比drupal简单很多,要移植的主要就是四张表,

分类表wp_categories:

insert into wp_categories (cat_id, cat_name, category_nicename, category_description, category_parent) select term_data.tid, name, name, description, parent from term_data, term_hierarchy where term_data.tid=term_hierarchy.tid;

update wp_categories set category_count = (select count(post_id) from wp_post2cat where wp_categories.cat_id = wp_post2cat.category_id);

文章表wp_posts:

insert into wp_posts (id, post_date, post_content, post_title, post_excerpt, post_name, post_modified) select distinct n.nid, from_unixtime(created), body, n.title, teaser, replace(replace(replace(replace(lower(n.title),' ', '_'),'.', '_'),',', '_'),'+', '_'), from_unixtime(changed) from node n, node_revisions r where n.vid = r.vid;

update wp_posts set post_name = replace(post_name, '_', '-');

文章分类关系表wp_post2cat:

insert into wp_post2cat (post_id,category_id) select nid,tid
from term_node ;

评论表wp_comments:

insert into wp_comments(comment_post_id, comment_date, comment_content, comment_parent, comment_author, comment_author_email, comment_author_url) select nid, from_unixtime(timestamp), comment, thread, name, mail, homepage from comments ;

update wp_posts set comment_count = (select count(comment_post_id) from wp_comments where wp_posts.id = wp_comments.comment_post_id);

2、移植过程中一些问题的修正,

分类表中文章数:

update wp_categories set category_count =84 where cat_id=1;
update wp_categories set category_count =205 where cat_id=5;
update wp_categories set category_count =142 where cat_id=6;
update wp_categories set category_count =274 where cat_id=11;

参数表:

update wp_options set option_value='http://www.robertbao.com' where option_id=40 or option_id=1;

3、三个post转为page,并将post调整从1149开始继续计数,

alter table wp_posts auto_increment = 1149;

delete from wp_post_counter_time where post_id>='9527';
delete from wp_post_counter where post_id>='9527';
delete from wp_postmeta where post_id>='9527';

delete from wp_posts where id='1';
delete from wp_posts where id='2';
delete from wp_posts where id='3';

update wp_posts set id='1',guid ='http://www.robertbao.com/?page_id=1' where id='1151';
update wp_posts set id='2',guid ='http://www.robertbao.com/?page_id=2' where id='1150';
update wp_posts set id='3',guid ='http://www.robertbao.com/?page_id=3' where id='1149';

分类: WORK 标签: , ,

drupal升级记录

2008年5月23日 robertbao 没有评论

1、drupal:
备份数据库,备份ftp文件

2、theme:
保存themes/b9527
注意:engines中phptemplate升级

themes/b9527/node.tpl.php中删除原来添加的flexiblock:

<?php $blocks = theme(’flexiblock_blocks’, 1); ?>
<?php foreach ( $blocks as $block ) { ?>
<?php echo $block['content'] ?>
<?php } ?>

themes/b9527/node.tpl.php第二行删除:

<?php if ($picture) {
print $picture;
}?>

3、module:
tinymce×
trackback×
poormanscron
spam
glossary×
flexiblock×
nodewords×
sitemenu×
interwiki×
comment_info

4、index.php最后加入bbclone统计代码

5、注释掉blog.module中blog_link函数的主要内容,不显示单篇blog下的链接

6、comment模块中
function _comment_per_page() {}
评论数从300改为900

7、用自己的favicon.ico替换/misc/favicon.ico

8、设置中的文件系统路径files改为i

分类: WORK 标签: ,

加上5.1版的Spam模块

2007年5月17日 robertbao 没有评论

受不了了,一下子涌进来1000多条垃圾评论,要赶紧把Spam装上,在现在的这种网络环境下,像这种防垃圾评论的插件简直就应该直接集成在Core – optional中。

现在所有插件都统一在Administer -> Site configuration中配置,方便了很多。版本不兼容的插件在Administer -> Site building -> Modules中直接就不显示,根本就无法激活,这个改变也很好,感觉现在系统核心应该差不多了,很多地方需要细化的倒是很需要注意。

分类: WORK 标签: ,

网站升级到5.1版

2007年5月15日 robertbao 2 条评论

趁有空,修理一下网站

新版已经出来有段时间了,一直没时间来升级

以前的升级记录:

20050815–4.6.3
20060411–4.7.0rc2
20060515–4.7.0

没想到距升级上一个版本一晃整整一年时间了

替换文件,升级数据库

过程可以说很顺利

node表自动升级有一条语句有问题,自己手动去改了

新版都有哪些改变,还没来得及去体验

对我来说差不多功能已经足够用了

因为都是用离线书写,现在也不怎么上后台去看

现在的modules有了版本管理,很好,早该有了

本着简约实用的原则,我现在只选用两个额外的module

poormanscron和spam,只是现在还没有找到适合5.1的版本

分类: WORK 标签: ,

网站要调整的几件事

2007年1月10日 robertbao 1 条评论

1、Docs中的文档整理一下;

2、友情链接整理,样式修改;

3、About Me内容增加;

4、网站模块调整,去掉不常用的;

5、考虑修改网站名。

分类: WORK 标签: ,