Jump to content

[SOLVED] PLease Help [PHP Seperate]


Monkuar

Recommended Posts

why am i gonna use

$max_cols = 5; // 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
    }
}

when it's alrdy the code calling files1 is my html for the gallery,

 

i only use

$max_cols = 5; // 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
    }
}

because i didn't want to mess with files1 beinig called omg im so freakn confused and mad wow

Link to comment
Share on other sites

OK w/e I did your way and I still got a list of gallery blocks only on the left hand side, i'm not even using files1 function because u told me to use

$max_cols = 5; // 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
    }
}

wtich just uses it

Link to comment
Share on other sites

Your code is a mess why would you have:

 

echo "<table width=\100%\>

</tr>

 

Your closing a table row which hasn't been opened?

 

and it should be

<table width=\"100%\">

 

Remember we use the backslash to escape the " character so it doesn't close the echo statement.

 

Is this script on your localhost or can I visit it online.

Link to comment
Share on other sites

Your code is a mess why would you have:

 

echo "<table width=\100%\>

</tr>

 

Your closing a table row which hasn't been opened?

 

and it should be

<table width=\"100%\">

 

Remember we use the backslash to escape the " character so it doesn't close the echo statement.

 

Is this script on your localhost or can I visit it online.

http://forums.24-7gt.com/index.php?dlcategory=4

 

 

lol

 

You got a mic? msn or aim so we can talk and i'll giv u ftp man please.

 

I'll tell u what line and stuff sir plz..

Link to comment
Share on other sites

Calm :D... This won't be the last time confusing php code will make you want to throw your monitor through the nearest window before running down after it to make sure its definately finished...

 

Although now I'm totally confused, what are you calling where? All I'm trying to do, however you wish to do it, is to add a line break when the column number is the last one you want in a row. The code you have shown is closing the row with a </tr> before it gets to the if statement? Can you post an unedited best version of the code you got working, and we'll take it from there?

Link to comment
Share on other sites

I'm shivering and shaking right now.. i've been working on this for 23hours now i cant even get a 3rd row a BREAK TAG, LOL it's because this code is so old from 2002 and 2000 lines of code in this single  downloads.php thing for my forum..

 

 

 

Give you FTP all i can do im sick of explaning this is the best I can explain for you.

 

 

 

 

 

This code is in my sources/downloads.php

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

                $row['date'] = date("D, M j Y g:i a",$row['date']);
		  	if ($row['updated']){
				$row['updated'] = date("D, M j Y g:i a",$row['updated']);
		  	} else {
				$row['updated'] = $ibforums->lang['never_updated'];
		  	}
			if($row['author'] == $row['poster']) {
				$row['author'] = "<a href='{$ibforums->base_url}showuser={$row['mid']}'>{$row['author']}</a>";
			} else {
				$row['author'] = $row['author'];
			}
			if($row['rating'] == 0){
				$row['rating'] = $ibforums->lang['not_rated'];
			} else {
				$row['rating'] = $this->return_rate($row);
			}
		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);

Then $this->output .= $this->html->files1($row); is run and that code is:

 

 

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

Witch is in skin/1/skin_downloads.php

Witch is HTML Enabled, the other code u gave me, I Was putting that in above the previous code that's why i needed backslashes, but this 1 is html enabled but I dont think I can loop html functions??!! LMAO!!

 

 

 

And now im stuck and I Feel bad bcz u guys tryed to help.. OMGggggggggg I'm doing the best I can i french srry 4 english but u guys must understand, i have to get this done my forum is my life.. i learn php and love ittt

Link to comment
Share on other sites

Are they showing at the 33% width now correct?

 

Now they are all showing underneath each other you want them side by side right?

 

Well at the end you are closing the table row:

 

</tr>

 

don't do this and see what happens

Link to comment
Share on other sites

Are they showing at the 33% width now correct?

 

Now they are all showing underneath each other you want them side by side right?

 

Well at the end you are closing the table row:

 

</tr>

 

don't do this and see what happens

 

I tryed guess and check on all tags..

http://forums.24-7gt.com/index.php?dlcategory=4

 

i removed </tr>'s still nothing happen ~

 

Yea side by side then break every 3rd 1 :DDDd

Link to comment
Share on other sites

Don't worry we will sort it, now we have the link.

 

OK firstly can you please change

<td width=33%>

to:

<td width="33%">

 

