1

Topic: question about no wrap in html enclosed in php

Hello all,

So, i'm still working at the layout of my future punbb forum.
I will use alexis.org mod active topics mod (mixed with shuttertalk revision for the direct access to new topic I found usefull) and I need some help to adapt the script to my design : what I want is easy to understand : all in ONE line (i.e. : topic [go to new] by poster at that date with no wrap).
All is working but impossible to get a solution to avoid annoying wraping in this mix of php and html.

(you can see the trouble here : http://www.languefrancaise.net/punbb/index.php)

Here is my sadly adaptated code wink :

<?php
while ($ak_post = $db->fetch_assoc($ak_latest)) {$subject_new_posts = '[ <a href="viewtopic.php?id='.$ak_post['id'].'&action=new" title="'.$lang_common['New posts info'].'">'.$lang_common['New posts'].'</a> ]';?>

<div id="navcontainer">
<ul id="navlist">
<li id="active"><b><a href="viewtopic.php?id=<?php echo $ak_post['id'] ?>"><?php echo pun_htmlspecialchars($ak_post['subject']) ?></a></b><?php echo $subject_new_posts; ?> dernier message posté par <?php echo pun_htmlspecialchars($ak_post['last_poster']) ?> (<?php echo format_time($ak_post['last_post']) ?>)
</li>
</ul>
</div> 

Thanks in advance,
abclf.

2 (edited by Paul 2004-10-30 19:52)

Re: question about no wrap in html enclosed in php

I will have a look at your source and see what the answer is (if any).

What I noticed immediatelly is that you are using id's for navcontainer and navlist. Id's must be unique i.e. you can only have one div with an id of navcontainer per page. The same goes for #active.

[EDIT]
The reason for the wrapping is #navlist A {display: block}. By setting display block you are telling each <a> to start on a new line.

3

Re: question about no wrap in html enclosed in php

Hello Paul and thanks for replying ; )

fine : I understand at least why this code worked (the </a> was at the last end)

<?php
while ($ak_post = $db->fetch_assoc($ak_latest)) {
?>

<div id="navcontainer">
<ul id="navlist">
<li id="active"><a href="viewtopic.php?id=<?php echo $ak_post['id'] ?>"><?php echo pun_htmlspecialchars($ak_post['subject']) ?> dernier message posté par <?php echo pun_htmlspecialchars($ak_post['last_poster']) ?> (<?php echo format_time($ak_post['last_post']) ?>)</a>
</li>
</ul>
</div> 

But, nevertheless, it's an error to get more than one div with the same id ? and I have to find another way to list the active post, isn't it ?
So, I will try do something less more chaotic.

abclf.

4

Re: question about no wrap in html enclosed in php

What you need is to put <div><ul> before the start of the loop and </ul></div> after the end of loop instead of inside the loop. The loop should only generate <li>blah blah</li>. Does that make sense?

5

Re: question about no wrap in html enclosed in php

Yes Paul, many thanks : I have done some modifications to get nicer html (not too hard in my case wink ).
I'm still testing but it's already fine (for me).

Great help ; bye.
abclf.