Add Comment Count

What's the best way to add comment count for each photo on photo homepage?  Right now I'm in browse_unit.html and BxBaseSearchResultSharedMedia.php.  I'm a bit confused. :S Maybe i'm doing the long way.  Do you guys know the best way to add comment count like this?

screenshot20110117at411.png

Quote · 17 Jan 2011

I guess It's good suggestion for you :)

 

//get instance of photos module
$oPhotos = BxDolModule::getInstance('BxPhotosModule');

$oCmtsView = new BxTemplCmtsView($oPhotos -> _oConfig -> getMainPrefix(), $iPhotoId);

$iCommentsCount = $oCmtsView -> _oQuery -> getObjectCommentsCount($iPhotoId);

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

Where would we add this, browse_unit.html ?

I guess It's good suggestion for you :)

 

//get instance of photos module
$oPhotos = BxDolModule::getInstance('BxPhotosModule');

$oCmtsView = new BxTemplCmtsView($oPhotos -> _oConfig -> getMainPrefix(), $iPhotoId);

$iCommentsCount = $oCmtsView -> _oQuery -> getObjectCommentsCount($iPhotoId);

 

There are none so blind as those that will not see.
Quote · 18 Jan 2011

 

Where would we add this, browse_unit.html ?

I guess It's good suggestion for you :)

 

//get instance of photos module
$oPhotos = BxDolModule::getInstance('BxPhotosModule');

$oCmtsView = new BxTemplCmtsView($oPhotos -> _oConfig -> getMainPrefix(), $iPhotoId);

$iCommentsCount = $oCmtsView -> _oQuery -> getObjectCommentsCount($iPhotoId);

 

It's different question. Will be easy if your hire some of expertz here to do this

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

your kidding, right?

 

Where would we add this, browse_unit.html ?

I guess It's good suggestion for you :)

 

//get instance of photos module
$oPhotos = BxDolModule::getInstance('BxPhotosModule');

$oCmtsView = new BxTemplCmtsView($oPhotos -> _oConfig -> getMainPrefix(), $iPhotoId);

$iCommentsCount = $oCmtsView -> _oQuery -> getObjectCommentsCount($iPhotoId);

 

It's different question. Will be easy if hire some of expertz here to do this

 

There are none so blind as those that will not see.
Quote · 18 Jan 2011

 

your kidding, right?

 

Where would we add this, browse_unit.html ?

I guess It's good suggestion for you :)

 

//get instance of photos module
$oPhotos = BxDolModule::getInstance('BxPhotosModule');

$oCmtsView = new BxTemplCmtsView($oPhotos -> _oConfig -> getMainPrefix(), $iPhotoId);

$iCommentsCount = $oCmtsView -> _oQuery -> getObjectCommentsCount($iPhotoId);

 

It's different question. Will be easy if hire some of expertz here to do this

 

Ok I will try explain all step by step :

 

1. Open the modules\boonex\photos\templates\base\browse_unit.html

add this key {comments_count} in any place

2. Open the modules\boonex\photos\classes\BxPhotosSearch.php

find this code line : $this->aCurrent['ownFields'] = array('ID', 'Title', 'Uri', 'Date', 'Size', 'Views', 'Rate', 'RateCount', 'Hash');

and replace with : $this->aCurrent['ownFields'] = array('ID', 'Title', 'Uri', 'Date', 'Size', 'Views', 'Rate', 'RateCount', 'Hash', 'CommentsCount');

3. Open the - templates\base\scripts\BxBaseSearchResultSharedMedia.php

find this code line : $aUnit['view'] = $aData['view'];

and past it after that:

$aUnit['comments_count'] = isset($aData['CommentsCount']) ? $aData['CommentsCount'] : '';

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

Many thanks, Sasha,

 

Stuart

There are none so blind as those that will not see.
Quote · 18 Jan 2011

Oh wow.. i didn't see this!!   I will try and let you know, Sashe!!

Quote · 19 Jan 2011

You're awesome Sashe!!!  It's perfect! Laughing I missed the third file, BxPhotosSearch.php. I really appreciate your great help.

Quote · 19 Jan 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.