Showing latest photos in page

I have several static pages in my site, but i want to show in these pages the lates photos uploaded in a category, but when i edi the pages i just can add a html block, but i cant add the latest photos "modulo"

How can i do this.

Quote · 7 Jun 2013

You have to add a php block.  There are a couple of free modules in the market that allow you to add a php block to a page.

Once you add a php block, then you can add code that will search photos based on the category and display them in that block.  You can have several of these php blocks on a page, each one displaying different categories of photos.

The code to enter in the php block is something similar to this:

require_once(BX_DIRECTORY_PATH_MODULES . 'boonex/photos/classes/BxPhotosSearch.php');

$this->oSearch = new BxPhotosSearch();

$this->oSearch->aCurrent['restriction']['category'] = array(

            'field' => 'Categories',

            'value' => 'Enter the category to search on',

            'operator' => '=',

            'paramName' => 'category'

        );

    $this->oSearch->aConstants['linksTempl']['category'] = 'browse/category/{uri}';

        $aCustom = array(

        'per_page' => 'Enter the number you wish to be display per page of the block',

        'menu_bottom_type' => 'category',

'wrapper_class' => 'result_block'

    );

        $aCode = $this->oSearch->getBrowseBlock(array('category' => 'Replace this with the category', 'allow_view' => $this->aVisible), $aCustom);

    if ($this->oSearch->aCurrent['paginate']['totalNum'] > 0)

return array($aCode['code'], $aCode['menu_top'], $aCode['menu_bottom'], '');

 

Replacing the bits where noted with your categories and number to be displayed per page.  Note if the search returns empty, the php block will not be displayed.  The coders here may want to check the above for errors or improvements.

Geeks, making the world a better place
Quote · 7 Jun 2013

Here is one of the free modules that will allow you to easily add a php block to a page.

http://www.boonex.com/m/Add_PHP_Block_to_Page_Builders_

Geeks, making the world a better place
Quote · 7 Jun 2013

Code works perfectly for recently added photos, thanks!  Is there an easy modification to pull only photos marked as favorites instead of photos for a specific category?

Quote · 27 Sep 2013

 

Code works perfectly for recently added photos, thanks!  Is there an easy modification to pull only photos marked as favorites instead of photos for a specific category?

I posted a forum topic,  http://www.boonex.com/forums/#topic/BxPhotosSearch.htm but got nothing.  Dolphin is really a developer's platform but the problem is that you have to look through the code and try to figure out how to use the functions.

Geeks, making the world a better place
Quote · 27 Sep 2013

You are so right - thanks for the confirmation.  I've spent way too many hours tracing dolphin function calls to try to figure out how to use the code to do what should be pretty simple.  Thanks for posting the forum topic and for your quick response!

Quote · 27 Sep 2013

I remember we dizcuzed about display favorite photos and videos on a block before, do a search and you may find something. I was able to do it but I forgot how already.

Quote · 27 Sep 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.