Jump to content

Need to find where to put BR tag in a WHILE loop result


randalusa

Recommended Posts

 

I am pasting in below what are hopefully all sets of related code, though figure the answer probably resides in the last part of this post. Look at the bottom. Then again, it could easily be elsewhere.

 

All I want is for the forum topics to have a little white space (lightcyan, actually) around topic titles. Currently, there is no space aside from the height of the font, plus I figure maybe 5 pixels. Just too busy appearing for a relaxing perusal of topics.

 

I dunno which of these image options will work on the forum here. I took a screenshot, then uploaded to photobucket. Have also listed the url as an image AND (lol) included the good ole url itself. Vamos a ver. Okay, I took the image tag around the url out.

 

forum.jpg

 

http://www.meetchristians.com/new/tr_fr_list_threads.php?F=2&r=0

 

Yeah, that works. Okay, anyway, where you can see in Post #2 (MARRIED ....... in 60 seconds) the camera gif, THAT heightens up the row a little. But the rows without a gif are all scrunched together. I am okay adding a full BR tag for the whole mess.

 

This is the tour view only. The logged in view is completely different, and has plenty of surrounding space already, for whatever reason. Perhaps I should take a peek at the code from the logged in view.

 

Because no modification has been added to the result set, I am having trouble figuring out where to add html changes. If there had been a little already, then it would be easy to put in a little more.

 

Anyone feel lke helping me figure this one out?

 

 

get_forum_info($F, $db, $tdy, $this_forum, $allow_post, $allow_replies, $topic);

if (($allow_post == "Y") || ($session_username == "Webmaster"))
	{
	$allow_post_tag = "<tr><td colspan=5 align=right>

<!--	<a href=sorry.php?r=$r>
	<font face=arial>Post a New $topic - >>></a>    -->

	<a href=sorry.php?r=$r>
	<img src=$icn_dir/newthread.gif border=0></a></td>
	</tr>";
	}

 

 

Then a bunch more code that probably pertains to pagination and a couple items before the forums begin (not pasted in here).

 

The next piece could be related

 

 

if (($F == "22") || ($F == "21"))
{

print "

<br><center><font face=arial size=3><b>Sorry, an error has occurred

";
exit;
}


if ($lim < 1)
{
$query = "SELECT count(author) 
	FROM fm_data 
	WHERE FID = '$F' 
	AND level = 1";

$result = mysql_db_query($db, $query);

(list($total) = mysql_fetch_row($result));
}
else
{
$total =$lim;
}

 

 

 

Or this one:

 

 

if ($last > 0)
{
$first_returns = ($last + 1);
$max_returns = ($last + $max_num_returns);
$num_max_returns = ($last + $max_num_returns);
$prev_first_returns = ($last - $max_num_returns);
}

$limit = ($max_returns + 1);


$query = "SELECT id, author, g, FID, level, subject, message, replies, views, photo1, photo2, DATE_FORMAT(orig_date, '%m-%e-%Y  %H:%i'), DATE_FORMAT(last_reply, '%m-%e-%Y </b>at<b> %H:%i'), new_thread_d, new_reply_d
	FROM fm_data WHERE FID = '$F' and level = 1
	ORDER BY last_reply DESC
	LIMIT $limit
	";

$result = mysql_db_query($db, $query);

 

 

 

Then the last part. It does show table formatting. Yet that is merely for the header, or the part that ends up acting as a header.

 

 

 

print "

<center>

   <TABLE cellSpacing=2 cellPadding=0 width= 725  border=0>
      <TBODY>
      <TR>
         <TD width= 100%  $F_T_B_bgc>

<table width=100% borderColor=#666666 borderColorLight=#BBBBBB border=1 cellspacing=0 cellpadding=2>

$allow_post_tag

<tr align=center bgcolor=mediumblue> <font face=arial size=2>	
          <td> <font face=tahoma,arial size=3><b> $F_T_HF_bgc $topic</td>
          <td> <font face=tahoma,arial size=3><b>$F_T_HF_bgc Author</td>
          <td> <font face=tahoma,arial size=3><b>$F_T_HF_bgc Replies</td>
          <td> <font face=tahoma,arial size=3><b>$F_T_HF_bgc Hits</td>
          <td> <font face=tahoma,arial size=3><b>$F_T_HF_bgc Last / View New</b>
</td></tr>

";


