Welcome Guest, Not a member yet? Register   Sign In
Problems with images
#1

[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:
&lt;?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-&gt;image ' title='$item_a-&gt;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>';
?&gt;
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:
&lt;?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-&gt;image ' title='$item_a-&gt;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>';
?&gt;

Could anyone help me in this matter?
thank you,
Marco Aurélio
Sao Paulo/Brazil
Sorry for English.






Theme © iAndrew 2016 - Forum software by © MyBB