Customizing SMF > SMF Coding Discussion

Display Images Horizontally

(1/5) > >>

The Wizard:
Hello:

I'm wanting to display the images horizontally and they keep showing up vertically.
Would someone be kind enough to help?
Thanks
Wiz

My Code in Display.template.php


--- Code: --- echo'

    <dd>', $message['member']['wizard1'], $message['member']['wizard2'], $message['member']['wizard3'], '</dd>
';
--- End code ---

Suki:
What you can do is putting all your images on a single array:

$message['member']['wizard_images']  and then do a foreach:

echo '<table border="1">
 <tr>';

foreach($message['member']['wizard_images'] as $image)
echo ' <td>', $image ,'</td>';

echo ' </tr>
 </table>';

If you have more than 3 or you just don't know how images the array has, you can set a counter and add a tr to force a new row of images.

The Wizard:
Hello:

Thank you Suki. I still need a little more help if thats ok?

I have created a array and put it in Load.php and it works fine. All the images show up. The just show up horizontally.
I figure I have 1/2 the counting part worked out, but I cant get it to create a new collumn. This is what I have so far

--- Code: --- $i = 0;

            if ($i <=9) {

            $i = $i + 1;

            echo '<table border="1">
                  <tr>';

            foreach($message['member']['wizard_images'] as $image)
            echo ' <td>', $image ,'</td>';

            echo ' </tr>
                   </table>';

            }
--- End code ---
           

The Wizard:
anybody?

Suki:
How many images do you want to show horizontally before wrap?

Navigation

[0] Message Index

[#] Next page

Go to full version