我的虎宝宝
03月 13th, 2010 by brian | No Comments | Filed in WordPress mu我的虎宝宝
在三月十二日出生啦
装了Popular Posts 这个插件,可我们本土菜鸟们看不懂外国鸟语,做了这个中文语言包
另外这个插件还需要Post-Plugin Library 才能正常工作。
注意:这两个插件的中文语言文件,必须放在 /wp-content/plugins/ 目录下才行,而不是放在插件目录!!
下载:
Tags: Popular Posts, 中文语言包, 插件, 语言包
将 WordPress Related Posts 1.0 插件改善为更适合mu用户使用。
主要修改内容为增加插件默认参数,只需用Plugin Commander 将此插件开启,用户博客的文章结尾即能显示相关文章。
修改内容:
1.在开头增加:
/* 插件默认值 by itjoy.net 2008/10/11 */
$wp_rp_default['wp_rp_title']=”相关文章”;
$wp_rp_default['wp_no_rp']=”commented”;
$wp_rp_default['wp_no_rp_text']=”热门文章”;
$wp_rp_default['wp_rp_limit']=”10″;
$wp_rp_default['wp_rp_exclude']=”";
$wp_rp_default['wp_rp_auto']=”yes”;
$wp_rp_default['wp_rp_rss']=”";
$wp_rp_default['wp_rp_comments']=”";
$wp_rp_default['wp_rp_date']=”";
/* end 插件默认值 */
2.在有$wp_rp = get_option(”wp_rp”); 的位置修改为:
global $wp_rp_default;
$wp_rp = get_option(”wp_rp”);
if(count($wp_rp)<=1)$wp_rp=$wp_rp_default;
效果:
下载:
或在这里下载修改好的 相关文章插件 1.0 ,已含简体中文语言包。
Tags: WordPress mu, 插件, 改进
theme-preview是一个允许未登录用户预览主题首页的插件,
现改进了一下,使其也能显示除首页之外的其他页面。
另外加入一个函数,可以调用以显示指定数量个主题资料。
插件效果请看我的 ITjoy 博客社区 的首页,具体调用方法可看插件中介绍。
Tags: mu, theme, theme-preview, 插件, 改进
主题多的时候,挑选主题很麻烦,特别是想要的主题不在第一页的时候,得一页一页的去翻。
搞定wpmu-themes.php 的主题批量激活JS后轮到给 themes.php 动手术了。
1. /wp-admin/themes.php 19行,两个reset( $themes ) 之间的内容改为以下,目的是搜索符合的主题:
reset( $themes );
$theme_all=count($themes); //add by libanglai 20080910
foreach( $themes as $key => $theme ) {
if( isset( $allowed_themes[ wp_specialchars( $theme[ 'Stylesheet' ] ) ] ) == false ) {
unset( $themes[ $key ] );
}
//add by libanglai 20080910 start
else if( isset($_GET['search']) ) {
$str=$themes[ $key ][Name].’,’.$themes[ $key ][Title].’,’.$themes[ $key ][Description].’,’.$themes[ $key ][Author];
$str.=implode(’,',$themes[ $key ]['Tags']);
$str=strtolower($str);
//echo $str.”|”; //for debug
//echo strpos($str,strtolower($_GET['search'])).”<br>”; //for debug
if(strpos($str,strtolower($_GET['search']))===false ){
unset( $themes[ $key ] );
}
}
//end add by libanglai 20080910
}
reset( $themes );
$theme_show=count($themes); //add by libanglai 20080910
2. 62行 <?php if ( ! validate_current_theme() ) : ?> 之前加入以下内容,目的是加上搜索框
<!–for search themes, add by libanglai //–>
<form action=’themes.php’ method=’get’ name=’form1′>
<div id=”message0″ class=”updated fade”><p><?php _e(’SEARCH THEMES: You can enter a word to search for the themes that name,description or tags include this word.’); ?>
<input type=input name=’search’ value=’<?php echo $_GET['search'];?>’><input type=submit value=”<?php _e(”Search”); ?>”>
</p></div>
</form>
<!– end //—>
3. 128行要改一下,否则搜索结果只有1个时不会显示
<?php if ( 1 < $theme_total ) { ?>
改为:
<?php if ( 1 <= $theme_total ) {//edit by libanglai 20080910 ?>
4. 117行改一下,让它显示搜索结果数和主题总数:
<h2><?php _e(’Available Themes’); ?></h2>
改为:
<h2><?php _e(’Available Themes’); echo “  ”.$theme_show.’ of ‘.$theme_all;//add for show num of search result ?></h2>
修改四个地方,都没动到wordpress原有的代码,手术还不算大,和效果很不错啊,看下面的图:
主题多的时候,像我现在有近100个,要一个个启用,手都点断了(radio又那么小);
用下面的js函数可以帮你把所有的主题全部开启或禁用。
需要在 wp-admin/wpmu-themes.php 21行后加入以下两个javascript函数:
<script type=’text/javascript’>
function active_theme_all(){
obj=document.all(”form1″);
for (i=0;i<obj.length;i++){
if(obj[i].type==’radio’ && obj[i].value==’enabled’) obj[i].checked=true;
}
}
function disnable_theme_all(){
obj=document.all(”form1″);
for (i=0;i<obj.length;i++){
if(obj[i].type==’radio’ && obj[i].value==’disabled’) obj[i].checked=true;
}
}
</script>
然后在你喜欢的地方添加控制的radio
<input type=”radio” name=”theme_all” onclick=”active_theme_all();” value=”enabled”><?php _e(’Active’) ?><input type=”radio” name=”theme_all” onclick=”disnable_theme_all();” value=”disabled”>
成功了,效果如下:
Tags: theme, WordPress mu, 主题
安装完后连找不到中发白啦~更别说东南西北了。
用editplus全部替换功能改了一下语言包,
1.插件名字改为相册(原叫图集,下面又有个子功能菜单叫图集);
2.图集改叫相片夹–看到就清楚是什么意思了;
3.相册还是叫相册:)
4.图片改叫相片
这下关系清楚了,相片-》相片夹-》相册
增加了一个子菜单->上传相片
wordpress用户没什么关系,多摸索摸索就会了,可mu要尽量多为用户着想,用户只想写日志,上传相片而已。
在 wp-content\plugins\nextgen-gallery\admin\admin.php
中 function add_nextgen_gallery_menu 内增加下列代码:
add_submenu_page( NGGFOLDER , __(’Add Gallery’, ‘nggallery’), __(’Add Gallery’, ‘nggallery’), ‘NextGEN Upload images’, ‘nggallery-add-gallery’, ’show_menu’);
新菜单效果如图:
另外现在用户新开通相册后,根本不知道如何去页面那里加入相册,太麻烦了,直接在启用相册插件的时候自动增加这个相册页面,默认显示建立的前两个相片夹的内容.用户只要启用了这个插件,上传图片后就直接能在博客上看见了。
wp-content\plugins\nextgen-gallery\ngginstall.php 93行,dbDelta($sql); 后面增加以下内容:
// add by libanglai 20080909
$sql=”INSERT INTO `”.$wpdb->prefix.”posts` ( `post_content` , `post_title` , `post_category` , `post_status` , `comment_status` , `ping_status` , `post_name` , `guid` , `menu_order` , `post_type`)
VALUES ( ‘[slideshow=1][gallery=1][slideshow=2][gallery=2]‘, ’相册’, 0, ’publish’, ’open’, ’open’, ’brainstorming-test’, ”, 0, ’page’ ) ;”;
dbDelta($sql);
//end add
thickbox文件夹里面的JS文件还有待汉化。–不过简单,就一些CLICK CLOSE而已。
本地测试的时候发现编辑页面时加入相册页面那个弹出窗口乱码,需要在
wp-content\plugins\nextgen-gallery\tinymce3\window.php 第23行后增加一下内容:
header(’Content-Type: text/html; charset=’ . get_option(’blog_charset’), true); //add by libanglai 20080909
Tags: Nextgen Gallery, WordPress mu, 乱码, 相册
wp_admin/index.php.php 42行后加入以下内容,并另存为UTF-8编码(懒的去整语言文件了)
谁可以帮忙写一个这个功能的插件?因为更改wp本身的文件实在不是太好。
<!– quikedit –>
<div id=”rightnow”>
<h3 class=”reallynow”>博客快捷管理</h3>
<div style=”line-height:3;background-color: rgb(198, 217, 233);padding-left: 15px;”>
<strong>修改资料:</strong>
<a href=’options-general.php’ class=”rbutton”>博客基本信息</a>
<a href=’profile.php’ class=”rbutton”>个人资料和密码</a>
<br>
<strong>您的日志:</strong>
<a href=”post-new.php” class=”rbutton”>写日志</a> <a href=’edit.php’>修改日志</a>
<br>
<strong>特殊页面:</strong>
<a href=”page-new.php”><?php _e(’Write a New Page’); ?></a> <a href=”edit-pages.php”>修改页面</a>
<br>
<strong>友情链接:</strong>
<a href=”link-add.php” class=”rbutton”><?php _e(’Add Link’); ?></a> <a href=”link-manager.php”><?php _e(’Manage Links’); ?></a>
<br>
<strong>管理其他:</strong>
<a href=’edit-comments.php’><?php _e(’Comments’); ?></a>
<a href=’categories.php’>文章分类</a>
<a href=’edit-link-categories.php’><?php _e(’Link Categories’); ?></a>
<a href=’edit-tags.php’><?php _e(’Tags’); ?></a>
<a href=’upload.php’><?php _e(’Media Library’); ?></a>
<br>
<strong>布局外观:</strong>
<a href=”themes.php” class=”rbutton”><?php _e(’Change Theme’); ?></a>
<a href=’widgets.php’>侧边栏管理</a>
</div>
</div><!– quikedit –>
效果图: