DFdou's Blog Life is short,Be yourself.

2201/090

WordPress Plugins-Global Translator

An other translator plugin for WordPress,a few days ago,I introduced Language Translator plugin,because Language Translator doesn't support some languages i want,so I deactivate it.
Just now,I found Language Translator in http://www.nothing2hide.net/web/wordpress-global-translator-plugin/,download and install.
This is a good plugin,support 4 translate engine,and you can configure it easily for your requirement.
The drawback of this plugin is...En,In fact,for all translate plugins,this is inevitable,because it's translated by machine,not human...

2201/090

Flash-How to determine the existence of the MovieClip

Yesterday's work,need to determine the existence of the MovieClip.I ask this question at blueidea,today,comes the answer:

var mc_login=new login();//login is a class in the flash library
//need to determine mc_login whether in display list or not
if (mc_login is DisplayObject && mc_login["parent"]  ) {
       trace("mc_login is exist");
} else {
       trace("there is no one called mc_login");
       addChild(mc_login);
}
2001/092

WordPress Plugins-Language Translator

If you want a multi-languages blog,I think you need this plugin.
Just now i download Language-Translator-Plugin and installed. This plugin uses google translate to translate your site into other languages.
The live demo is there in the siderbar. Click a flag to choose one language. Then the url will be redirected to google's translate engine,then wait a moment,you will see the content which is in the language you choose.
AH,although it's not so nice,but i think it's working well rather than my grungy english.
----------------------------------------------------------------------------------------------------------------
PS:I modified this plugin,en,cut some flags i don't need.

2001/090

WordPress 2.7 Theme Changes

From http://ericulous.com/2008/10/27/wordpress-27-theme-changes/
A comparison of the Default wordpress theme (v2.7 vs v2.6).中文内容是我写的~

Old: div class=”post”
New:div < ?php post_class() ?>

Found: multiple files
Display the classes for the post div e.g class=”sticky category-uncategorized tag-untagged”. Using this function will break your theme on older version of Wordpress (< v2.7). Not using this, however, you are unable to style your individual sticky/category/tag post. Workaround would be to do a if function_exists() check.
v2.7提供了日志固顶功能,因此提供了这个API,需要对固顶日志进行自定义的记得加上。

Old: <?php include (TEMPLATEPATH . '/searchform.php'); ?>
New: < ?php get_search_form(); ?>

Found: multiple files
Will first attempt to locate the searchform.php file in either the child or the parent, then load it. If it doesn’t exist, then the default search form will be displayed. Probably can safely ignore this for now because if you use this template function, your theme will not be backward compatible to older version of Wordpress (< v2.7).
搜索框的调用,比以前的include引用好多了,现在可以跟header,footer一样使用 get_search_form()调用了。

<link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="< ?php bloginfo('atom_url'); ?>" />

Found: header.php
Add Atom feed link
随着时代的进步,也该加上Atom Feed了,有没检查一下你的Blog Theme,有没加Atom Feed呢?哈哈,nwhy.org的没有加……

New:< ?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>

Found: header.php
Add script for threaded comments if current page is a single post, is a page, or is an attachment.
v2.7支持comment的嵌套回复,我想这是v2.7的一个大新闻吧,这一点就是针对这一功能的。
不过大家都说WP的嵌套回复不好用……
--------------------------------------------------------------------------------------------
comments.php: Major code changes. I think this post on Wordpress 2.7 Comments Enhancements will do a better job of explaining the changes.
没错,comments.php文件做了很大的修改,像nwhy.org当前使用的theme就没有嵌套回复功能……

2001/090

WordPress Plugins-Top Level Categories

I'm tired of the categories' permalink of WordPress,so i search for a plugins to rewrite it,then i find Top Level Categories.
If you also need this plugins,you can download from here:http://fortes.com/projects/wordpress/top-level-cats/.
How to use it? Just follow me:

Install
1. Unzip top-level-cats.zip into your wp-content/plugins directory
2. Activate the plugin through the ‘Plugins’ menu in WordPress
3. That’s it! :)
Uninstall
1. Deactivate the plugin through the ‘Plugins’ menu
2. That’s it!

And,you want automatically redirect people from the old category permalink?
OK,download this:Permalink Redirect Plugin,
Install it,active it,then,old url from the search engine will be redirected to the new url.

1901/090

WordPress -Template System模板系统

wordpress-template
当我看到这张图的时候,着实讶异,原来WordPress的模板系统比想像中强大很多。
如此一来,WordPress就完全可以当成一个CMS系统,而不仅仅是一个Blog那么简单了。
从图上我们可以看出,最简单的WordPress皮肤,只要一个index.php就可以了。
当然,我们最关心的应该是single,page跟category。
先来讲category的部分,看图中,假设我们有个分类是?cat=5,那么该页面的模板寻找顺序是category-5.php>>category.php>>index.php。
相对category来说,page的定制比较麻烦,而且图示也不够清楚,pagename.php文件是单独的,假设我们要建立一个页面模板叫nwhy.php,
那么这个文件的开头应该是这样:

< ?php /* Template Name: nwhy */ ?>

下边才是模板的内容。
那么这个模板是怎么用的呢?后台,新建一个page,在右侧属性里的Template选择框里你将会看到nwhy,是不是很简单?
而单独的日志页,也就是single.php,挺遗憾的,没有单独定制的办法,只能使用page模板。
也就是说,当页面很多的时候,我们需要建立茫茫多的pagename.php……

1901/090

一些常用FireFox Plugins介绍

