DFdou's Blog Life is short,Be yourself.

3006/090

WordPress-2次开发常用函数

全函数列表请参见这里:《WordPress模板标签Template_Tags》
这里只列出最常用的几个。先是重要的bloginfo(),不直接echo数值的函数为get_bloginfo();恩,不少函数都是按照这个规则写的,PS:并不是全部!echo出函数值的函数为xxx()的话,那么不echo出结果值的的函数为get_xxx()。
该函数范围的是WordPress的配置参数,主要参数和值举例如下,常用的黑体标出:

admin_email = admin@example
atom_url = http://example/home/feed/atom
charset = UTF-8
comments_atom_url = http://example/home/comments/feed/atom
comments_rss2_url = http://example/home/comments/feed
description = Just another WordPress blog
home = http://example/home这个是网站首页地址
html_type = text/html
language = en-US
name = Testpilot网站名称
pingback_url = http://example/home/wp/xmlrpc.php
rdf_url = http://example/home/feed/rdf
rss2_url = http://example/home/feed
rss_url = http://example/home/feed/rss
siteurl = http://example/home也是网站地址
stylesheet_directory = http://example/home/wp/wp-content/themes/largo
stylesheet_url = http://example/home/wp/wp-content/themes/largo/style.css主题文件夹下的style.css地址
template_directory = http://example/home/wp/wp-content/themes/largo主题包地址
template_url = http://example/home/wp/wp-content/themes/largo
text_direction = ltr
url = http://example/home
version = 2.7
wpurl = http://example/home/wp
举例,bloginfo("wpurl ")会输出“http://example/home/wp”。

2906/090

WordPress-Theme的制作

以下内容建立在有部分HTML基础下,如果有疑问可以Twitter我,EMAIL我,MSN我,留言我,电话我,etc,但是不要QQ我~
WP的主题所在文件夹为XXX\wp-content\themes\,里边每个包都是目录(如果正常的话)。
先来讲下主题的组成,可以先参考这个文章《WordPress -Template System模板系统》
从该文章中我们可以发现,最最最简单的WP皮肤只需要一个文件,index.php,出于维护和多方合作开发以及修改的简便性来说,个人觉得一个主题至少应该分成以下几个部分:
header.php,里边放HTML的头部,一般是包含文档声明到body开始处,有时候也会包含菜单部分。

< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>< ?php bloginfo('name'); ?> < ?php if ( is_single() ) { ?> Blog Archive < ?php } ?> < ?php wp_title(); ?></title>
..................
<body>

2606/090

Adobe开发者技术日 7月16上海

adobechinadeveloper

http://www.adobechinadeveloper.com/developerday/Shanghai

尊敬的开发伙伴:
我们诚挚地邀请您参加将于2009年7月16日在上海举行的 奥多比开发者技术日 !
奥多比开发者技术日 是由奥多比公司举办的面向 Flash 平台应用及Web应用开发者的技术研讨培训活动。旨在为开发者介绍和讲解有关 Adobe Flash 平台技术及其应用开发的相关知识和开发技巧,以及 Adobe Flash 平台技术的发展趋势等。同时也为开发者搭建一个互相学习和交流的平台,在此与奥多比公司的技术专家和资深的开发者们分享各自的开发经验和创新设计理念,共同推动 RIA 技术的发展。
光临此次开发者技术日,您将在第一时间聆听最新发布的 Adobe Flash Builder 4 和 Adobe Flash Catalyst 的新功能和新特性,欣赏炫酷的应用演示,还有机会获得Adobe Flash平台应用开发工具光盘和热销的中文版开发工具书。还等什么?赶快注册吧!* 座位有限,先来先得!

2506/090

Flash-An Pageflip/Flashbook Engine MegaZine 3

Learned from http://megazine.mightypirates.de/?c=home&l=en.

What is this?
MegaZine 3 is a pageflip engine. There are many like it, but this one is... free. And open source, too. This means two things, basically: you don't have to pay for it, and you can even modify it in any way you see fit.
That said, if you wish to use it commercially, an LGPL licensed version is available for purchase, too.

