让WP评论者可以填QQ代替邮箱

Filed in WordPress 20 comments

声明:是分享给我这样的菜鸟看的,高手们请直接忽略本文

让WordPress博客的评论者可以填QQ号代替邮箱,实际上是用QQ邮箱、QQ空间地址作为Email和URL.
1、照下面这样修改根目录下wp-comments-post.php (以2.8.4为例)

63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
if ( get_option('require_name_email') && !$user->ID ) {
	if ( '' == $comment_author )
	wp_die( 请填写名字 );
 
	if ( '' == $comment_author_email)
	wp_die( 麻烦你填一下邮箱或QQ号 );
 
	if ( !is_email($comment_author_email)):  /* 如果不是邮箱 */
	  if(preg_match("/[^\d-., ]/",$comment_author_email)){  /* 如果也不是QQ号 */
	    wp_die( 您这填的不是Email地址也不是QQ号 );
	  }else{
	      if ( 5 > strlen($comment_author_email))
	        wp_die( 您这QQ号也太短了点吧…… );
	      $qqnum = $comment_author_email;
	      $comment_author_email = "$qqnum".'@qq.com';  /* 使用QQ邮箱地址作为Email */
	      if ( '' == $comment_author_url)  /* 如果URL为空,使用QQ空间地址作为URL */
	        $comment_author_url = 'http://user.qzone.qq.com/'.$qqnum;
	  }
	endif;
}

2、然后修改前台(主题的comments.php)

但是有一个问题:QQ空间貌似比较烦,有时会禁止外部链接跳转进去,可能需要另外解决.

2009 08 25 20 comments
Tags:
评论列表
#1 619 :

测试一下 ..

#2 satowabin :

precios levitra 20 mg. buy generic levitra. levitra amlodipine interactions.

#3 tsuzotakaa :

levitra dosage maximum. levitra sale. what are the differences between cialis levitra staxyn stendra and viagra.

#4 kokoripad :

levitra without a doctor’s prescription. he said. levitra strips.

#5 wahenunel :

what does levitra pills look like. recommended you read. levitra forum.

#6 kutogisox :

can you take levitra with food. levitra price. levitra common dosage.

#7 kaniribik :

levitra for females. buy cheap levitra. levitra tablet bayer.

#8 gadokogus :

directions for levitra use. levitra prices. levitra 40.

#9 nikebabut :

taking 20 mg levitra. relevant internet site. levitra samples overnight.

#10 adedzural :

does levitra work for women. click over here. levitra 10mg pills.

#11 munizuyal :

how much is levitra without insurance. click through the next webpage. levitra at cvs.

#12 mobenzem :

viagra cialis levitra alcohol. levitra for sale. levitra 20 mg.

#13 netsugugar :

levitra dosage for occasional use. special info. how much is too much levitra.

#14 rerekigan :

levitra daily dose. buy levitra online. levitra prostate.

#15 iegised :

levitra alla menta. buy generic levitra. how long does it take levitra to act.

#16 kamidzudog :

levitra available strengths. click this site. levitra works better than viagra.

#17 shichisonix :

levitra 5mg daily. levitra prices. how can i get a prescription for levitra.

#18 behobopej :

levitra orodispersible forum. click here to read. maximum levitra dosage.

#19 nimadeney :

levitra infoleht. look here. difference between levitra 20mg vs 10mg.

#20 hagikuwap :

levitra 10 mg viagra. buy levitra online. levitra 5mg or 10mg.

发表评论
名字

Email

网址

Delighted Black designed by Christian Myspace In conjunction with Ping Services   |   French Teacher Jobs   |   Maths Teacher Jobs