Jump to content

[SOLVED] PLease Help [PHP Seperate]


Monkuar

Recommended Posts

Ok look on my Photo Gallery :):

 

24l3cp2.png

 

I want it to go over 3 rows then do a break tag. Like this:

 

2e6bq7o.png

 

 

Like that, i'm going to show u  some code think u can help me? I would really appreciate it :P

 

Been up since 1:00am figuring it out can't.. :(

 

 

 

This code is the html for it

<table width=100%>
</tr><tr valign=top><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>

 

 

this is the PHP that spit's it out: [i think?]

 

 

 

if($ibforums->input['cat'] != 'all'){
			$row['cat_extra'] = "";		
			if($ibforums->vars['d_dis_screen_cat'] == "1" || ($ibforums->vars['d_dis_screen_cat'] == "2" && $row['dis_screen_cat'] == "1")){
				$row['screen_extra'] = "1";
				$row['screenshot'] = $this->screenshot($row);
				$this->output .= $this->html->files($row);
			} elseif ($ibforums->vars['d_dis_screen_cat'] == "0" || ($ibforums->vars['d_dis_screen_cat'] == "2" && $row['dis_screen_cat'] == "0")) {
				$row['screenshot'] = "";
				$this->output .= $this->html->files1($row);
			}
		} else {
			$row['cat_extra'] = "<br />(".$row['cname'].")";			
			$row['screenshot'] = "";
			$this->output .= $this->html->files1($row);

 

 

 

Thanks! Please respond!

 

 

 

Link to comment
Share on other sites

I'd have to see the HTML from the Source Code, but basically what the concept would be is something like:

 

HTML Code:

<div id="boxWrap">
<div class="box">Image Info Image</div>
<div class="box">Image Info Image</div>
<div class="box">Image Info Image</div>
<div class="box">Image Info Image</div>
<div class="box">Image Info Image</div>
</div>

 

With the CSS:

#boxWrap { width: 750px; }
.box { float:left; width: 250px; }

 

So boxWrap would have a width of 3 x the amount of each individual box.

Obviously you'd need to modify it to the widths of your site.

Link to comment
Share on other sites

My Html is pretty much this:

<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>

 

:)

Link to comment
Share on other sites

 

ok here is the source code:

 

 

<td width=33%><fieldset><legend>
Ugly
</legend>
<div class="p3">

 Added on Wed, Jun 3 2009 12:33 am by <a href='http://forums.24-7gt.com/index.php?showuser=8'>Aksel</a></a>
</div>
<table class="ftb">
<tr><td nowrap class="ce desc">

Public<br>

Views: 8<br><br>
Rank: <i>Not Rated</i><br><br>

Comments: 0<br><br>
</td>
<td class="lc ib"><span class='linkthru'><a href="index.php?download=181"><img src='http://s.bebo.com/app-image/7926675159/5411656627/PROFILE/i.quizzaz.com/img/q/u/08/04/13/99e6nn.jpg' border='0' align='center' width='100' height='100' /></a></span>
<br>

</fieldset>
</td>
</td></tr></table>
</fieldset><td width=33%><fieldset><legend>
Puppy

</legend>
<div class="p3">

 Added on Wed, Jun 3 2009 12:29 am by <a href='http://forums.24-7gt.com/index.php?showuser=8'>Aksel</a></a>
</div>
<table class="ftb">
<tr><td nowrap class="ce desc">

Public<br>
Views: 13<br><br>
Rank: <i>Not Rated</i><br><br>

Comments: 0<br><br>
</td>
<td class="lc ib"><span class='linkthru'><a href="index.php?download=180"><img src='http://img.photobucket.com/albums/v319/Tiger_Boy1190/uglymofo.jpg' border='0' align='center' width='100' height='100' /></a></span>
<br>

</fieldset>
</td>
</td></tr></table>
</fieldset><td width=33%><fieldset><legend>
Red Circle
</legend>
<div class="p3">

 Added on Tue, May 19 2009 12:47 am by <a href='http://forums.24-7gt.com/index.php?showuser=678'>theaxle</a></a>

</div>
<table class="ftb">
<tr><td nowrap class="ce desc">

Public<br>
Views: 12<br><br>
Rank: <i>Not Rated</i><br><br>

Comments: 0<br><br>
</td>
<td class="lc ib"><span class='linkthru'><a href="index.php?download=176"><img src='http://i245.photobucket.com/albums/gg77/vwguy72/negrocircle.jpg' border='0' align='center' width='100' height='100' /></a></span>
<br>

