[eluser]Unknown[/eluser]
Hello everybody.
I'm having difficulty manipulating images.
I have a mysql table with the following field:
image varchar (45) not null;
mini_image varcher (45) not null
The content of a record is
image = 'img_01.jpg'.
mini_image= 'img_01.jpg' (thumb)
when I use
Code:
echo img(base_url() . "assets/img/servicos/".$item_a->image);
echo img(base_url() . "assets/img/servicos/".$item_a->'mini_image);
No problems!
Occurs I am using a JQuery library that creates an image gallery.
The html code to generate the gallery is:
Code:
<div id="thumbs">
<ul class="thumbs noscript">
<li>
<a class="thumb" name="optionalCustomIdentifier" href="path/to/slide" title="your image title">
<img src="path/to/thumbnail" alt="your image title again for graceful degradation" />
</a>
<div class="caption">
(Any html can go here)
</div>
</li>
... (repeat for every image in the gallery)
</ul>
</div>
My code should be
Code:
<?php
echo '<div id="thumbs" class="navigation">';
echo '<ul class="thumbs noscript">';
foreach ($item_x as $item_a){
echo '<li>';
echo "<a class='thumb' href='" . base_url() ."assets/img/services/$item_a->image ' title='$item_a->image'>";
$image_properties = array(
'src' => base_url() . 'assets/img/services/'$item_a->mini_image',
'alt' => $item_a->imagem,
);
img($image_properties);
echo '</a>';
echo '<div class="caption">';
echo '<h6>'.($item_a->legend). '</h6>';
echo '</div>';
echo '</li>';
}
echo '</ul>';
echo '</div>';
?>
This does not work
On the other hand the code below works, but I only shows the first image of the gallery since missing attribute 'alt' in
Code:
echo img(base_url() . "assets/img/servicos/".$item_a->mini_image);
Code:
<?php
echo '<div id="thumbs" class="navigation">';
echo '<ul class="thumbs noscript">';
foreach ($item_x as $item_a){
echo '<li>';
echo "<a class='thumb' href='" . base_url() ."assets/img/services/$item_a->image ' title='$item_a->imagem'>";
echo img(base_url() . "assets/img/services/".$item_a->mini_image);
echo '</a>';
echo '<div class="caption">';
echo '<h6>'.($item_a->legend). '</h6>';
echo '</div>';
echo '</li>';
}
echo '</ul>';
echo '</div>';
?>
Could anyone help me in this matter?
thank you,
Marco Aurélio
Sao Paulo/Brazil
Sorry for English.