Accessing an albums granchilds thumbs.

erlis

Joined: 2004-01-16
Posts: 205
Posted: Mon, 2011-05-23 11:58

Hi,

I'm trying to build a theme with album skimming support (multiple thumbs for one album) and having problem to access the "granchildren" object i.e. children of a children.

in album.html.php I have:

<? foreach ($children as $i => $child): ?>
<? if($child->is_album()): ?>
<?  print_r($child->children()) ?>
<? endif ?>
<? endforeach ?>

Wich produces the following:

ORM_Iterator Object
(
    [class_name:protected] => Item_Model
    [primary_key:protected] => id
    [primary_val:protected] => name
    [result:protected] => Database_Mysqli_Result Object
        (
            [internal_row:protected] => 0
            [result:protected] => mysqli_result Object
                (
                    [current_field] => 0
                    [field_count] => 33
                    [lengths] => 
                    [num_rows] => 11
                    [type] => 0
                )

            [total_rows:protected] => 11
            [current_row:protected] => 0
            [insert_id:protected] => 
            [return_objects:protected] => 1
            [sql] => SELECT `items`.*
FROM `items`
WHERE `parent_id` = '260'
ORDER BY `captured` ASC, `id` ASC
        )

)

How can I make something useful out of $child->children() ?

 
erlis

Joined: 2004-01-16
Posts: 205
Posted: Mon, 2011-05-23 13:02

Wow, this were impressive, just doing:

<? foreach ($children as $i => $child): ?>
<? if($child->is_album()): ?>
<?  foreach ($child->viewable()->children() as $granchild): ?>
<?= $granchild->thumb_url() ?>
<? endforeach ?>
<? endif ?> 
<? endforeach ?>

Produces exactly the information I wanted..

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2011-05-23 16:24

Glad you got it sorted.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team