I was finding this hack very helpful, but after integrating Hivemail with vBulletin I had to remove the code from "register.php". Can you please tell med how to change the "Who might this New User be?" code bit in "register.php" to make it work again?
I have included the code from Hivemail that I have added:
Code:
// @@@@@@@@@@
// <hivemail>
$hivemail_filepath = '/home/yoursite/public_html/hivemail';
if ($action == 'mailsignup') {
if ($bbuserinfo['userid'] != 0) {
$action = 'register';
define('VB_PLUGIN', true);
require($hivemail_filepath.'/includes/vbulletin_plugin.php');
if ($bbuserinfo['hiveuserid'] != 0 and
$hiveuser = $DB_Hive->query_first("
SELECT userid FROM hive_user
WHERE userid = $bbuserinfo[hiveuserid]
")) {
header('Location: usercp.php');
}
eval('dooutput("'.gettemplate('hivemail_signup').'");');
exit;
} else {
$action = 'signup';
}
}
if ($HTTP_POST_VARS['action'] == 'addmail') {
if ($bbuserinfo['userid'] != 0) {
$action = 'register';
define('VB_PLUGIN', true);
require($hivemail_filepath.'/includes/vbulletin_plugin.php');
if ($bbuserinfo['hiveuserid'] != 0 and
$hiveuser = $DB_Hive->query_first("
SELECT userid FROM hive_user
WHERE userid = $bbuserinfo[hiveuserid]
")) {
header('Location: usercp.php');
}
$email = $bbuserinfo['email'];
hivemail_register_user($bbuserinfo['userid'], false);
hivemail_update_password($bbuserinfo['password'], $bbuserinfo['userid']);
eval('standardredirect("'.gettemplate('hivemail_thankyou').'", "usercp.php");');
exit;
} else {
$action = 'signup';
}
}
define('VB_PLUGIN', true);
require($hivemail_filepath.'/includes/vbulletin_plugin.php');
if (($action == 'signup' or $action == 'register') and
$bbuserinfo['userid'] != 0 and
!$allowmultiregs and
($bbuserinfo['hiveuserid'] == 0 or
!$hiveuser = $DB_Hive->query_first("
SELECT userid FROM hive_user
WHERE userid = $bbuserinfo[hiveuserid]
"))) {
header('Location: register.php?action=mailsignup');
exit;
}
// </hivemail>
// @@@@@@@@@@@
Code:
// @@@@@@@@@@
// <hivemail>
if ($hive_signup == 'yes') {
hivemail_register_user($userid);
}
// </hivemail>
// @@@@@@@@@@@