Profile Timeline Logic

Can someone help me understand the logic of the serviceGetBlockPostProfile() used in profile posting:

public function serviceGetBlockPostProfile($sProfileModule = 'bx_persons', $iProfileContentId = 0)

{

if(empty($sProfileModule))

       return array();


if(empty($iProfileContentId) && bx_get('id') !== false)

       $iProfileContentId = bx_process_input(bx_get('id'), BX_DATA_INT);

$oProfile = BxDolProfile::getInstanceByContentAndType($iProfileContentId, $sProfileModule);

if(empty($oProfile)) 

        return array();

$iProfileId = $oProfile->id();

$sType = BX_BASE_MOD_NTFS_TYPE_OWNER;

return $this->_getBlockPost($iProfileId, array(

            'type' => $sType,

            'form_display' => $this->_oConfig->getPostFormDisplay($sType)

        ));

}

  • 198
  • More
Replies (4)
    • Hello SehaSky !

      Let me try to add the current comments :-) My answers have the bold font.

      if(empty($sProfileModule))

             return array();

      If the given module's name is empty, return the empty array for the block (empty block), exit from the method.

      if(empty($iProfileContentId) && bx_get('id') !== false)

             $iProfileContentId = bx_process_input(bx_get('id'), BX_DATA_INT);

      If the given profile id is empty, but the GET id variable exists, the profile id will take the value of $_GET['id'].

      $oProfile = BxDolProfile::getInstanceByContentAndType($iProfileContentId, $sProfileModule);

      The creation of $oProfile object according the given info.

      if(empty($oProfile)) 

              return array();

      if the creation of this object fails then then return the empty array, exit from the method. 

      $iProfileId = $oProfile->id();

      The taking value of $oProfile->id() field to $iProfileId variable.

      $sType = BX_BASE_MOD_NTFS_TYPE_OWNER;

      The setting the type of "post" mode.

      return $this->_getBlockPost($iProfileId, array(

                  'type' => $sType,

                  'form_display' => $this->_oConfig->getPostFormDisplay($sType)

              ));

      The calling _getBlockPost method with the formed parameters.

      • Hi Leonid, thanks for your reply. I've now tracked the service call to the last bit, however, I'm still struggling with the following issue:

        I've created a custom text field in the timeline post form and I added it to the display 'write profile post', however, the custom field is not processed after filling the form. The database shows the filed on the bx_timeline_events but it is empty. It sounds that the getFormPost() which is used in the Timeline 'write profile post' display does not process the custom field. Could you please help me on this issue!

        • Hello SehaSky !

          It needs to check it directly on the server. Please provide me your Control Panel and UNA studio accesses via Messenger.

          • I have not deployed the timeline changes to our live website yet because the new custom field on the timeline form does not work as mentioned above. I've sent you the modified 'timeline' module files which you can install locally to check the code and the local database logs.

            Login or Join to comment.