Is there a way to change the default landing page from avatar?
in the join.php:
if ('EXIT' == BxDolService::call('avatar', 'join', array ($iMemID, $sStatusText))) { exit; }
I'm getting error when changing it to news
|
Ok. This is the proper code. Just tested. join.php at about line 325.
NOTE: This redirects to news after join is complete. It bypasses the upload and cropping of a avatar. So don't use this if you need to redirect after the avatar function is complete.
function showFinishPage( $iMemID, $sStatus ) {
// add these 7 lines of code to the top of the function. $sPwd = db_value("SELECT `Password` FROM `Profiles` WHERE `ID` = '".(int)$iMemID."' LIMIT 1"); if ($sPwd) { bx_login ((int)$iMemID); // autologin here bx_import('BxDolPermalinks'); $o = new BxDolPermalinks(); header('Location: ' . BX_DOL_URL_ROOT . $o->permalink('modules/?r=news/')); }
/* Comment Out all the code below. switch( $sStatus ) { case 'Active': $sStatusText = ('_USER_ACTIVATION_SUCCEEDED'); break; //activated automatically case 'Approval': $sStatusText = ('_USER_CONF_SUCCEEDED'); break; //automatically confirmed case 'Unconfirmed': $sStatusText = ('_EMAIL_CONF_SENT'); break; //conf mail succesfully sent case 'NotSent': $sStatusText = ('_EMAIL_CONF_NOT_SENT'); break; //failed to send conf mail }
if ('EXIT' == BxDolService::call('avatar', 'join', array ($iMemID, $sStatusText))) { exit; }
echo '<div class="dbContentHtml">'; echo _t( '_Join complete' ); echo '<br />'; echo _t( $sStatusText ); echo '</div>';
*/ End comment section
}
https://www.deanbassett.com |
Wait a minute.
Before you use that, i was reading your other posts regarding this same issue. But i am still uncertain.
Do you want to redirect after join to the news page, or do you want to redirect to the news after a uploaded photo is cropped with the avatar module.
If you need to redirect after the avatar is cropped, then we are changing the wrong code. If the later case the function in the avatar module needs to be changed instead.
https://www.deanbassett.com |
I just looked into this. If you need to redirect after the avatar is uploaded and cropped then your out of luck.
The origional redirect to the avatar module is the end of the join process.
If you have to force a redirect after the avatar is uploaded and cropped then that has to be done inside the avatar module itself and if you tried to do that it would have a nasty side affect. A redirect would occur every time a member changes their avatar, not just after the join process.
So you have 2 choices.
1) Use the code i provided above, and redirect after join skipping the avatar.
2) Don't do it at all.
https://www.deanbassett.com |
Deano, THANK YOU VERY MUCH!!! it works and I guess you also answered by this thread another questions about how to control join process!
I guess you can post it as an option if someone want to control JOIN.
THANKS AGAIN!!!
|
Deano, one more question....is there a way to include this section:
echo '<div class="dbContentHtml">'; echo _t( '_Join complete' ); echo '<br />'; echo _t( $sStatusText ); echo '</div>';
As indication for successful login, since he is now in the news page?
Thank you so far for taking the time and answering my question
|
Deano, one more question....is there a way to include this section:
echo '<div class="dbContentHtml">'; echo _t( '_Join complete' ); echo '<br />'; echo _t( $sStatusText ); echo '</div>';
As indication for successful login, since he is now in the news page?
Thank you so far for taking the time and answering my question
No. That section is displayed if no photo was uploaded to be cropped, or a error occured in the avatar module, otherwise the avatar module displays it. The avatar module is the only one designed to be redirected to after join. No other section in dolphin was designed for that.
So i do not know of a way to easily do it.
https://www.deanbassett.com |
Based on your instruction I changed:
header('Location: ' . BX_DOL_URL_ROOT . $o->permalink('modules/?r=news/'));
to
header('Location: ' . BX_DOL_URL_ROOT . $o->permalink('pedit.php?ID='.$iMemID));
and it works! I'll add a php block to this page in the page builder and get it from there
You deserve for that insight
|
Based on your instruction I changed:
header('Location: ' . BX_DOL_URL_ROOT . $o->permalink('modules/?r=news/'));
to
header('Location: ' . BX_DOL_URL_ROOT . $o->permalink('pedit.php?ID='.$iMemID));
and it works! I'll add a php block to this page in the page builder and get it from there
You deserve for that insight
Perma links are not used for pedit. So even if it works, it's not proper. Should be changed to this.
header('Location: ' . BX_DOL_URL_ROOT . 'pedit.php?ID='.$iMemID);
And these 2 lines can be removed as they are only needed for permalinks.
bx_import('BxDolPermalinks'); $o = new
BxDolPermalinks();
https://www.deanbassett.com |