Show Author in photo !

Hi there,

I want to show Author name in photo page view and of course I have to link it to its profile page.

Well,in  /modules/boonex/photos/classes/

we have Bxphotopageview.php( I added the red lines)

in line 54 we got this:

 $aReplacement = array(
    'file_type' => '_blank',
                'moduleUrl' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri(),
                'fileUri' => $this->aFileInfo['medUri'],
                'fileKey' => $this->aFileInfo['Hash'],
                'fileExt' => $this->aFileInfo['medExt'],
                'iViewer' => $this->iProfileId,
                'ID' => (int)$this->aFileInfo['medID'],
                'Owner' => (int)$this->aFileInfo['medProfId'],
                'OwnerName' => $this->aFileInfo['NickName'],
                'profileURL' => $this->aFileInfo['profileURL'],
                'AlbumUri' => $this->aFileInfo['albumUri'],
                'Tags' => bx_php_string_apos($this->aFileInfo['medTags']),
                'TitleSetAsAvatar' => $this->aFileInfo['medProfId'] == $this->iProfileId ? _t('_bx_photos_set_as_avatar') : '',
                'sbs_bx_' . $this->oConfig->getUri() . '_title' => $aButton['title'],
                'sbs_bx_' . $this->oConfig->getUri() . '_script' => $aButton['script']
            );

