Topic: altering the recent topics include

Hi

so I am including a 10 most recent topics box on my homepage....here is the code:

<?php
include('http://www.mysite.com/forum/extern.php?action=active');
?>

I altered the extern.php file so it returns 10 posts instead of the default 15.

What is annoying me is the way the topic titles text wrap so if the topic is a certain length the line takes up 2 lines...most of the time it only takes up one line with three '...' but sometimes the text wraps instead.....is there a way of altering extern.php to prevent this.

Here is the section of extern.php in question:

    // Output regular HTML
    else
    {
        $show = isset($_GET['show']) ? intval($_GET['show']) : 10;
        if ($show < 1 || $show > 50)
            $show = 10;

        // Fetch $show topics
        $result = $db->query('SELECT t.id, t.subject FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL'.$forum_sql.' ORDER BY '.$order_by.' DESC LIMIT '.$show) or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());

        while ($cur_topic = $db->fetch_assoc($result))
        {
            if ($pun_config['o_censoring'] == '1')
                $cur_topic['subject'] = censor_words($cur_topic['subject']);

            if (pun_strlen($cur_topic['subject']) > $max_subject_length)
                $subject_truncated = pun_htmlspecialchars(trim(substr($cur_topic['subject'], 0, ($max_subject_length-1)))).' …';
            else
                $subject_truncated = pun_htmlspecialchars($cur_topic['subject']);

            echo '<li><a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'&action=new" title="'.pun_htmlspecialchars($cur_topic['subject']).'">'.$subject_truncated.'</a></li>'."\n";
        }
    }

I have tried playing with the max_subject_length but it does not stop the text wrapping.

Help would be great

thanks

Nick

Punbb w/coppermine and wordpress integrated

see my hack to integrate punbb with wordpress comment system.
Illustration Community

2

Re: altering the recent topics include

You can specify on the extern call how many you want to see like so:

<?php
include('http://www.mysite.com/forum/extern.php?action=active&show=10');
?>

3 (edited by nickfzx 2006-06-08 19:51)

Re: altering the recent topics include

oh cool diddn't know that...


still has anyone else experienced this text wrapping onto the line below with this...its annoying because it would be nice to put a background image with some 'fake rows' behind the recent posts.  And if the text wraps when the topic is a certain length it prevents me from being able to do this.

Also is there a way to get rid of the bullet point from the beggining of each recent topic?

Cheers

Nick

http://www.thebutterflyfilm.co.uk/Untitled-1.jpg

Punbb w/coppermine and wordpress integrated

see my hack to integrate punbb with wordpress comment system.
Illustration Community

Re: altering the recent topics include

CSS to the rescue:

li { list-style-type: none; }

As far as the text wrapping, what would you rather it do?

Re: altering the recent topics include

just have it cut off with the three dots.  Or '&hellip' bit.

Thanks

Punbb w/coppermine and wordpress integrated

see my hack to integrate punbb with wordpress comment system.
Illustration Community

Re: altering the recent topics include

thanks thats done it...I'm new to css so don't always know what it can and can't do.  Also am using golive which isnt the greatest at css i think.

it was actually this that made it work though.... {  white-space: nowrap;   }

Cheers

Nick

Punbb w/coppermine and wordpress integrated

see my hack to integrate punbb with wordpress comment system.
Illustration Community

Re: altering the recent topics include

here is the final result

still couldn't get rid of those bullet points but whatever!

http://www.thebutterflyfilm.co.uk/forpunforum.gif

cheers for the help

Nick

Punbb w/coppermine and wordpress integrated

see my hack to integrate punbb with wordpress comment system.
Illustration Community

8

Re: altering the recent topics include

nickfzx wrote:

still couldn't get rid of those bullet points but whatever!

try this:

ul {
  list-style:none;
  }