为wordpress添加coolcode插件的quicktag

修改 wp-includes/js/quicktags.js 文件
1. 找到
edButtons[edButtons.length] =
new edButton('ed_code'
,'code'
,'<code>'
,'</code>'
,'c'
);
在后面添加
edButtons[edButtons.length] =
new edButton('ed_coolcode'
,'coolcode'
,"
,'</coolcode>'
,'x'
);
2. 找到
else if (button.id == 'ed_link') {
        document.write('<input type="button" id="' + button.id + '" accesskey="' + button.access + '" class="ed_button" onclick="edInsertLink(edCanvas, ' + i + ');" value="' + button.display + '" />');
    }
在后面添加
else if (button.id == 'ed_coolcode') {
        document.write('<input type="button" id="' [...]


WP-PageNavi 2.10 插件的BUG修正

这两天突然发现在搜索页和 tag 搜索页上的 pagenavi 不显示,
于是从网上搜到这个,我稍微修改了一下:
修改 pagenavi.php 内的 wp_pagenavi 函数
function wp_pagenavi($before=", $after=", $prelabel='&laquo;', $nxtlabel='&raquo;') { global $request, $posts_per_page, $wpdb, $paged; if (!is_single()) { if (get_query_var('post_type') == 'post') { preg_match('#FROM (.*)\s+(GROUP|ORDER) BY#', $request, $matches); $fromwhere = $matches[1];//var_dump($request); if(preg_match('#(.*)\s+(GROUP|ORDER) BY#',$fromwhere,$m2)) { $fromwhere = $m2[1]; } $numposts = $wpdb->get_var("SELECT COUNT(DISTINCT ID) FROM $fromwhere"); $max_page = ceil($numposts /$posts_per_page); } else { $max_page = 999999; } if(empty($paged)) { $paged = 1; } if($max_page > 1) { echo "$before 页数 [...]


WordPress 2.2 final

WordPress 2.2 终于正式发布了,想要的 Tag 特性将被延后到2.3中才会出现,反而多了 Widgets ......
点击下载
http://wordpress.org/development/2007/05/wordpress-22/
Goodies:

WordPress Widgets allow you to easily rearrange and customize areas of your weblog (usually sidebars) with drag-and-drop simplicity. This functionality was originally available as a plugin Widgets are now included by default in the core code, significantly cleaned up, and enabled for the default themes.
Full Atom support, including [...]


博客世界最受欢迎的30个插件

From:
http://fairyfish.com/2007/04/02/top-30-wordpress-plugins-in-blogosphere/
翻译于:
http://www.staska.net/2007/03/27/top-30-wordpress-plugins-in-blogosphere/,
作者根据Lorelle的Lists of favorite Wordpress plugins上的48列表和280个插件,选出最受欢迎的30个插件。

Tags: blogosphere, plugins, wordpress


wordpress 快捷键

很多wordpress用户都是通过点击文本撰写区上面的那些菜单按钮来插入链接,图片等等。但使用这个方式比较麻烦,而且更耗时间。如果能直接通过键盘快捷键来操作的话,将会极大地提高blogging的效率。下面就是很多wordpress的一些基本的快捷键:
Alt+B = 字体加粗(bold)
Alt+I = 斜体(italic)
Alt+Q = 引用(Blockquote)
Alt+T = 更多 (Read More tag)
Alt+U = 定义无序列表(Unordered list)
Alt+O = 定义有序列表 (Ordered list)
Alt+S = 文本加下划线(ins)
Alt+L = 列表项 (list item)
Alt+A = 插入链接(link)
Alt+C = 设置文本为代码风格(code)
Alt+D = 文本加删除线(del)
Alt+P = 发表日志(Publish )
注意:
1、苹果机用户可能需要用ctrl来代替alt键,甚至可能要同时按alt和shift才有用。
2、Firefox下要同时按alt和shift。

Tags: wordpress, 快捷键


再谈Wordpress的MySQL乱码问题解决方法

在MySQL4.1下,中文的WP就会产生种种的乱码问题。
一个程序( PHP,CGI 等)与MySQL建立连接后,这个程序发送给MySQL的数据采用的是什么字符集,MySQL 是无从得知的。所以解决乱码问题的根本就是我们在程序中告诉MySQL采用的编码是什么,简单的就是在程序中加入这样的一个语句:
SET NAMES 'utf8';
这个语句的效果等同于同时设定了
SET character_set_client='utf8';
SET character_set_connection='utf8';
SET character_set_results='utf8';
为什么这么做?
我们安装MySQL4.1时按照默认配置,那么default-character-set= utf8。在MySQL Command Line Client下查看到的查看系统的字符集和排序方式的设定为:

Tags: mysql, wordpress, 乱码