and in line 152 we got this:

  $aUnit = array(
            'pic' => $this->oSearch->getImgUrl($this->aFileInfo['Hash'], 'file'),
            'width_ext' => $iWidth + 2,
            'width' => $iWidth,
            'fileTitle' => $this->aFileInfo['medTitle'],
           'profileURL' => (int)$this->getProfileLink['owner'],  //    I REALLY NEED THIS LINE PLEASE!!!!
            'rate' => $oVotingView->isEnabled() ? $oVotingView->getBigVoting(1, $this->aFileInfo['Rate']): '',
            'favInfo' => $this->oDb->getFavoritesCount($this->aFileInfo['medID']),
            'viewInfo' => $this->aFileInfo['medViews'],
            'albumUri' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'browse/album/' . $this->aFileInfo['albumUri'] . '/owner/' . $this->aFileInfo['NickName'],
            'NickName' => $this->aFileInfo['NickName'],
            'albumCaption' => $this->aFileInfo['albumCaption'],
            'bx_if:prev' => array(
                'condition' => $this->aFileInfo['prevItem'] > 0,
                'content' => array(
                    'linkPrev'  => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri() . 'view/' . $aPrev['medUri'],
                    'titlePrev' => $aPrev['medTitle'],
                    'percent' => $this->aFileInfo['nextItem'] > 0 ? 50 : 100,
                )

 

In /modules/boonex/photos/templates/base/

there is view_unit.html

in the beginning we have this:

 <div class="fileUnit">
   
        <div class="navPanel" style="width:__width_ext__px;">
            <div class="navPanelLink">
                Author:  <a href="__albumUri__">__NickName__</a>
                <bx_text:_sys_album />: <a href="__albumUri__">__albumCaption__</a>
            </div>

 

Adding the red lines now I have  The author name in the photo page view but I missing the link to its profile page.

 

Could someone show me the correct way to write this line

'profileURL' => (int)$this->getProfileLink['owner'],  ???

 

many thanks

Quote · 30 Jan 2011

replace  this : 'profileURL' => (int)$this->getProfileLink['owner'],

with : 'profileURL' => getProfileLink($this->aFileInfo['medProfId']),

PS: If possible do not write me personally, please try to ask on the forum first
Quote · 31 Jan 2011

Many thanks SashaE !

It works great  ;-)

 

Quote · 1 Feb 2011

Sorry SashaE but I'd like to add the author link in video page  as well,

but in /modules/boonex/videos/classes/

BxVideoPageView.php

 in line 144 I found this:

   function getBlockCode_ViewFile () {
        $this->aFileInfo['favCount'] = $this->oDb->getFavoritesCount($this->aFileInfo['medID']);
  
        return $this->oTemplate->getViewFile($this->aFileInfo);
    }

 

Where could I add the next  two lines of code and make my author link working?

 'profileURL' => getProfileLink($this->aFileInfo['medProfId']),

 'NickName' => $this->aFileInfo['NickName'],

Thanks a lot !

Quote · 1 Feb 2011

nice mod

 

 

Thanks

Quote · 1 Feb 2011

ok ok,

in  /modules/boonex/videos/classes/

 BxVideosTemplate.php

about line 50 I found this:

 $aUnit = array(
            'file' => $this->getFileConcept($aInfo['medID'], array('ext'=>$aInfo['medExt'], 'source'=>$aInfo['medSource'])),
            'width_ext' => $iWidth + 2,
            'width' => $iWidth,
            'fileUrl' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aInfo['medUri'],
            'fileTitle' => $aInfo['medTitle'],
   'NickName' => $this->aFileInfo['NickName'],
   'profileURL' => getProfileLink($this->aFileInfo['medProfId']),
            'rate' => $oVotingView->isEnabled() ? $oVotingView->getBigVoting(1, $aInfo['Rate']): '',
            'favInfo' => isset($aInfo['favCount']) ? $aInfo['favCount'] : '',
            'viewInfo' => $aInfo['medViews'],
            'albumUri' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'browse/album/' . $aInfo['albumUri'] . '/owner/' . $aInfo['NickName'],
            'albumCaption' => $aInfo['albumCaption'],
            'bx_if:prev' => array(
                'condition' => $aInfo['prevItem'] > 0,
                'content' => array(
                    'linkPrev'  => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aPrev['medUri'],
                    'titlePrev' => $aPrev['medTitle'],
                    'percent' => $aInfo['nextItem'] > 0 ? 50 : 100,
                )
            ),

I added the two red lines but my Author link is not working yet !

Now in the video page view I have " Author : " and nothing else, I can not see the link !

SashaE help me pleaseeee.

Quote · 2 Feb 2011

Here I go !

I found out the way to get author links in video and sounds !

Let's do it for videos and then you can do it for sounds in the same way.

Well,

go to modules/boonex/videos/classes/   BxVideosPageView.php

and add the red line:

 $aReplacement = array(
                'file_type' => '_blank',
                'moduleUrl' => BX_DOL_URL_ROOT . $this->oConfig->getBaseUri(),
                'fileUri' => $this->aFileInfo['medUri'],
                'iViewer' => $this->iProfileId,
                'ID' => (int)$this->aFileInfo['medID'],
                'Owner' => (int)$this->aFileInfo['medProfId'],
                'OwnerName' => $this->aFileInfo['NickName'],
               'profileURL' => $this->aFileInfo['profileURL'],
                'AlbumUri' => $this->aFileInfo['albumUri'],
               'sbs_bx_' . $this->oConfig->getUri() . '_title' => $aButton['title'],
                'sbs_bx_' . $this->oConfig->getUri() . '_script' => $aButton['script']

 

Now go to  modules/boonex/videos/classes/   BxVideosTemplate.php

and add the two red lines:

  $aUnit = array(
            'file' => $this->getFileConcept($aInfo['medID'], array('ext'=>$aInfo['medExt'], 'source'=>$aInfo['medSource'])),
            'width_ext' => $iWidth + 2,
            'width' => $iWidth,
            'fileUrl' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'view/' . $aInfo['medUri'],
            'fileTitle' => $aInfo['medTitle'],
            'profileURL' => getProfileLink($aInfo['medProfId']),
            'rate' => $oVotingView->isEnabled() ? $oVotingView->getBigVoting(1, $aInfo['Rate']): '',
            'favInfo' => isset($aInfo['favCount']) ? $aInfo['favCount'] : '',
            'viewInfo' => $aInfo['medViews'],
            'albumUri' => BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'browse/album/' . $aInfo['albumUri'] . '/owner/' . $aInfo['NickName'],
            'NickName' => $aInfo['NickName'],
            'albumCaption' => $aInfo['albumCaption'],

That's it !  ;-)

Quote · 4 Feb 2011
 
 
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.