</fieldset>
</td>
</td></tr></table>
</fieldset><td width=33%><fieldset><legend>
They don&#39;t move, it&#39;s not animated. But still. Crazy
</legend>
<div class="p3">

 Added on Fri, Jan 23 2009 3:00 pm by <a href='http://forums.24-7gt.com/index.php?showuser=306'>Yanik</a></a>
</div>
<table class="ftb">
<tr><td nowrap class="ce desc">

Public<br>
Views: 20<br><br>
Rank: <i>Not Rated</i><br><br>

Comments: 0<br><br>
</td>
<td class="lc ib"><span class='linkthru'><a href="index.php?download=165"><img src='http://f.imagehost.org/0589/Die_Kreise_drehen_sich_nicht.gif' border='0' align='center' width='100' height='100' /></a></span>
<br>

</fieldset>
</td>

</td></tr></table>
</fieldset><td width=33%><fieldset><legend>
by rat
</legend>
<div class="p3">

 Added on Wed, Dec 17 2008 5:39 am by <a href='http://forums.24-7gt.com/index.php?showuser=181'>Steve</a></a>
</div>
<table class="ftb">
<tr><td nowrap class="ce desc">

Public<br>
Views: 21<br><br>

Rank: <i>Not Rated</i><br><br>

Comments: 0<br><br>
</td>
<td class="lc ib"><span class='linkthru'><a href="index.php?download=105"><img src='http://i456.photobucket.com/albums/qq287/legendoflinkd2jsp3/12.gif' border='0' align='center' width='100' height='100' /></a></span>
<br>

</fieldset>
</td>
</td></tr></table>
</fieldset><td width=33%><fieldset><legend>
wtf...
</legend>
<div class="p3">

 Added on Wed, Dec 17 2008 5:38 am by <a href='http://forums.24-7gt.com/index.php?showuser=181'>Steve</a></a>
</div>
<table class="ftb">
<tr><td nowrap class="ce desc">

Public<br>
Views: 14<br><br>
Rank: <i>Not Rated</i><br><br>

Comments: 0<br><br>

</td>
<td class="lc ib"><span class='linkthru'><a href="index.php?download=104"><img src='http://i456.photobucket.com/albums/qq287/legendoflinkd2jsp3/11.gif' border='0' align='center' width='100' height='100' /></a></span>
<br>

</fieldset>
</td>
</td></tr></table>
</fieldset><td width=33%><fieldset><legend>
jezuz fucking chris...
</legend>
<div class="p3">

 Added on Wed, Dec 17 2008 3:50 am by <a href='http://forums.24-7gt.com/index.php?showuser=181'>Steve</a></a>
</div>
<table class="ftb">

<tr><td nowrap class="ce desc">

Public<br>
Views: 16<br><br>
Rank: <i>Not Rated</i><br><br>

Comments: 0<br><br>
</td>
<td class="lc ib"><span class='linkthru'><a href="index.php?download=50"><img src='http://i67.photobucket.com/albums/h320/skronkykong/funny/bigjellyfish.jpg' border='0' align='center' width='100' height='100' /></a></span>
<br>

</fieldset>

</td>
</td></tr></table>
</fieldset><td width=33%><fieldset><legend>
oh my... god
</legend>
<div class="p3">

 Added on Wed, Dec 17 2008 3:49 am by <a href='http://forums.24-7gt.com/index.php?showuser=181'>Steve</a></a>
</div>
<table class="ftb">
<tr><td nowrap class="ce desc">

Public<br>
Views: 15<br><br>

Rank: <img src='style_images//pip.gif' alt='File Rated' /><img src='style_images//pip.gif' alt='File Rated' /><br><br>

Comments: 0<br><br>
</td>
<td class="lc ib"><span class='linkthru'><a href="index.php?download=49"><img src='http://www.sbnature.org/collections/bluewhale/images/2567.jpg' border='0' align='center' width='100' height='100' /></a></span>
<br>

</fieldset>
</td>
</td></tr></table>
</fieldset><td width=33%><fieldset><legend>
oh my...
</legend>
<div class="p3">

 Added on Wed, Dec 17 2008 3:48 am by <a href='http://forums.24-7gt.com/index.php?showuser=181'>Steve</a></a>
</div>
<table class="ftb">
<tr><td nowrap class="ce desc">

Public<br>
Views: 16<br><br>
Rank: <i>Not Rated</i><br><br>

