Today I've made several changes to the join process in my site. Two of these changes are based on posts I found in the forums, and one will be newly introduced here after I successfully implemented it myself.
I've decided to gather them all together for easier access. Here goes:
Redirect after join:
Based on Deano's post in this topic, I've implemented a redirect to the account (dashboard) page after a new member join, instead of to the avatar page.
This is the solution I used:
Near the end of the file look for this.
if ('EXIT' == BxDolService::call('avatar', 'join', array ($iMemID, $sStatusText))) {
exit;
}
Comment out those lines and/or replace with this.
bx_login ((int)$iMemID);
header("Location: " . BX_DOL_URL_ROOT . getNickName($iMemID));
exit;
If you prefer to redirect to the dashboard then use this.
bx_login ((int)$iMemID);
header("Location: " . BX_DOL_URL_ROOT . "member.php");
exit;
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
Auto-friend with admin:
Based on Prolaznik's post in this topic, I made every new member a friend with admin by default.
This is the solution I used:
/inc/classes/BxDolJoinProcessor.php
around line 250 (before "check for couple profile"), add this code:
$dump = db_res("INSERT INTO sys_friend_list SET `ID` = '{$iId1}', `Profile` = 1, `Check` = 1");
1 is the id of your first registered member that would be your admin account.
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
Auto welcome private message to a new member (after join):
This one I couldn't find anywhere, so I worked it myself. This trick creates an automatic new message from the admin, for every newly joined member.
It helps especially if your new members are redirected to the account page, where you can place a box displaying new messages. This way, the new auto message is one of the first things a new user sees, and in it you can greet, instruct and supply information and help to new users. That's how you accomplish that:
in inc/classes/BxDolJoinProcessor.php, in function showFinishPage (at the end of the file, as for now):
if you don't have a new user redirect, then before these lines:
if ('EXIT' == BxDolService::call('avatar', 'join', array ($iMemID, $sStatusText))) {
exit;
Insert these:
// send auto welcome message
$msg = "<p>"._t( '_Join complete' )."<br/>" ._t($sStatusText)."<br/>"._t('_Join_msg_auto_welcome')."</p>";
$subject = _t( 'Join_msg_auto_welcome_subject' );
$dump = db_res("INSERT INTO `sys_messages`(`Date`, `Sender`, `Recipient`, `Text`, `Subject`) VALUES (NOW(),'1','{$iMemID}','{$msg}','{$subject}')");
If you implemented a redirect-after-join, then place the same above lines inside the redirect block, before the "exit", like this:
if($iMemID) {
bx_login ((int)$iMemID);
header("Location: " . BX_DOL_URL_ROOT . "member.php");
// send auto welcome message
$msg = "<p>"._t( '_Join complete' )."<br/>" ._t($sStatusText)."<br/>"._t('_Join_msg_auto_welcome')."</p>";
$subject = _t( 'Join_msg_auto_welcome_subject' );
$dump = db_res("INSERT INTO `sys_messages`(`Date`, `Sender`, `Recipient`, `Text`, `Subject`) VALUES (NOW(),'1','{$iMemID}','{$msg}','{$subject}')");
exit;
}
You may change the $msg and $subject vars to whatever you want them to be (they set the message subject and body).
In my example, the message body contains the join process status + a pre-defined content, and the subject is also pre-defined in the language file.
If you choose to keep my solution as is, note that you have to add 2 new language keys in order for this to work:
_Join_msg_auto_welcome , and _Join_msg_auto_welcome_subject.
[These 3 solutions were implemented and tested on Dolphin 7.1.1]