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
see my hack to integrate punbb with wordpress comment system.
Illustration Community