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 标签: ,

中国加油!

2008年5月12日 robertbao 8 条评论

分类: PASTIME 标签: ,

提高工作效率-00:开场白

2008年4月5日 robertbao 没有评论

对于为什么要提高效率,无论是在工作中还是生活中的意义,这个在这里我就不多说了。

以前看过一个统计,对于一件正面的事情,大约有80%的人会想去实现,但其中只有20%的人知道正确的方法,在知道正确方法的人中又只有10%的人会去尝试行动,但最后能够坚持下来的人不超过20%,按照这个统计,10000个人中最后能够成功达成目标的不会超过32个。我想对于提高效率的意愿和方式来说,概率也大抵如此吧。

分类: WORK 标签: , ,

HP-UX下安装Vim

2008年3月5日 robertbao 没有评论

HP-UX默认的vi不好用,我在上面总是习惯首先就用vim把它替换掉。

源码包安装
gzip -d vim-7.0.tar.gz
tar xvf vim-7.0.tar
cd vim-7.0
./configure –prefix=vim-7.0 –with-features=big –enable-multibyte
make
make install

配置一下
mv /usr/bin/vi /usr/bin/vi.bak
ln -s /usr/local/bin/vim /usr/bin/vi
或者
alias vi=”vim”

安装插件
ctags、taglist、A、lookupfile等插件都是必装的,就不多说了。

解决退格删除问题
cp /usr/local/share/vim/vim70/vimrc_example.vim ~/.vimrc

解决汉字乱码问题
1、设置环境变量
vi /etc/rc.config.d/LANG
默认的内容为:
LANG=C
export LANG
改为:
LANG=zh_CN.hp15CN
export LANG
2、增加这一行到/etc/profile
stty -istrip -parity cs8
3、重新登录
* 你可以检查这个文件/etc/kbdlang看内容是不是
PS2_DIN_S_Chinese

分类: WORK 标签: ,