MegaZine 3是个啥呢?MegaZine 3是一个基于LGPL协议的开源的Pageflip制作引擎,话说这个Pageflip真不知道该翻译成什么,直观的说,成品就是一个课本样的Flash,不知道这样翻译合适不……
先来个Live Demo地址:http://megazine.mightypirates.de/demo/index.html

2406/090

Flash-Adobe’s Flash to ship on new Android phone

The HTC Hero phone will have Flash support built in.(Credit: HTC)

Learned from http://news.cnet.com/8301-1035_3-10272261-94.html?part=rss&subj=news&tag=2547-1_3-0-20.

Marking a departure from the world of iPhone, HTC's new Android-based Hero phone will also come with the ability to handle Flash elements that adorn many Web sites and power YouTube video.

HTC新款Android系统手机Hero将内建Adobe Flash播放器。

Adobe Systems announced on Wednesday that its Flash Player will be built into the HTC phone, an important step in the company's efforts to spread Flash to mobile phones. The phone, one of several from HTC to use Google's open-source operating system, is scheduled to ship in Europe starting in July and in Asia and North America later in the year.

Adobe在周三发布了一个公告称Flash Player将内建在HTC手机中,这是Flash迈向手机平台关键性的一步。Hero是HTC使用Google的开源操作系统的其中一款手机,将在7月登录欧洲,并在晚些时候登录亚洲和北美。

2306/091

jQuery-Slider Plugins

来自http://cssglobe.com/post/3783/jquery-plugin-easy-image-or-content-slider
Learned from http://cssglobe.com/post/3783/jquery-plugin-easy-image-or-content-slider
本地Demo地址:http://nwhy.org/nwhy/jsdemo/slider.html
使用很简单,HTML部分代码如下:

<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript" src="/js/easySlider.js"></script>
$(document).ready(function(){
	$("#slider").easySlider();
});
<div id="slider">
	<ul>

	<li>content here...</li>
	<li>content here...</li>
	<li>content here...</li>
	...
	</ul>
</div>
2206/090

WordPress Themes-BranfordMagazine

BranfordMagazine
这是一款来自der-prinz.com的CMS主题皮肤,比较简单,轻便,可定制性也非常的强。
浏览器兼容性Getested in - Firefox - Internet Explorer 7 - Internet Exporer 6 - Opera
下边是:
Demo+++++++++++Download+++++++++++Support Forum+++++++++++Tutorials

1906/090

介绍下WordPress

先来讲下WordPress是什么

来自WordPress官方的介绍如下:

WordPress is a state-of-the-art publishing platform with a focus on aesthetics, web standards, and usability. WordPress is both free and priceless at the same time.
More simply, WordPress is what you use when you want to work with your blogging software, not fight it.

WordPress是一个可用性强,遵循WEB标准的免费的内容发布平台,而简单的用途则是用它来搭建博客系统,恩,一个支持多用户的博客系统。
PS:关于wordpress.org和wordpress.com的区别,org是发布wordpress新版本,开发动向,插件,皮肤和其他关于wordpress技术方面的东西。而com则是一个博客平台,大家可以在上边搭建免费的个人博客,类似的服务国内很多,如新浪博客,网易博客。由于某些政治原因,不推荐在wordpress.com开博,一年里头没有几天是不被GFW的。

1806/090

Flash-Transparent时在FF和Safari下无法输入中文的解决方案

Learned from 《swfInputs: Solving Mozilla + Transparent Mode + Win + Special Chars within inputs》
原来写过个日志《Flash在Safari下无法输入中文》,当时没有找到好的解决方案,现在在网上看到有这么个东西,swfInputs
What to do in your code?具体代码的使用:
swfInputs consists of two parts(swfInputs包含2个部分):
* The SWFTextInput AS3 Class (which create the connection to the JavaScript class),一个AS3组件,负责Flash和JS的通信。
* and the swfInputs JavaScript Class (which handles the creation and HTML communication),一个JS文件,负责在HTML端建立Input。
To activate the JavaScript part you just need to insert two script-tags into the HTML code and call the constructor method. At the moment swfInputs uses the dojoToolkit JavaScript library for position calculation and basic connection handling. I looking forward to remove this need of dojo to reduce the filesize.
swfInputs使用dojoToolkit JS框架,恩,作者根据需求修正了dojoToolkit的尺寸。

