Add Upload to Join Form

The join form builder has an item for uploading a profile photo when the person fills out the join form.  I want to add an upload button so that my users may add additional items during the join form.  How may I go about this task?

Geeks, making the world a better place
Quote · 29 Dec 2013

Interesting.

And i have no clue. Considering the join form and builder was not designed for additional upload items i am sure it is going to require some custom coding.

Sorry. But my time is limited, so i can't really look into it.

https://www.deanbassett.com
Quote · 29 Dec 2013

Thanks Deano.  I am looking at another solution, redirect after join to a special page to handle it.  After a person completes the join form, isn't a session cookie set with their new ID that I can obtain?

Geeks, making the world a better place
Quote · 29 Dec 2013

Looking in the processor file I did find the photo upload part:

        //--- upload profile photo
        if(isset($aProfile1['ProfilePhoto']) && !empty($aProfile1['ProfilePhoto'])) {
            $sPass1 = getPassword($iId1);
            bx_login($iId1);

            check_logged();

            BxDolService::call('avatar', 'set_image_for_cropping', array ($iId1, $GLOBALS['dir']['tmp'] . $aProfile1['ProfilePhoto']));

            if (BxDolRequest::serviceExists('photos', 'perform_photo_upload', 'Uploader')) {
                $aFileInfo = array (
                    'medTitle' => _t('_sys_member_thumb_avatar'),
                    'medDesc' => _t('_sys_member_thumb_avatar'),
                    'medTags' => _t('_ProfilePhotos'),
                    'Categories' => array(_t('_ProfilePhotos')),
                    'album' => str_replace('{nickname}', getUsername($iId1), getParam('bx_photos_profile_album_name')),
                    'albumPrivacy' => BX_DOL_PG_ALL
                );
                BxDolService::call('photos', 'perform_photo_upload', array($GLOBALS['dir']['tmp'] . $aProfile1['ProfilePhoto'], $aFileInfo, false), 'Uploader');
            }
        }

        if (BxDolModule::getInstance('BxWmapModule'))
        

Geeks, making the world a better place
Quote · 29 Dec 2013

Dolphin does not use regular php sessions.

However after join as well as login a cookie is set with their member id. You can get it in php like so.

$iMemID = (int)$_COOKIE['memberID'];

https://www.deanbassett.com
Quote · 29 Dec 2013

 

Dolphin does not use regular php sessions.

However after join as well as login a cookie is set with their member id. You can get it in php like so.

$iMemID = (int)$_COOKIE['memberID'];

Thanks Dean.  I was using this in BxDolJoinProcessor.php:

        if($iMemID)
        {
          bx_login ((int)$iMemID);
          header("Location: " . BX_DOL_URL_ROOT . "page/my_page");
          exit;
        }

However, we have confirmation email turned on and when the bx_login is done, it sends them to the unconfirmed.php automatically; the rest of the if is not done.  Of course if they leave and come back later and have not confirmed their email I want them to go to unconfirmed.php.  I only want this redirect done after they complete the join form.  So I guess I need to not try and log them in before the redirect.  However, they do need to be logged in when they land on the redirect page.  If I try to log them in, I assume that unconfirmed.php page is going to come up.

 

Edit: I did see some topics about setting sessions cookies; I guess if I did that then they be logged in without using the login script that sends them to the unconfirmed.php.  However, I assume that means they would also have access that normally an unconfirmed member would not.  There is a mod in the market that limits unconfirmed members; not sure how that would play out with what I want to do.

Geeks, making the world a better place
Quote · 29 Dec 2013

Maybe what I need to do is to modify the unconfirmed.php file.  If I can set it so that I know they are coming from joining rather than a direct login, then I won't need to worry about trying to send them to a custom page; just use the unconfirmed.php to do what I want.

Geeks, making the world a better place
Quote · 30 Dec 2013

OK, what I am going to try is to use php sessions.  I will set a session variable on the BxDolJoinProssor and then on the unconfirmed.php I will read that session variable and then change it.  So if someone logs out of the site and comes back in later and still is unconfirmed, they won't see the post join page I will add.  I found out that I still have to redirect them to the page but since they are unconfirmed, Dolphin redirects them again to the unconfirmed.php page and I do want to keep the confirmation email thing in place.

A test showed that it worked, when the member finishes the join process, they will still end up on the unconfirmed page but I will check and show them my post join page instead of the normal unconfirmed page.

 

Edit: By the way, what I was running into is partly due to running a block on unconfirmed members to limit what they can do on the site; this was a module that I purchased in the market.

Geeks, making the world a better place
Quote · 30 Dec 2013
 
 
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.