PDA

View Full Version : basic php


Rikstr
08-14-2006, 06:30 AM
I have this fetchall php on my website front page:

<!-- RECENT -->
<?php if (isset($recent)) { ?>
<table width="100%" cellpadding="3" cellspacing="1" border="2" bordercolor="#00ccff" class="forumline">
<tr>
<td class="catHead" height="28"><B><FONT color=#ffc959><span class="cattitle"><?php echo $lang['Topics']; ?></span></FONT></B></td>
</tr>
<tr>
<td class="row1" align="left" width="100%">
<span class="gensmall">
<?php for ($i = 0; $i < count($recent); $i++) { ?>
<?php echo create_date($board_config['default_dateformat'], $recent[$i]['post_time'], $board_config['board_timezone']); ?> <a href="<?php echo append_sid($phpbb_root_path . 'profile.php?mode=viewprofile&amp;u=' . $recent[$i]['user_id']); ?>"><?php echo $recent[$i]['username']; ?></a><br /><img src="<?php echo $phpbb_root_path; ?>templates/subSilver/images/icon_latest_reply.gif" border="0" align="absmiddle" /> <a href="<?php echo append_sid($phpbb_root_path . 'viewtopic.php?p=' . $recent[$i]['post_id'] . '#' . $recent[$i]['post_id']); ?>"><b><?php echo $recent[$i]['topic_title']; ?><?php if ($recent[$i]['topic_trimmed']) { echo '...'; } ?></b></a><br />
<?php } ?>
</span>
</td>
</tr>
</table>
<br />
<?php } ?>
<!-- RECENT -->

It comes out looking quite messy, how can i put a blank line in between the topics?

Thanks,

Rikstr
my site where this is: www.kiwidirt.com

page1ink.
08-14-2006, 07:50 AM
use
print "\n\r";

be sure to use double quotes, or it won't work. you can use 'echo' in place of print, if you like.

and for the love, please put some whitespace in your code!

Rikstr
08-14-2006, 06:26 PM
Where do i insert that code?

What do you mean by putting whitespace in the code? do you mean space it out some? I got that code from the "fetchall portal".

Cheers,

Rik

page1ink.
08-14-2006, 06:47 PM
I'm not sure what fetchall is. this is what I meant by whitespace, yeah:

<!-- RECENT -->
<?php
if (isset($recent)) {
?>
<table width="100%" cellpadding="3" cellspacing="1" border="2" bordercolor="#00ccff" class="forumline">
<tr>
<td class="catHead" height="28"><B><FONT color=#ffc959><span class="cattitle"><?php echo $lang['Topics']; ?></span></FONT></B></td>
</tr>
<tr>
<td class="row1" align="left" width="100%">
<span class="gensmall">
<?php
for ($i = 0; $i < count($recent); $i++) {
echo create_date($board_config['default_dateformat'], $recent[$i]['post_time'], $board_config['board_timezone']);
?>
<a href="<?php echo append_sid($phpbb_root_path . 'profile.php?mode=viewprofile&amp;u=' . $recent[$i]['user_id']); ?>">
<?php echo $recent[$i]['username']; ?></a><br />
<img src="<?php echo $phpbb_root_path; ?>templates/subSilver/images/icon_latest_reply.gif" border="0" align="absmiddle" />
<a href="<?php echo append_sid($phpbb_root_path . 'viewtopic.php?p=' . $recent[$i]['post_id'] . '#' . $recent[$i]['post_id']); ?>">
<b>
<?php
echo $recent[$i]['topic_title'];
if ($recent[$i]['topic_trimmed']) {
echo '...';
}
?>
</b></a><br /><br />
<?php
}
?>
</span>
</td>
</tr>
</table>
<br />
<?php
}
?>
<!-- RECENT -->

although I think I misunderstood what you were asking earlier. there are two ways to do what you want to do: CSS and HTML. looking at your site it'd be easier to use HTML, so if you look at the code I posted above there is a <br /> in bold, that will create a line break. if you need more space than that, add another <br />.

hope that helps you!

Rikstr
08-15-2006, 03:00 AM
perfect, now i need to resize the font and change the font style to arial.

thanks alot,

Rik