Formatting display for Columns & Rows

5 posts by 3 authors in: Forums > CMS Builder
Last Post: March 8, 2008   (RSS)

By BigBear - March 6, 2008 - edited: March 6, 2008

Hi Dave,

Simple simon here again.. lol

How do I go about placing data in a 4 x 3 table in the order that it comes up.

Is this done with the program, or is this a CSS or Html thing?

Thanks
Rob

php count

By matrix - March 8, 2008

Using your suggestion as a way to get thumbnails to write in 2 column rows as follows:
<?php $maxCols=2;
if (++$count % $maxCols == 0): ?>
</td><td align="top"><?php endif ?>

Looks like it's working okay, but this error message precedes it, which sorta kills the effect [;)] :
"Notice: Undefined variable: count in /home/web/public_html/interior.php on line 89"

Is there some place $count is supposed to be defined as a variable? If so, where and how, please?

Sorry about this second question du jour, but am closing in on what's turned out to be a more difficult goal with CMS Builder than I had anticipated. Looking good, at least up to the error message.

Many, many thanks for your help.
Happy Interactive Tools product user since 1999

Re: [matrix] php count

By Dave - March 8, 2008

Try adding a @ before the ++ like this:

<?php $maxCols=2;
if (@++$count % $maxCols == 0): ?>
</td><td align="top"><?php endif ?>


And that should fix it. In PHP putting the @ symbol in front of something means "don't show error messages for this". Another way would have been to define count at the top of your page like this: <?php $count = 0; ?> but I'd just use the @ as it keeps everything in one place and makes for less code to keep track of.

Hope that helps, any other questions just let me know. :)
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] php count

By matrix - March 8, 2008

Perfect! Works great.

Thank you so much.
Happy Interactive Tools product user since 1999