Welcome Guest, Not a member yet? Register   Sign In
Gallery problem: one query, different images size
#5

[eluser]Référencement Google[/eluser]
That works partially. I've got now the first thumbnail the same as the large picture, this is what I wanted to avoid, I need that the large picture is different that all the thumbnails.

I post the full actual code:
Code:
<?php
        
        $i = 0;        
        foreach($latestprofiles as $profile)
        {
            $i++;
            $data['pics'][$i] = $profile->photo_file;            
        }
        
        // $data['pics'][1] will always be your the big picture
        // $data['pics'][2] -> $data['pics'][...] will be thumbnails
        
        ?>
        
        <a class="big_picture" href="&lt;?=site_url('members/register')?&gt;"><img src="&lt;?=$GLOBALS['photos_path'].$data['pics'][1]?&gt;" /></a>
        
        <div class="thumbnails clearfix">
                        
            &lt;?php foreach($data['pics'] as $id => $thumb): ?&gt;          
            
            <a href="&lt;?=site_url('members/register')?&gt;"><img src="&lt;?=$GLOBALS['photos_path'].'thumbs/th_'.$thumb?&gt;" /></a>
            
            &lt;?php endforeach; ?&gt;

And the print_r of $data['pics']
Code:
Array
(
    [1] => file_01.jpg
    [2] => file_02.jpg
    [3] => file_03.jpg
    [4] => file_04.jpg
    [5] => file_05.jpg
)


Messages In This Thread
Gallery problem: one query, different images size - by El Forum - 09-20-2007, 10:54 AM
Gallery problem: one query, different images size - by El Forum - 09-20-2007, 11:19 AM
Gallery problem: one query, different images size - by El Forum - 09-20-2007, 12:03 PM
Gallery problem: one query, different images size - by El Forum - 09-20-2007, 12:16 PM
Gallery problem: one query, different images size - by El Forum - 09-20-2007, 12:28 PM
Gallery problem: one query, different images size - by El Forum - 09-20-2007, 12:43 PM



Theme © iAndrew 2016 - Forum software by © MyBB