可以说FireFox的流行,完全是建立在其数不清的插件之上的,这里介绍几个自己在用的插件。
1。FireBug
可以说就是因为这个插件我才爱上FireFox的,有了FireBug调试css跟页面结构实在是太方便了!
2。Web Developer
同样也是提供给页面设计者的工具,搭配FireBug使用,基本是不可缺少的玩意儿。
3。Easy DragToGo
easy-dragtogo
这个插件是方便操作用的,安装该插件后可以拖拽内容很方便的跳到新页面,跟Maxton的拖动链接差不多。
亮点是可以设置拖拽的方向对应的操作,很酷吧~
4。Google Toolbar
我是冲着书签安装的这个插件,带着书签到处走的感觉很好。。
5。Gladder
在很无奈的情况下,你将需要这个插件,恩,这是个翻墙插件,可以让咱们方便的浏览那些被GFW的网站,比方在湖南无法访问dreamhost主机上的全部网站…再比方H网站=。=
该插件曾经被封,现在可以正常使用。

1901/090

WordPress-一个程序多个网站的配置

这个办法在网络版和本地的情况下同样适用,之所以要讲单机版的,是因为单机版的域名配置相对麻烦,还得修改Apache跟Host文件。本人愚笨,差不多找了好几天才找到办法解决这个问题,整理了下分享一下,嘿嘿。
如果是网络版多网站一个WordPress的操作请略过前2步,直接到wp-config.php配置部分。
至于IIS服务器或Tomcat等其他服务器,咱不会……而且我相信,WordPress应该不会被安装在那些服务器下,哈哈。
好,言归正传,我们先得配置Host文件,让域名有个指向。
WIN2000和XP,Vista系统的Host文件的路径为:系统所在盘\Windows\System32\drivers\etc\下,WIN98的…自己找……
用文本就可以打开了,在后边加上:

127.0.0.2       wp
127.0.0.3       wp1
127.0.0.4       wp2
#前边是ip地址,后边是访问路径,这样我们在访问wp的时候,系统会自动解析到127.0.0.2,下边的一次类推。
#PS:后边不要输入类似于df.dou等带“.”号的东西,会被解析成互联网地址,然后就被万恶的电信带到404页面去了……
#PS2:电信的404页面有MM图…

配置完Host文件记得保存,是不是挺简单呢~

1901/091

DFdou’s Google Calendar


每日更新日志太累,干脆换成Google Calendar,哈哈,别鄙视我啊。。

1801/090

Flash-许愿板Wish Sky更新

Flash许愿板
Demo在这里:http://nwhy.org/nwhy/wish
这次主要更新了下导航条,其实早在留言板那边加上导航的时候就准备在许愿板加上导航。
不然没法返回,用户体验比较差,而且呢,很多人都不知道许愿板里原来可以切换头像……
所以在About里边做了个小说明,哈哈,时间比较赶,随便涂了下,,。
更新内容主要是按钮区域和外框的绘制,AS代码很简单,就不贴咯。
下一步准备加上按“许愿者”搜索愿望的功能 :chaocai

1701/090

Flash-自定义右键菜单

AS2版本:

myMenu = new ContextMenu();//新建自定义的右键menu
myMenu.hideBuiltInItems();//隐藏系统鼠标右键
myMenu.customItems.push(new ContextMenuItem("DFdou's Blog", blog, false));
function blog() {
getURL("http://nwhy.org","_blank");
}
_root.menu = myMenu;

AS3版本:

var myMenu:ContextMenu = new ContextMenu();
var myBlog:ContextMenuItem = new ContextMenuItem("DFdou's Blog");
var blogURL:String = "http://nwhy.org";
var request:URLRequest = new URLRequest(blogURL);
myMenu.hideBuiltInItems();
myMenu.customItems.push(myBlog);
myBlog.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT,blog);
function blog(e:ContextMenuEvent):void
{
navigateToURL(request);
}
this.contextMenu = myMenu;
1701/090

Flash-文字打印效果


以前不会Flash的时候还在网上到处找"打字效果",那个时候对AS是一窍不通……
昨天在看String类的时候想起可以用String的charAt()结合TextField的appendText()很简单的做出打印的效果,就写了这个Demo,Fla文件地址:http://dl.getdropbox.com/u/477487/flash/as3/text-print.fla
效果如上,部分代码如下:

1601/090

WordPress Plugins-Wp Postviews

插件地址:http://lesterchan.net/wordpress/readme/wp-postviews.html
这个插件主要是用来显示日志被浏览数的,该插件同时也提供了Widgets功能,
可以输出view最多很最少的日志和分类,下边是输出最少被view的分类:

< ?php if (function_exists('get_least_viewed_category')): ?>
   <ul>
      < ?php get_least_viewed_category(); ?>
   </ul>
< ?php endif; ?>

详细的使用请参阅http://lesterchan.net/wordpress/readme/wp-postviews.html

1601/090

WordPress Plugins-Google Analyticator

Google-analyticator是一款统一管理Google Analytics的插件,选择Google-analyticator的理由很简单,
尤其是对于经常修改主题的人来说,比如我……还有那些每次更换主题后,过了好几天才发现漏掉了统计代码的孩子。
这款软件使用比较简单,安装后启用该插件,打开”Settings>>Google Analytics”,输入您的UID。
接着其他选项全部Enabled或者使用默认设置就可以了。
个人建议Footer tracking code设置成Enabled,这样可以加快页面的加载。
不然会在head部分输出js,body内容是在head内容加载完后才加载,页面打开速度会因此受到影响。

1601/090

Flash-时钟Demo


源程序地址:http://dl.getdropbox.com/u/477487/flash/as3/clock.fla
下午在看AS3的Date类,想起以前曾经想做一个时钟的效果,就写了下。
因为本人不会美工,所以素材不是来自网络就是自己涂鸦的,so,界面就只能这样子了……
其实实现的过程非常的简单:

Page 1 of 3123