Redirect after Avatar upload

Ok, I think this has come up before but not sure a solution was provided. I personally think its kinda surprising that after a member joins your site, they are redirected to the Avatar upload page.. so they upload a Avatar and click the 'Add Avatar' button.. then it just sits there on that page.

Does anyone know how to make it redirect to a page like member.php after the Avatar is successfully added?

I checked the Avatar module but not sure where to put something like a:

header("Location: member.php");

But assuming somewhere around Line 334-441 of the BxAvaModule.php. My test site is down at the moment so no way for me to test this.

Nothing to see here
Quote · 21 Aug 2010

Nope. That section only sets the avatar for cropping. That function is called after a image is uploaded from either the join page or from facebook connect and occurs before the cropping is actually done.

I will poke around and see if i can find a way to do this.

https://www.deanbassett.com
Quote · 21 Aug 2010

Ok.



Look for this in BxAvaModule.php at about line 142

function actionHome () {

if (!$this->_iProfileId) {
$this->_oTemplate->displayAccessDenied ();
return;
}

$this->_oTemplate->pageStart();

if ($_GET['make_avatar_from_shared_photo'] > 0)
$this->_makeAvatarFromSharedPhoto((int)$_GET['make_avatar_from_shared_photo']);

if (isset($_GET['join_text']) && $_GET['join_text']) {
echo MsgBox(_t(strip_tags($_GET['join_text'])));
}

if (isset($_POST['set_avatar'])) {
if (!$this->_cropAvatar ()) {
$aVars = array ('msg' => _t('_bx_ava_set_avatar_error'));
echo $this->_oTemplate->parseHtmlByName ('error_plank', $aVars);
}
}       


Change it to this.

function actionHome () {

if (!$this->_iProfileId) {
$this->_oTemplate->displayAccessDenied ();
return;
}

$this->_oTemplate->pageStart();

if ($_GET['make_avatar_from_shared_photo'] > 0)
$this->_makeAvatarFromSharedPhoto((int)$_GET['make_avatar_from_shared_photo']);

if (isset($_GET['join_text']) && $_GET['join_text']) {
echo MsgBox(_t(strip_tags($_GET['join_text'])));
}

if (isset($_POST['set_avatar'])) {
if (!$this->_cropAvatar ()) {
$aVars = array ('msg' => _t('_bx_ava_set_avatar_error'));
echo $this->_oTemplate->parseHtmlByName ('error_plank', $aVars);
} else {
header("Location: ../../member.php");
}
}

https://www.deanbassett.com
Quote · 21 Aug 2010

Dean.. Dean... Dean.. What can I say man.. YOU RAWK ON !!

Nothing to see here
Quote · 21 Aug 2010

thank you for this deano

Quote · 24 Nov 2010

Thanks Deano, it appears this redirect only comes into play if a member actually uploads an avatar and crops it so if the new member picks one of the default Boonex avatars from the left hand side, they will still just stay on that page. :)

Quote · 24 Nov 2010

Awesome Dino!  Thanks.

Quote · 24 Nov 2010

You are the man Deano..
Thanks a lot. (:

Quote · 4 Oct 2011

Thank you!!

www.online-love-finder.de - Singlebörse
Quote · 4 Mar 2012

How do I forward them to the edit profile page as soon as they upload an avatar? Here is the flow I would like to achieve when joining:

1. Sign Up

2. Automatically Forward to Add Avatar page

3. Automatically go to Edit Profile Page so they can finish filling out profile fields.

Quote · 7 Jul 2014

 I have mine setup this exact way. I just followed the above instructions and instead of member.php redirect to pedit.php (I did not use the GET variables you normally see in the url field and it works for me)

How do I forward them to the edit profile page as soon as they upload an avatar? Here is the flow I would like to achieve when joining:

1. Sign Up

2. Automatically Forward to Add Avatar page

3. Automatically go to Edit Profile Page so they can finish filling out profile fields.

 

caredesign.net
Quote · 8 Jul 2014

COuld you provide the actual code you used.. I must have something off by a bit because it is not working fo rme.. Thanks!

Quote · 12 Jul 2014

This is the code I use:

 

function actionHome () {

if (!$this->_iProfileId) {
$this->_oTemplate->displayAccessDenied ();
return;
}

$this->_oTemplate->pageStart();

if ($_GET['make_avatar_from_shared_photo'] > 0)
$this->_makeAvatarFromSharedPhoto((int)$_GET['make_avatar_from_shared_photo']);

if (isset($_GET['join_text']) && $_GET['join_text']) {
echo MsgBox(_t(strip_tags($_GET['join_text'])));
}

if (isset($_POST['set_avatar'])) {
if (!$this->_cropAvatar ()) {
$aVars = array ('msg' => _t('_bx_ava_set_avatar_error'));
echo $this->_oTemplate->parseHtmlByName ('error_plank', $aVars);
else {
header("Location: ../../pedit.php");
}
}


And it will say "access denied" once after they upload and cropped the avatar and are redirected..

Quote · 12 Jul 2014

Not surprising considering the code you used was posted 4 years ago and it not intended for use with any dolphin 7.1 versions.

https://www.deanbassett.com
Quote · 13 Jul 2014

Proper code for dolphin 7.1 would be this.

Look for this in BxAvaModule.php at about line 163

        if (isset($_POST['set_avatar'])) {
            if (!$this->isAllowedAdd ())
                $aVars = array ('msg' => _t('_bx_ava_msg_access_denied'));
            elseif (!$this->_cropAvatar ())
                $aVars = array ('msg' => _t('_bx_ava_set_avatar_error'));
            if (!empty($aVars))
                echo $this->_oTemplate->parseHtmlByName ('error_plank', $aVars);
        }

Edit to add the section in green like so.

        if (isset($_POST['set_avatar'])) {
            if (!$this->isAllowedAdd ())
                $aVars = array ('msg' => _t('_bx_ava_msg_access_denied'));
            elseif (!$this->_cropAvatar ())
                $aVars = array ('msg' => _t('_bx_ava_set_avatar_error'));
            if (!empty($aVars))
                echo $this->_oTemplate->parseHtmlByName ('error_plank', $aVars);
            else
                header("Location: ../../member.php");
        }


NOTE: just like the previous code for dolphin 7.0 this only redirects after cropping a uploaded avatar image. Not when selecting one of the preloaded avatars.

https://www.deanbassett.com
Quote · 13 Jul 2014
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.