Jump to content

Recommended Posts

Ok I grabbed all info exactly from my Database!

$color_one = "<td width=33%><fieldset><legend>
{$row['sname']}
</legend>
<div class=\"p3\">

 Added on {$row['date']} by {$row['author']}</a>
</div>
<table class=\"ftb\">
<tr><td nowrap class=\"ce desc\">

Public<br>
Views: {$row['views']}<br><br>
Rank: {$row['rating']}<br><br>

Comments: 0<br><br>
</td>
<td class=\"lc ib\"><span class='linkthru'><a href=\"index.php?download={$row['id']}\"><img src='{$row['screenshot1']}' border='0' align='center' width='100' height='100' /></a></span>
<br>

</td></tr></table>
</fieldset>
"; 
   $color_two = 'ce'; 
   static $i = 0;
   $color = ($i % 6) ? $color_one : $color_two;
   $i++;
				$this->output .= $color;

 

That currently display's exactly this,:

 

157gqa9.png

 

NOW I need it to span 3 rows across and do a break tag, like this:

33ehsbb.png

 

I've been trying to use some type of PHP Code that makes it like that, i'm using the 1 in my code as u see but it's not doing it.

 

Please please God.. thanks.. this is my 3rd thread and 20hours on this I cant figure it out, Thanks!

 

 

It has something to do with

";
   $color_two = 'ce';
   static $i = 0;
   $color = ($i % 6) ? $color_one : $color_two;
   $i++;
               $this->output .= $color;

With that [my above code I posted

The way I normally do it is by setting a variable outside the loop which is the number of columns you want. Then, if the current column == that variable, start new row. e.g:

 

$max_cols = 3; // This is the number of columns you want per row
$column    = 0; // This sets the counter at 0

while (something is true) {
    $column++; // Increment to the correct column number

    echo '<td>something here</td>'; // Your individual box

    if ($column == $max_cols) {
        echo '</tr><tr>'; // Start new row
        $column = 0; // Reset counter
    }
}

 

If you prefer to use divs and spans, just start a new div or whatever it is you want to do. If you need more explanation, let me know.

<table width=100%>
</tr><tr valign=top><td width=33%>
<td width=33%><fieldset><legend>
{$row['sname']}
</legend>
<div class=\"p3\">

 Added on {$row['date']} by {$row['author']}</a>
</div>
<table class=\"ftb\">
<tr><td nowrap class=\"ce desc\">

Public<br>
Views: {$row['views']}<br><br>
Rank: {$row['rating']}<br><br>

Comments: 0<br><br>
</td>
<td class=\"lc ib\"><span class='linkthru'><a href=\"index.php?download={$row['id']}\"><img src='{$row['screenshot1']}' border='0' align='center' width='100' height='100' /></a></span>
<br>
</td></tr></table>
</fieldset>
</td></tr>

That's my HTML. man im so lost on how to set everything up..

 

OMG PHP So confusing i love it tho..

 

Thanks for your idea.. :(

Right well you need to find the code that loads that HTML for each box. It also looks like your using a template system from all the {$row['something']}'s.

 

Depending upon which template system you're using, you may be able to set the number of columns per row using that. If you feel like delving into the dark side a little bit, find the loop in the php script which loads that html file and adjust it using the code I suggested.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.