新版主题上线,欢迎测试BUG!

分享到豆瓣/QQ/开心网/人人网/百度/Google等代码

推荐到豆瓣

1
<a rel="nofollow" class="fav_douban" href="javascript:void(function(){var%20d=document,e=encodeURIComponent,s1=window.getSelection,s2=d.getSelection,s3=d.selection,s=s1?s1():s2?s2():s3?s3.createRange().text:'',r='http://www.douban.com/recommend/?url='+e(d.location.href)+'&title='+e(d.title)+'&sel='+e(s)+'&v=1',x=function(){if(!window.open(r,'douban','toolbar=0,resizable=1,scrollbars=yes,status=1,width=450,height=330'))location.href=r+'&r=1'};if(/Firefox/.test(navigator.userAgent)){setTimeout(x,0)}else{x()}})()"></a>

或者用这个

1
<a rel="nofollow" class="fav_douban" href="javascript:window.open('http://www.douban.com/recommend/?url='+encodeURIComponent(document.location.href)+'&title='+encodeURIComponent(document.title));void(0)">豆瓣</a>

收藏到QQ书签

1
<a rel="nofollow" class="fav_qq" href="javascript:window.open('http://shuqian.qq.com/post?from=3&title='+encodeURIComponent(document.title)+'&uri='+encodeURIComponent(document.location.href)+'&jumpback=2&noui=1','favit','width=930,height=470,left=50,top=50,toolbar=no,menubar=no,location=no,scrollbars=yes,status=yes,resizable=yes');void(0)">QQ书签</a>

转贴到开心网

1
<a rel="nofollow" class="fav_kaixin" href="javascript:window.open('http://www.kaixin001.com/repaste/share.php?rtitle='+encodeURIComponent(document.title)+'&rurl='+encodeURIComponent(document.location.href)+'&rcontent=');void(0)">开心网</a>

分享到人人

1
<a rel="nofollow" class="fav_renren" href="javascript:window.open('http://share.renren.com/share/buttonshare.do?link='+encodeURIComponent(document.location.href)+'&title='+encodeURIComponent(document.title));void(0)">人人网</a>

添加到百度搜藏

1
<a rel="nofollow" class="fav_baidu" href="javascript:window.open('http://cang.baidu.com/do/add?it='+encodeURIComponent(document.title.substring(0,76))+'&iu='+encodeURIComponent(location.href)+'&fr=ien#nw=1','scrollbars=no,width=600,height=450,left=75,top=20,status=no,resizable=yes'); void 0">百度搜藏</a>

GOOGLE书签

1
<a rel="nofollow" class="fav_google" href="javascript:window.open('http://www.google.com/bookmarks/mark?op=add&bkmk='+encodeURIComponent(document.location.href)+'&title='+encodeURIComponent(document.title));void(0)">Google</a>

GOOGLE Buzz

1
<a rel="nofollow" class="fav_buzz" href="javascript:window.open('http://www.google.com/reader/link?url='+encodeURIComponent(document.location.href)+'&title='+encodeURIComponent(document.title)+'&srcURL=http://www.koryi.net');void(0)">Google Buzz</a>

分享到 Twitter

1
<a rel="nofollow" class="fav_twitter" href="javascript:window.open('http://twitter.com/home?status='+encodeURIComponent(document.location.href)+'&nbsp;'+encodeURIComponent(document.title));void(0)">Twitter</a>

分享到 Facebook

1
<a rel="nofollow" class="fav_facebook" href="javascript:window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(document.location.href)+'&t='+encodeURIComponent(document.title));void(0)">Facebook</a>

Delicious书签

1
<a rel="nofollow" class="fav_delicious" href="javascript:window.open('http://del.icio.us/post?url='+encodeURIComponent(document.location.href)+'&title='+encodeURIComponent(document.title)+'&notes=');void(0)">Delicious</a>
网页制作 2,154 人浏览 6条评论

自定义 WordPress 后台用户联系方式

