Jump to content

static $i = 0;


Monkuar

Recommended Posts

$color_one = '</tr>'; 
   $color_two = '</td>'; 
   static $i = 0;
   $color = ($i % 2) ? $color_one : $color_two;
   $i++;

global $ibforums;
//caption is sname
return <<<EOF





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

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

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

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

 

How can I use:

$color_one = '</tr>'; 
   $color_two = '</td>'; 
   static $i = 0;
   $color = ($i % 2) ? $color_one : $color_two;
   $i++;

that Code to make  the above above code spit out 3 rows each then a break tag?

 

Thanks!

Link to comment
Share on other sites

Sir please please give me that information, Im using old old code from 2002 but I  enahcned with u guys best code around!! :

 

So it would be like this?

 

$color_one = '</tr>'; 
$color_two = '</br>';
   static $i = 0;
   $color = ($i % 3) ? $color_one : $color_two;
   $i++;

Link to comment
Share on other sites

Not entirely sure what you mean but somethin like this

for($i = 0; $i < howmnylinesyouwnt; $i++)
{
echo '<tr><td>table row</td></tr>';
if($i % 3 == 0)
{
echo '<br />';
}
}

Althouh why you want a line break outside a table cell doesn't mke sense to me. And I doubt it's valid html.

Link to comment
Share on other sites

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.