<script src="../javascript/dojo.js" language="javascript"></script>
<script src="../javascript/swfInputs.js" language="javascript"></script>
<script language="JavaScript" type="text/javascript">
			swfInputs.init('swfInputTestcase');
</script>
1406/090

关于6-13nhwy.org当机的问题

来自WopusIDC的信件,唉,nwhy就这么挂了一天,烦躁的。
-------------------------------------------------------------------------------------------
亲爱的WopusIDC"地"(174.x.x.x)主机用户:
首先感谢您这么久以来对WOPUSIDC的支持,但很遗憾的是,由于"地"主机上的用户有不和谐的内容,导致整个主机的独立IP都被和谐,在和IDC紧急联系之后,"地"主机已经更换了新的IP,所以,请您在看到这封邮件的时候更换域名解析A记录。
把域名A记录由原来的:174.x.x.x 更换成 174.x.x.x。
我们也在WopusIDC发布了更换IP公告,如果您在更换IP之后有任何问题,请及时联系我们,回复此邮件即可。
再次感谢各位的理解与支持。
祝好。
--------------------------------------------------
这年头啊,可别乱讲话,别乱放东西哦,会被和谐哦。

1106/090

Flash-一个获取中文(只针对一级字库)拼音首字母的类

本内容来自网络,有兴趣的自寻出处。
类内容如下:

package
{
        import flash.utils.ByteArray;

        /**
         * ...
         * @author Will Chen
         * @msn chenyouyou@live.cn
         * @email c_youyou@163.com
         * @version 1.0
         * @description Convert Chinese to abc.
         */
       
        public class ChineseConvert
        {               
                /**
                 * 获取一串中文的拼音字母
                 * @param        chinese        <string>Unicode格式的中文字符串
                 * @return                        </string><string>拼音声母字符串
                 * @example
                 * var chinese:String = "说国家会被和谐的";
                 * var py:String = ChineseConvert.convertString(chinese);
                 * trace(py);        //sgjhbhxd
                 */
                public static function convertString(chinese:String):String
                {
                        var len:int = chinese.length;
                        var ret:String = "";
                        for (var i:int = 0; i < len; i++)
                        {
                                ret += convertChar(chinese.charAt(i));
                        }
                        return ret;
                }
               
                /**
                 *
                 * @param        char        <String>Unicode格式的一个中文字符
                 * @return                        </string><string>中文字符的声母
                 * @example
                 * var chineseChar:String = "我";
                 * var py:String = ChineseConvert.convertChar(chineseChar);
                 * trace(py);        //w
                 */
                public static function convertChar(chineseChar:String):String
                {
                        var bytes:ByteArray = new ByteArray();
                        bytes.writeMultiByte(chineseChar.charAt(0), "cn-gb");
                        var n:int = bytes[0] < < 8;
                        n += bytes[1];
                        if (isIn(0xB0A1, 0xB0C4, n)) return "a";
                        if (isIn(0XB0C5, 0XB2C0, n)) return "b";
                        if (isIn(0xB2C1, 0xB4ED, n)) return "c";
                        if (isIn(0xB4EE, 0xB6E9, n)) return "d";
                        if (isIn(0xB6EA, 0xB7A1, n)) return "e";
                        if (isIn(0xB7A2, 0xB8c0, n)) return "f";
                        if (isIn(0xB8C1, 0xB9FD, n)) return "g";
                        if (isIn(0xB9FE, 0xBBF6, n)) return "h";
                        if (isIn(0xBBF7, 0xBFA5, n)) return "j";
                        if (isIn(0xBFA6, 0xC0AB, n)) return "k";
                        if (isIn(0xC0AC, 0xC2E7, n)) return "l";
                        if (isIn(0xC2E8, 0xC4C2, n)) return "m";
                        if (isIn(0xC4C3, 0xC5B5, n)) return "n";
                        if (isIn(0xC5B6, 0xC5BD, n)) return "o";
                        if (isIn(0xC5BE, 0xC6D9, n)) return "p";
                        if (isIn(0xC6DA, 0xC8BA, n)) return "q";
                        if (isIn(0xC8BB, 0xC8F5, n)) return "r";
                        if (isIn(0xC8F6, 0xCBF0, n)) return "s";
                        if (isIn(0xCBFA, 0xCDD9, n)) return "t";
                        if (isIn(0xCDDA, 0xCEF3, n)) return "w";
                        if (isIn(0xCEF4, 0xD188, n)) return "x";
                        if (isIn(0xD1B9, 0xD4D0, n)) return "y";
                        if (isIn(0xD4D1, 0xD7F9, n)) return "z";
                        return "\0";
                }
               
                private static function isIn(from:int, to:int, value:int):Boolean
                {  
                        return ((value >= from) && (value < = to));
                }
               
                /**
                 *
                 * @param        chineseChar        <String>Unicode格式的一个中文字符
                 * @return                                <boolean>是中文返回true,不是返回flase
                 */
                public static function isChinese(chineseChar:String):Boolean
                {
                        if (convertChar(chineseChar) == "\0")
                        {
                                return false;
                        }
                        return true;
                }
        }
}