and leave it that way :)

 

<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></table>
</fieldset>

 

it's html code function the ' 's even matter?!?!

 

anyway i've done that, now what? :D

Link to comment
Share on other sites

Yes, I agree with JJ2K, there are quite a few bad HTML tags in there which if you're confused, will baffle a users browser trying to display it!

 

Try these:

 

downloads.php

$max_cols = 3;
$col_num = 0;
$this->output .= '<table>'; // THERE IS NO OPENING TABLE TAG, SO ADDING THIS SHOULD FIX THAT
while($row = $DB->fetch_row($findscript)) {
    $col_num++;
    $row['date'] = date("D, M j Y g:i a",$row['date']);

    if ($row['updated']) {
        $row['updated'] = date("D, M j Y g:i a",$row['updated']);
    } else {
        $row['updated'] = $ibforums->lang['never_updated'];
    }

    if ($row['author'] == $row['poster']) {
        $row['author'] = "<a href='{$ibforums->base_url}showuser={$row['mid']}'>{$row['author']}</a>";
    } else {
        $row['author'] = $row['author'];
    }

    if ($row['rating'] == 0) {
        $row['rating'] = $ibforums->lang['not_rated'];
    } else {
        $row['rating'] = $this->return_rate($row);
    }

    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); // <<< WHAT IS THIS FUNCTION? IS THIS A TYPO?
        } 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);
    }

    if ($col_num == $max_cols) {
        $this->output .= '</tr><tr>';
        $col_num = 0;
    }
}
$this->output .= '</table>'; // THERE IS NO CLOSING TAG, ADDING THIS SHOULD FIX THAT.

 

and clean up the HTML in skin/1/skin_downloads.php to:

 

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>
EOF;
}

Link to comment
Share on other sites

LOL IT WORKED

 

AHAHAH!______________~_~_~_~_~

HOLY MUNCHKINS OF VAGINA!!!!!!!!!!!

 

I LOVE YOU DOG GOT PAYPAL I SEND $ QUICK GOGOGOG

 

 

 

Dood i am shivering with  anervous breakdown right now, omg i appreciate all you guys help man Ilove you... Holy crap i am pissing my pants, holy crap.. my fingers shivvering, now what if i want more then 3 rows down? say about 7 rows down but still 3 across? omg i am so nervous thxxxxx cant type...11 omggg

Link to comment
Share on other sites

I'm an open source kinda guy so if you wanna pay me back, just pass it on, just as I do. Of course, I don't claim to speak for others who helped you.

 

That code should just cap it to the number of columns you set as $max_cols. The number of rows should be affected by how many results you have. If you have 30 results, you'll have 10 rows of 3, if you have 9 results, 3 rows of 3 etc.

 

Just enjoy this moment of problem solved...

 

Edit: Oh... And mark the topic solved if you're happy with the solution :)

Link to comment
Share on other sites

I'm an open source kinda guy so if you wanna pay me back, just pass it on, just as I do. Of course, I don't claim to speak for others who helped you.

 

That code should just cap it to the number of columns you set as $max_cols. The number of rows should be affected by how many results you have. If you have 30 results, you'll have 10 rows of 3, if you have 9 results, 3 rows of 3 etc.

 

Just enjoy this moment of problem solved...

 

thanks, bro i sent u a PM My head is still shaking dood your a god..

 

god bless u and go to heaven man your awesome thank u.. so much omg ima cryy

Link to comment
Share on other sites

lol think you need to release that energy and go for a jog or something :)

 

As for other tips you might want to check some of your document errors:

 

http://validator.w3.org/check?uri=http%3A%2F%2Fforums.24-7gt.com%2Findex.php%3Fdlcategory%3D4&charset=(detect+automatically)&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.654

 

cause you might find things looking different in different browsers, you might not but if you do you know some of the things which could be causing the problem.

Link to comment
Share on other sites

lol think you need to release that energy and go for a jog or something :)

 

As for other tips you might want to check some of your document errors:

 

http://validator.w3.org/check?uri=http%3A%2F%2Fforums.24-7gt.com%2Findex.php%3Fdlcategory%3D4&charset=(detect+automatically)&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.654

 

cause you might find things looking different in different browsers, you might not but if you do you know some of the things which could be causing the problem.

 

It's ipb 1.3, lol

 

from 2003 not worried but thanks for that i never knew about that link bro ima check hella stuff now, :D

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.