一朋友问我在 windows 下能不能解决 wordpress mu 的新用户注册的问题
那既然邮件收不到,那有两种办法可解决问题:
第一,用户注册后到数据库中查找
activation_key,然后到http://$domain/wp-activate.php?key= 后面加上 activation_key 进行激活,这样虽然可以解决,但是如果注册用户较多,那就比较麻烦了既然这样不可以,那想到有这个激活的链接,那能不能直接把激活的链接显示出来呢?这样应该可以解决了。
这就是要说的第二种解决办法了:
按照这个思路,查看了 wordpress 的注册用户的时候的文件,发现按照如下的办法可以显示激活链接。
1、修改wp-signup.php文件
修改confirm_blog_signup函数,大概在374行:function confirm_blog_signup($domain, $path, $blog_title, $user_name, $user_email, $meta) { //增加下面这一行
//增加下面三行:
global $wpdb;
$akey=$wpdb->get_var("SELECT activation_key FROM wp_signups WHERE user_login = '$user_name'");
$active_url='http://' . $domain . '/wp-activate.php?key=' . $akey;
?>
<?php _e('But, before you can start using your blog, you must activate it.') ?>
<?php printf(__('Check your inbox at %s and click the link given. '), $user_email) ?>
<?phpprintf(__('Check your inbox at %2$s is active and click the link given. '), $active_url,$active_url) ?>
<?php
do_action('signup_finished');
}
2、修改wp-activete.php文件:
大概在55行,修改为:printf(__(' Your blog at %2$s is active. You may now login to your blog using your chosen username of "%3$s". userpass of "%4$s". Please check your email inbox at %5$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can reset your password.'), 'http://' . $signup->domain, $signup->domain, $signup->user_login, $signup->user_pass, $signup->user_email, 'http://' . $current_site->domain . $current_site->path . 'wp-login.php?action=lostpassword');
没有评论:
发表评论