Comments: 0<br><br>

</td>
<td class="lc ib"><span class='linkthru'><a href="index.php?download=48"><img src='http://i72.photobucket.com/albums/i189/diaBoy/pigzilla.jpg' border='0' align='center' width='100' height='100' /></a></span>
<br>

</fieldset>
</td>
</td></tr></table>
</fieldset>

lol

Link to comment
Share on other sites

What do you have in your CSS for

 

.ftb

 

and

 

.p3

 

or just post the CSS

 

CSS:

#logo {
background-image: url(banner.png);
background-repeat: no-repeat;
height: 75px;
}
form { display:inline }
img { vertical-align:middle; border:0 }
TABLE, TR, TD, BODY, SELECT, BUTTON, TEXTAREA { font-family: Tahoma; font-size: 11px; color:#0084FF }
TEXTAREA { background-color: #212121; color:#0084FF; border-color:#CECECA; }
BODY { background:#212121; margin:10px }
SELECT {background-color:#212121; }
INPUT { background-color:#212121; font-family: Tahoma; font-size: 11px; color:#0084FF; border-color:#CECECA; }

a { text-decoration:underline; color:#CECECA }
a:hover { color:#A4D3FF; text-decoration:underline }

.lM, .lB { position:absolute; left:24px; top:12px; color:#CECECA; }
.lB { left:25px; top:13px; color:#212121; font:20px }
.lD a, .lD a:hover { text-decoration:none; color:#A4D3FF; font:20px Tahoma }
.lS { font:10px; border-top:1px solid #CECECA; }
.lB .lS { border-top:1px solid #212121 }

.head { height:44px; border:1px solid #0084FF; background:#212121; padding:0; margin:0 }
.fL { float:left }
.fR,.barR,.lL { float:right }
.lL { margin:6px 5px }
.lL img { position:absolute; margin-top:2px }
.lL a { margin-left:15px }

.bar, .news { border:1px solid #0084FF; background:#444849; font:11px }
.news { margin-top:5px }
.bar { padding:5px; margin-bottom:10px }
.bar a { padding:0 4px; text-decoration:none }
.bar a:hover { text-decoration:underline }

.barL a { border-right:1px solid #0084FF }
.barR a { border-left:1px solid #0084FF }

.news { text-align:center; padding:5px }

fieldset, legend, .pager { border:1px solid #0084FF }
fieldset { margin:7px 0; padding:0 }
legend { font-weight:bold; padding:2px 10px; margin-left:10px; background:#212121; color: #CECECA; } /**/

* html legend { position:absolute; top:-.5em; left:.5em; margin-left:0 }
* html fieldset { position:relative; margin-top:1em; padding-top:.75em; margin-bottom:14px }

.desc, a.desc, .sig { font:10px }
.edit { font:10px; font-style: italic; color:#A4D3FF; font-size: 9px; } /**/

legend a { text-decoration: none; color: #CECECA } /**/
legend a:hover, a:hover.desc { text-decoration:underline; color:#A4D3FF }

fieldset.in { margin-left:auto; margin-right:auto }

.ftb, .ftbt { border-spacing:0; width:100%; border-collapse:collapse }
.ftb TD, .ftbt TD { border-top:1px solid #323232; background:#212121; padding:2px 3px }
.ftb TD { border-right:1px solid #323232 }
TD.lc { border-right:0 }
.bc1, .bc1 TD, TD.bc1 { background:#212121; }
.foot { padding:5px }
.bts, .bts TD, .foot {border-top:1px solid #0084FF }

fieldset, .ftb TH, .ftbt TH, .foot, .pager { background:#323232 }

.pager { display:inline; padding:2px 4px }
.pager b, .pager a { margin-left:1px; padding:0 2px; background:#212121 }

.crt { text-align:center; font:9px }

.mpl { background:#212121; padding:1px; border:1px solid #0084FF }
.mpl { font:10px; margin-right:1px }
.mpll { background: #323232; }
.mpl a { text-decoration: none; }

.links a { padding:0 5px; border-left:1px solid #0084FF }

.quote1, .quote2 { margin-left:8px; padding:1px 4px; border-left:2px solid #0084FF; border-right:1px solid #0084FF }
.code2 { margin-left:8px; padding:1px 4px; border-left:2px solid #0084FF; border-right:1px solid #0084FF }
.quote1 { font-weight:bold; margin-top:1px; background:#323232; border-top:1px solid #345487 }
.quote2 { margin-bottom:1px; border-bottom:1px dotted #0084FF }
.code2 { margin-bottom:1px; border-bottom:1px solid #0084FF }
.code2 { font-family: Courier New, Courier }

.sig { color:#FFF; border-top:1px solid #0084FF; padding-top:2px; margin-top:4px }

.editor a { float: left; background:#323232; text-decoration:underline; width:21px; height:21px; text-align:center; border:1px solid #C8CBC5; display:block; margin:1px }
.editor a:hover { border:1px solid #0084FF; }

.hs { margin-left:6px }

.p9{padding:9px}
.p3{padding:3px}
.ce { text-align:center }
.c { clear:both }

.st { color:#A4D3FF }
.re { color:#FFF }
.se { color:#0084FF }
.gr { color:#31F664 }
.ta { color:#F00 }

.ab input, .ab a, a.ab { white-space:nowrap; text-decoration:none; text-align:center; color:#CECECA; background:#323232; margin:1px; border:1px outset; border-color:#0084FF; }
.ab a:hover, a:hover.ab, .ab input:hover { color:#A4D3FF }
.ab a, a.ab { width:1px; padding:1px 10px }
.bR, a.bR, input.bR { background:#C41919 }

.ib img { border:1px solid #C2CFDF }

.e1,.e2,.e3,.e4,.e5{width:0;height:0;line-height:0}
.e1 { border-top:5px solid #A4D3FF; border-right:7px solid #0084FF; border-bottom:5px solid #A4D3FF; border-left:7px solid #0084FF } /**/
.e2 { border-top:5px solid #CECECA; border-right:7px solid #97AFC5; border-bottom:5px solid #CECECA; border-left:7px solid #97AFC5 } /**/
.e3 { border-top:5px solid #FFAE7F; border-right:7px solid #CF8E5F; border-bottom:5px solid #FF9E6F; border-left:7px solid #CF8E5F }
.e4 { border-top:5px solid #FFDEAF; border-right:7px solid #CFBE8F; border-bottom:5px solid #FFCE9F; border-left:7px solid #CFBE8F }
.e5 { border-top:5px solid #F55; border-right:7px solid #C41919; border-bottom:5px solid #F55; border-left:7px solid #C41919 } /**/
.cl,.cl a,.cl td,.cl td a,.cl .desc{color:#999}






/* ######### Style for Drop Down Menu ######### */

.dropmenudiv{
position:absolute;
top: 0;



border: 1px solid #BBB; /*THEME CHANGE HERE*/
border-bottom-width: 0;
font:normal 12px Verdana;
line-height:18px;
z-index:100;
background-color: white;
width: 200px;
visibility: hidden;
filter: progid:DXImageTransform.Microsoft.Shadow(color=#CACACA,direction=135,strength=4); /*Add Shadow in IE. Remove if desired*/
}


.dropmenudiv a{
width: auto;
display: block;
text-indent: 3px;
border-bottom: 1px solid #BBB; /*THEME CHANGE HERE*/
padding: 2px 0;
text-decoration: none;
font-weight: bold;
color: black;
}



.dropmenudiv a:hover{ /*THEME CHANGE HERE*/
background-color: #D4E0FF;
}







 

ima try ur code over pm waitt

Link to comment
Share on other sites

Add this to the very bottom of your CSS file:

 

.ftb { width: 33%; float:left; }

 

and then in your HTML change:

<div class="p3">

 Added on {$info['date']} by {$info['author']}</a>
</div>

 

to:

 

<td width="100%">
 Added on {$info['date']} by {$info['author']}</a>
</td>

 

and move it directly below the line

 

<table class="ftb">

Link to comment
Share on other sites

that just moved everything to the left

 

 

this is the code im using:

 

while($row = $DB->fetch_row($findscript))  {
    $column++; // Increment to the correct column number

    echo "<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>";

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

 

that nice guy gave it to me over pm but it still just shows normal rows going up and down.. :(

Link to comment
Share on other sites

is this inside an overall table

 

cause your code starts off with

<td width=33%>

 

i'm assumng theres a table opened before this that i cant see?

 

Also shouldn't it be

 

<td width="33%"> With the speech marks? you'd need to escap them in your echo statement so it would be

 

 

<td width=\"33%\">

Link to comment
Share on other sites

K this is the code im using, and this is a screenshot on what happends..

 

:(

 

 

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

while($row = $DB->fetch_row($findscript))  {
    $column++; // Increment to the correct column number

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

<table class=\"ftb\">
<td width=\"100%\">
 Added on {$info['date']} by {$info['author']}</a>
</td>
<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>";

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

I did your edits to put it below the <table class=ftb> doesnt help.

 

Screenshot:

 

15qw5xc.png

Link to comment
Share on other sites

k3ohhx.png

 

OK am I GETTING CLOSE? I Did this to the code:

 

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

 

on the top part, now i just need these to go every other 3.. omg

Link to comment
Share on other sites

Hi monkuar,

 

What is the template system you're using? There might be an option already to set this. Also, when you echo something you can either use:

 

a) single quotations e.g. echo 'Hello world!';

b) double quotations e.g. echo "Hello world!";

 

The difference between them is that double quotes allow you to put variables in to get parsed. I won't go too much in detail as it's not relevant, I just want to point out that if your opening/closing quotes are double, you must ESCAPE (put a backslash in front of) any other double quotes you use inside them, otherwise, PHP will stop when it gets to the next quote. That's the point that JJ2K was trying to make regarding your width attribute of the td tag.

 

<td width="33%"> is valid, however if this is INSIDE an echo...

 

echo "<td width="33%">"; then only "<td width=" will be displayed, and then PHP will throw a hissy fit because it doesn't know what to do with 33%. Some call it a parse or syntax error.

 

So to avoid this, any double quotes that are INSIDE your echo quotes need to be escaped, nothing scary, just put a backslash in front. So this:

 

echo "<td width=\"33%\">";

 

works...

 

The system you are using, is going to parse that HTML file for each box you want to create, so simply putting that code inside the HTML file won't do much (I'm assuming this is what you're doing).

 

My suggestion would be to go back and try and get them all to line up next to each other in one big line, and then use the if ($column == $max_cols) code to force a new line, either using tables '</tr><tr>' will create a new row, or using CSS to add style="clear:both;" as an attribute to the whole box.

Link to comment
Share on other sites

OK i'll try to get them lined up.. I'm so lost, lala.. :) THanks for all your help.. Maybe i can giv u ftp access and u can do some quick work for me, up to you?

 

Anyways i'll get to it.. try to post anything u can for me while im working, thank u.

Link to comment
Share on other sites

The is called function files1 witch my main php spits this out to show the gallery,

 

function files1($info) {
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>
</td></tr></table>


EOF;
}

 

 

 

this code

while($row = $DB->fetch_row($findscript)) {
bla bla bal



$this->output .= $this->html->files1($row);

 

spit's it out so that's a problem

 

We could fix it here right ?

Link to comment
Share on other sites

Again on the posted code below you have:

<td width=33%>

which should be

<td width="33%">

 

the same with your image attributes/class names you have a single quote around some of them but they should be double quotes.

Link to comment
Share on other sites

it's in a html allowed function on that, lol

 

 

function files1($info) {
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>
</td></tr></table>
EOF;
}

 

I can put any html i want and it'll work my whole forum is based of these functions.. it's just that it spit's this out for my gallery images but I cant php in that html enabled section so... makes it so harddddd

Link to comment
Share on other sites

right ok, i think i know what happening...

 

Before the while statement, add the following:

 

$max_cols = 3;
$col_num = 0;
while ($row = $DB->fetch_row($findscript)) {
  $col_num++

 

Then where your $this->output line is, change it to this:

$this->output .= $this->html->files1($row);
if ($col_num == $max_cols) {
  $this->output .= '</tr><tr>';
  $col_num = 0;
}

 

How does that help?

Link to comment
Share on other sites

my while statement is

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

while($row = $DB->fetch_row($findscript))  {
    $column++; // Increment to the correct column number

 

???

 

im lost ?

 

 

so i have to put

$max_cols = 3;
$col_num = 0;
while ($row = $DB->fetch_row($findscript)) {
  $col_num++

before while statement? then it will error me,

Link to comment
Share on other sites

Sorry, my bad, too many things at once... Just replace like for like. I changed the name of $column to $col_num because I forgot I'd already called it $column. Either way, as long as its all consistent, it doesn't matter what its called. if you already have that code around your while statement, change the code around output to be:

 

$this->output .= $this->html->files1($row);
if ($column == $max_cols) {
  $this->output .= '</tr><tr>';
  $column = 0;
}

 

And just tidy it up as if this is the only code I've given you, so you don't have the if ($column == $max_cols) twice

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.