具体使用在文件中都写了例子,有兴趣的可以去改造成返回全拼音。

1006/090

Discuz!-更换虚拟主机后附件无法上传问题的一个解决办法

Discuz!
公司论坛前几天更换了下虚拟主机,结果附件无法上传,提示是上传目录的权限有问题,在网上找了下解决办法,有一个可行的,就是更改目录权限。
看了下服务器上的权限,是755,但是却无法修改,诡异的。而且原来可以正常使用的主机上,其实也是755的权限,但是没有问题啊。
试了下另一个办法,说是更改附件的保存格式,然后上传一个,之后修改回原来的显示格式,依然没能解决问题。
最后找到了个可行的方法,重命名虚拟主机上的附件目录(这里我们用的是附件按月份保存的格式),新建同名文件目录的,然后把文件重新传一遍(不知为何,FTP上的文件无法直接移动,提示无权限,如果可以直接移动过去的话,请直接移动附件。),接着应该就可以正常上传附件了。
希望对大家有点帮助,嘿嘿。

806/094

Chalkwork HTML Icon(Free) From mezzoblue.com

Chalkwork HTML Preview,it's from mezzoblue.com.
htmlicon
一套很有爱的HTML图标,下边是下载地址:chalkwork-html.zip

Tagged as: , 4 Comments
506/090

AS3-Drop Menu Demo

先来Demo:


Fla Source:http://dl.getdropbox.com/u/477487/flash/as3/DropMenu.fla
说明一下,这个文件只考虑了有2级菜单的情况,而没有去管有1级菜单没有2级菜单的情况。
This Demo only consider all menu have children, but not to possession of a menu has no child.

Tagged as: , , , Continue reading
406/090

15款WordPress角色权限管理插件 | 转载自帕兰映像

曾经有个工作里边接触到了WP后台权限的问题,发现WP自身的角色实在是太少了,今天看到帕兰的这个内容,转载一下。
以下内容转载自 15款WordPress角色权限管理插件 | 帕兰映像
对于开放性注册的WordPress博客来说, 我们已经介绍过13款WordPress用户注册登录插件,但注册后的权限分配管理也是很重要的。下面,就请看看这15款WordPress角色权限管理插件
Role Manager WordPress Plugin
这应该是目前最强大的一款WordPress角色管理插件,使用它,你可以:

  • 修改现有角色等级的名称。你可能并不需要”订阅者、编辑者、供稿者”这样的角色名称,而想用”探花,举人,状员”之类的。
  • 你还可以新建多个角色等级,并为每个等级的角色分配不同的权限,你甚至可以为同等级中的某一用户分配不同的权限。
  • 自定义角色等级的权限

总之,这是一款用户管理的首选插件。

Page 1 of 212