while (list($id, $author, $g, $FID, $level, $subject, $message, $replies, $views, $photo1, $photo2, $orig_date, $last_reply, $new_thread_d, $new_reply_d) = mysql_fetch_row($result))
 {

	$returns++;
	if ($returns < $first_returns)
		{
		$continue = "y";
		}
	else
		{

		if (($returns > $max_returns) || ($returns > $total))

			{

			table_footer();

 

Link to comment
Share on other sites

Your post was too spread out for me to help.

If you want a br tag in a while loop (based on your title question).

Then just add a

. '<br />';

at the end of whatever echo statement you already have.

The thing is I couldn't find an echo statement in the result set, or at least one that would pertain the the specific table in question. Sorry about the length of post. Just seemed to me that putting in all pertinent data save anyone from needing to ask for more information.

 

I will, however, go take another peek (do a search, actually) for echo statements on that page just in case one does offer a clue about where to insert my html.

Link to comment
Share on other sites

There individual rows of forum topics are too compressed. They need some <br> tags above and below to get some breathing room.

 

I dunno why so much of the code appears in red when using the [ code ] function here. Maybe indicates much of it is messed up? :-(

 

Here is the page:

 

 

<head><title>

Chrisian Forums discussion topics at MeetChristians.com

</title></head>



<?php

$icn_dir = "../icn";
$inc_dir ="./incl";
require "$inc_dir/gen_xxxxxx.inc.php";
require "$inc_dir/tr_fr_nav_bar.inc.php";
require "$inc_dir/xxxxx.inc.php";

#forum list background
$F_L_B_bgc = "bgcolor=#99FF99";
#forum list heading background
$F_L_H_bgc = "bgcolor=#006600";
#forum list heading font color
$F_L_HF_c = "<font color=#FFFFFF>";
#forum topic list heading background
$F_T_H_bgc = "bgcolor=#33a0cc";
#formum topic list heading font color
$F_T_HF_bgc = "<font color=#FFFF00>";
#forum topic list background
$F_T_B_bgc = "bgcolor=azure"; ##formerly #CCFFFF
#font used for topics listings
$font_1 = "<font face=arial size=2>";
#font used for forums listings
$font_2 = "<font face=arial size=2>";
#font used for forums descriptions
$font_3 = "</b></b>";


get_forum_info($F, $db, $tdy, $this_forum, $allow_post, $allow_replies, $topic);

if (($allow_post == "Y") || ($session_username == "Webmaster"))
	{
	$allow_post_tag = "<tr><td colspan=5 align=right>

<!--	<a href=sorry.php?r=$r>
	<font face=arial>Post a New $topic - >>></a>    -->

	<a href=sorry.php?r=$r>
	<img src=$icn_dir/newthread.gif border=0></a></td>
	</tr>";
	}

$forums_link = "<a href=tr_fr_disp_fms.php?r=$r class=donkey>Forums</a>";

print "

<center>


<!--

<table width=560 bgcolor=gainsboro borderColor=#666666 borderColorLight=#BBBBBB border=0 cellspacing=0 cellpadding=3>
   <tr>
      <td align=center>

<font face=arial size=2><font color=navy>

<b>Click on \"Thread\" title</b></font> <font color=blue>to view discussion inside. Note: Some features <br>and appearances available after logging in are unseen in this mode.<font color=black>

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

-->


";


print "


<table width=725>
   <tr>
      <td>

</center>

<font face=arial size=2><b><a href=tr_user_tools.php?r=$r class=donkey>$site_name2</a> / $forums_link  / $this_forum

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

";



if (($F == "22") || ($F == "21"))
{

print "

<br><center><font face=arial size=3><b>Sorry, an error has occurred

";
exit;
}


if ($lim < 1)
{
$query = "SELECT count(author) 
	FROM fm_data 
	WHERE FID = '$F' 
	AND level = 1";

$result = mysql_db_query($db, $query);

(list($total) = mysql_fetch_row($result));
}
else
{
$total =$lim;
}

$max_num_returns = 50;
$max_returns = $max_num_returns;
$num_max_returns = $max_num_returns;
$returns = 0;
$first_returns = 0;
$prev_first_returns = 0;



if ($last > 0)
{
$first_returns = ($last + 1);
$max_returns = ($last + $max_num_returns);
$num_max_returns = ($last + $max_num_returns);
$prev_first_returns = ($last - $max_num_returns);
}

$limit = ($max_returns + 1);


$query = "SELECT id, author, g, FID, level, subject, message, replies, views, photo1, photo2, DATE_FORMAT(orig_date, '%m-%e-%Y  %H:%i:%s'), DATE_FORMAT(last_reply, '%m-%e-%Y <br></b>at %H:%i:%s %p'), new_thread_d, new_reply_d
	FROM fm_data WHERE FID = '$F' and level = 1
	ORDER BY last_reply DESC
	LIMIT $limit
	";

$result = mysql_db_query($db, $query);






$previous_returns = "<b><a href=tr_fr_list_threads.php?r=$r&last=$prev_first_returns&$lim=$total&F=$F class=donkey><< Previous $max_num_returns</a>";

$next_returns = "<b><a href=tr_fr_list_threads.php?r=$r&last=$max_returns&lim=$total&F=$F class=donkey>Next $max_num_returns >></a>";

if ($first_returns < 2)
	{
	$previous_returns = "";
	}

if ($max_returns > $total)
	{
	$num_max_returns = $total;
	$next_returns = "";
	}


		print "

<center>

<br>

<b><font face=arial><font size=3><font color=#1E90FF> <!-- dodgerblue -->

There are</font> <font color=#ddffff>$total </font><font color=#1E90FF>threads in the <font color=yellow>$this_forum</font> forum</b> </center></font></font></font>

<br>


<table border=1 width=725 bordercolorlight=black>
   <tr>
      <td align=left width=20%><font face=arial size=2>$previous_returns</td>
<td align=center><font face=arial size=1 color=white>$first_returns - $num_max_returns $rows topics displayed
        </td>
<td align=right width=20%><font face=arial size=2>$next_returns
      </td>
   </tr>
</table>

";


print "

<center>

   <TABLE cellSpacing=2 cellPadding=0 width= 725  border=0>
      <TBODY>
      <TR>
         <TD width= 100%  $F_T_B_bgc>

<table width=100% borderColor=#666666 borderColorLight=#BBBBBB border=1 cellspacing=0 cellpadding=2>

$allow_post_tag

<tr align=center bgcolor=mediumblue> <font face=arial size=2>	
          <td> <font face=tahoma,arial size=3><b> $F_T_HF_bgc $topic</td>
          <td> <font face=tahoma,arial size=3><b>$F_T_HF_bgc Author</td>
          <td> <font face=tahoma,arial size=3><b>$F_T_HF_bgc Replies</td>
          <td> <font face=tahoma,arial size=3><b>$F_T_HF_bgc Hits</td>
          <td> <font face=tahoma,arial size=3><b>$F_T_HF_bgc Last / View New</b>
</td></tr>

";


while (list($id, $author, $g, $FID, $level, $subject, $message, $replies, $views, $photo1, $photo2, $orig_date, $last_reply, $new_thread_d, $new_reply_d) = mysql_fetch_row($result))
 {

	$returns++;
	if ($returns < $first_returns)
		{
		$continue = "y";
		}
	else
		{

		if (($returns > $max_returns) || ($returns > $total))

			{

			table_footer();


			print "


<table border=1 width=725 bordercolorlight=black>
   <tr>
      <td align=left><font face=arial size=2>$previous_returns

      </td>

      <td align=right><font face=arial size=2>$next_returns

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


			";

			print "
			<center><font face=arial size=2>
			<a href=sorry.php?r=$r class=donkey2>Add/Edit my Forum Signature</a><br>
			<a href=sorry.php?r=$r class=donkey>Search the Member Forums</a><br>
			</center><br>
			";


			page_footer();
			exit;
			}

		$new1 = "";
		$new2 = "";
		$new3 = "";
		$new4 = "";
		if ($my_L_visit < $new_thread_d)
			{
			$new1 = "<img src=$icn_dir/new2.gif>";
			$new3 = "<a href=tr_fr_view_thread.php?TID=$id&r=$r&F=$F&VN=Y>";
			$new4 = "</a>";
			}
		if ($my_L_visit < $new_reply_d)
			{
			$new2 = "<img src=$icn_dir/new2.gif>";
			$new3 = "<a href=tr_fr_view_thread.php?TID=$id&r=$r&F=$F&VN=Y>";
			$new4 = "</a>";
			}



		$photo_icn = "";
		if (($photo1 != "") || ($photo2 != ""))
			{
			$photo_icn = "  <img src=$icn_dir/camera.gif height=20>";
			}

		print "
			<tr $F_T_B_bgc>	<td> $font_1
			<a href=tr_fr_view_thread.php?TID=$id&r=$r&F=$F><b>$subject </a>  $new1</b><br>
			</td><td align=center>$font_1$author $photo_icn</td>
			</td><td align=center>$font_1$replies $new2</td>
			</td><td align=center>$font_1$views</td>
			</td><td align=center>$font_1$new3$last_reply$new4</td></tr>";
		}
}


table_footer();

print "
<center><font face=arial size=2>
<a href=sorry.php?r=$r class=donkey2>Add/Edit my Forum Signature</a><br>
<a href=sorry.php?r=$r class=donkey>Search the POST IT Forums</a><br>
</center><br>

<IMG SRC=http://www.MeetChristians.com/cgi-bin/stats/tour/makelog.cgi?NEW=Tour08=List=Threads,http://www.MeetChristians.com/php/login.php,Webmaster BORDER=0>

";

exit;


?>

Link to comment
Share on other sites

Gah.  Using tags as filler to create whitespace is like going back in time.  IMO you should take the time to research CSS and use that instead.

 

w3schools has some useful information.

Yeah, I agree, and have been peeking at CSS lately. Even then, I will need to find the place for inserting the breaks.

 

Having said that, I just noticed that SOME table info is wayyyyyyyy down at the bottom of the page. What I had been doing is this: Seeing various things that are placed on the page under the table, and noticing the end of the page was very near, I stopped looking. Only just now, it appears there is a table code hanging out right before the file page ends. So I will experiment around with that for a while.

 

BTW, html tags are very cool, still much easier to use, for just tossing a thing in here and there, no? Then again, I guess the style=font:verdana type of construct is kind of a wash when compared to the quick-spin 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.