在 WordPress 后台,个人设置(Profile)中,除了可以设置电子邮件和 Website 之外,还可以设置自己的联系方式,比如 AIM, Yahoo IM, Jabber/Google Talk。但是除了 Gtalk 之外,其他两个中国人基本不用,那么如何去掉我们基本不用的 AIM 和 Yahoo IM,并加上国人常用的 QQ, MSN 和飞信呢?

其实在 WordPress 中实现这样的功能是非常容易的,只需要调用下 custom_contactmethods 这个 WordPress Filter 既可以实现在后台支持常用的 QQ, MSN 和飞信等联系方式,代码如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
/*
Plugin Name: Custom Contact
Plugin URI: http://wpjam.com/
Description: 自定义博客的联系方式,从 WordPress 默认的 AIM, Yahoo IM 改为中国常见的 QQ, MSN 和飞信。
Version: 1.0
Author: Neekey
Author URI: http://photozero.net/
*/
 
add_filter('user_contactmethods','custom_contactmethods');
function custom_contactmethods($user_contactmethods ){
    $user_contactmethods  = array(
        'qq' => 'QQ',
        'msn' => 'MSN',
        'jabber' => __('Jabber / Google Talk'),
        'fetion' => '飞信'
    );
    return $user_contactmethods ;
}
?>

把上面这些代码保存下来,存为一个 PHP 文件,保存为 UTF-8 without BOM 格式,上传到 WordPress 插件目录,然后激活即可。如果你需要加入其他联系方式,只需要按照同样的方式在上面数组中添加即可,这里就不一一详细介绍。

原文:http://fairyfish.net/2010/01/30/custom-contact/

WordPress 577 人浏览 4条评论

修正IE6不支持position:fixed的bug

众所周知IE6不支持position:fixed,这个bug与IE6的双倍margin和不支持PNG透明等bug一样臭名昭著。前些天我做自己的博客模板的时候,遇到了这个问题。当时就简单的无视了IE6——尽管有几个使用IE6的朋友,一起BS我……但是对于大项目或商业网站,如果有用到这个属性的时候,是不可能直接无视的。

你是如何让position:fixed在IE6中工作的?

本文所使用的技巧是用了一条Internet Explorer的CSS表达式(expression)。你不可以直接使用该表达式,因为它可能会因为缓存而不更新。解决这一点的最简单的方式是使用eval包裹你的语句。
如何解决“振动”的问题?

显然IE有一个多步的渲染进程。当你滚动或调整你的浏览器大小的时候,它将重置所有内容并重画页面,这个时候它就会重新处理css表达式。这会引起一个丑陋的“振动”bug,在此处固定位置的元素需要调整以跟上你的(页面的)滚动,于是就会“跳动”。
阅读全文 »

网页制作 798 人浏览 6条评论

Discuz版块设置只有版主和发贴人能回复

修改post.php 这个文件,在59行处

1
2
3
if($thread['readperm'] && $thread['readperm'] > $readaccess && !$forum['ismoderator'] && $thread['authorid'] != $discuz_uid) {
   showmessage('thread_nopermission', NULL, 'NOPERM');
  }

的下面添加下面代码即可。

1
2
3
4
5
  //只有版主和发贴人自己能回复
  if(($forum['fid']==42) && ($thread['authorid']!=$discuz_uid) && !$forum['ismoderator']  )
  {
           showmessage('只有版主和发贴人才能回复', NULL, 'NOPERM');
  }
网络应用 1,148 人浏览 8条评论

江阴印刷网新版风格

其实江阴印刷网换上新风格有一段时间了,只是首页的JS幻灯片一直没有完成。今天总算找到了一个,换上了。

风格仿的是Discuz的Supesite的默认风格,支持二级分类,后台自定义MEAT,广告,统计代码等。

主题要改的地方是index.php文件的array(1,3,4,5,6,7),把里面的数字改成你想显示的分类ID号,幻灯片是自动读取文章中的图片,演示中最下面的最新图片是用advanced-post-image做的(注意:这个插件要求在你的uploads目录下建立thumb目录及写入权限)

演示:http://www.jyprint.net
下载:CMS THEME NO.1
截图
jyprint

WordPress 4,352 人浏览 74条评论
共 111 页12345...末页 »
顶端
底端