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

[eluser]Référencement Google[/eluser]
Hi,

I am stopped with a problem.
I have 1 DB query that return 5 rows, that rows are the photo files.
My gallery has 1 big picture and then 4 thumbnails. I don't know how to make that working, need some help. Some code will help:

In the model, the query:
Code:
SELECT * FROM nip_photo LIMIT 5

Then, in the controller:
Code:
// The function _get_latestProfiles() retrieve the photos data from the DB
$data['latestpics'] = $this->_get_latestProfiles();
$this->load->view('gallery', $data);

Then the view:
Code:
<!-- HERE is my problem,
I would like from the query to get the first row as the big picture,
then loop in the foreach to get the other thumbnails that must be different from
the big picture -->
<img class="big_picture" src="here I want the big picture" />

<div class="thumbnails">
&lt;?php foreach($latestpics as $pic): ?&gt;
    
    <img src="thumb-&lt;?=$pic->photo_file?&gt;" />

&lt;?php endforeach ?&gt;
</div>

Note that I simplified my original code.
I don't have problem printing thumnails on screen, this is working, I just don't know how to make things to get the first DB row as the big picture and the following result rows as thumbnails.

Some help ?


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