中国加油!

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′;

drupal升级记录

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

上来看看

真是时光似箭,转眼都一年没上来写点啥了…

Word 2007 中的书法字帖

shufa.jpg

看到上面的书法字体了吗,很帅吧,可别以为是我写的,我现在都不知道笔咋握了~~~

上面的字其实都是用 Word 2007 中的”书法字帖”功能写出来的,这项功能可以灵活地创建字帖文档,自定义字帖中的字体颜色、网格样式、文字方向等,然后将它们打印出来,就像小时候练字的字帖一样了。

具体创建过程很简单:

1、在”新建文档”对话框中选择”书法字帖”;

2、在”书法”选项卡中点击”增减字符”,在”书法字体”包含的11种类型列表中,选择要使用的字体类型;

3、单击”关闭”按钮,选择的字符就会添加到文档中,同时打开”书法”工具栏,可以进行各种颜色、样式方面的调整。

同时还可以选择”网格样式”,包括了常见的米字格、田字格等(怎么没有回宫格,hehe),这样打印出来,就可以像字帖一样进行书法练习了。

style.jpg

PS:只是现在每种字体的字库数量还比较少,数量最多的汉仪赵楷繁,也不过才2010个字,甚至比不上老徐的6000多字,这样就会有很多常用字找不到,期待 Word 以后的完善吧…

效果不错

collage.jpg


去年8月买的 K800i,11月买的 T60,用到今天依旧坚挺

K800i 随手抓拍效果依旧很好

T60 用整整一天也只是微热

这些…我…很满意…

我买东西都是事前准备比较多,在网上会考察很长时间,真正实地去买的时候,包括挑货、砍价也就半个多小时搞定

这也真有风险,hehe,还好没买到劣品…

PS:合租的一个同事刚买了 Wii,最近有空玩了几次,真是太爽了…棒球、保龄、网球…还真有真实的感觉…唉,就是客厅小了点,都发挥不出来,玩的时候经常互相打到…真是个好的锻炼身体的东东…也想搞一个了…

Google 发布 Apps Partner Edition

Google 发布 Apps Partner Edition,即 Google Apps 的合作伙伴专用版。

这是一个大手笔,未来这个领域的钱途一定是不可限量。只要能够保障信息安全,并且企业与 Google 没有业务冲突,不担心内部信息被 Google 窃取,这些企业就不必再花费自己的资源为用户和企业内部本身搭建这些服务,因为 Google Apps 已经为它们提供现成可靠及更廉价的解决方案。

Feedburner 推出中文版

Feedburner 终于推出中文版了,中文简体和中文繁体同时发布,虽然现在还只是 beta,许多页面的翻译还差的太远,有的只翻译了一个标题,但毕竟已经走了进来,以后中文 feeds 市场的少数几家竞争者的日子也不太好过了。

当然在这个市场上,本地化并不是最重要的,稳定的托管和服务才是一个 Blogger 选择 feeds 托管商的最优先考虑,现在 Feedburner 可以说已经是 feeds 领域唯一的王者了,占了大半市场,最近又有消息说 Google 也想收购它,难不成未来的 web 就统统是 Google 的天下,就像现在的 Microsoft 之于个人桌面,虽然对 Google 推崇有加,但是整个领域一家独大永远不是好事。

StarCraft 2 正式发布

starcraft2.jpg

Blizzard 网站首页上的倒计时终于走到了终点。每过一天,一个历史游戏就会由暗色变成亮色,上面的图片也换成对应的游戏图片,直到倒计时结束就是最后的那个问号了。

今天最后的问号终于揭晓,Blizzard 在韩国首尔举办的暴雪精英赛上发布了此作,是 StarCraft 2!全世界疯狂的星际迷们又可以狂欢了!

什么时候轮到 Diablo 3,期待、期待、期待!

blob index错误

数据库升级为mysql 5.0,重新导入表的时候出现如下错误:

#
# table structure for table ‘locales_source’
#
create table /*!32300 if not exists*/locales_source(
lid int( 11 ) not null auto_increment ,
location varchar( 255 ) not null default ”,
source blob not null default ”,
primary key ( lid ) ,
index source( source )
);

MySQL answer : #1170 - BLOB/TEXT column ’source’ used in key specification without a key length

在mysql官方网站上找到了解决办法:http://forums.mysql.com/read.php?10,113556,113556#msg-113556

mysql5.0以后text/blob index需要指定长度,改为下面的写法就通过了,

#
# table structure for table ‘locales_source’
#
create table /*!32300 if not exists*/locales_source(
lid int( 11 ) not null auto_increment ,
location varchar( 255 ) not null default ”,
source blob not null default ”,
primary key ( lid ) ,
index source( source( 30 ) )
);