News:

Wondering if this will always be free?  See why free is better.

Main Menu

Truncating Recent Posts on Board Index..

Started by Niteblade, May 29, 2006, 04:43:59 PM

Previous topic - Next topic

Niteblade

Howdy.

For those long posts, is there a way to truncate the length of the subject displayed on the 'Recent Posts' on the Information Center on the Board Index ?

This is what I got.. original code follows the //'s ,,,

// Show lots of posts.
elseif (!empty($context['latest_posts']))
{
echo '
<table cellpadding="0" cellspacing="0" width="100%" border="0">';

/* Each post in latest_posts has:
board (with an id, name, and link.), topic (the topic's id.), poster (with id, name, and link.),
subject, short_subject (shortened with...), time, link, and href. */
foreach ($context['latest_posts'] as $post)
// echo '
// <tr>
// <td class="middletext" valign="top" nowrap="nowrap"><b>', $post['link'], '</b> ', $txt[525], ' ', $post['poster']['link'], ' (', $post['board']['link'], ')</td>
// <td class="middletext" align="right" valign="top" nowrap="nowrap">', $post['time'], '</td>
// </tr>';

echo '
<tr>
<td class="middletext" valign="top" nowrap="nowrap"><b>', $post['link'], '</b> ', $txt[525], ' ', $post['poster']['link'], ' </td>
<td class="middletext" align="right" valign="top" nowrap="nowrap">', $post['time'], '</td>
</tr>';


So I'm already not displaying the board where the post is made in order to save space. Somewhere in there, I think, is the text for the subject that is actually displayed as a link... It's that part that I want to be truncated to like 55-60 chatacters ...

How it's showing now ...

HEY, This is my looooooooooooooooooooooooooooooooooooooooooooooooooooooooong message

How I'd like to to show ...

HEY, This is my looooooooooooooooooo...

Thanks!

affiliate blog

Niteblade

Rephrased :

To the right of the category on the board index is the 'Last Post' ... The last post there is truncated.

How do I replicate this effect to the Recent Topics in the Information Center, with longer viewable subject lengths, section of the board index ?
affiliate blog

TLM

You might also want to point out that you get long subjects due to a unfinshed mod of mine.  :)
Once I have free time again infront of my dev server, I will get that problem fixed in my mod.

Niteblade

Quote from: TLM on June 07, 2006, 10:50:14 AM
You might also want to point out that you get long subjects due to a unfinshed mod of mine.  :)
Once I have free time again infront of my dev server, I will get that problem fixed in my mod.

Hey, man. Don't get me wrong. I'm not complaining or anything! Really! This was an issue for me when I first began experimenting with the rss injector found in this thread.

I trust in your programming abilities, TLM. I only wish that I could Vulcan mind meld with all you php programmers.  8)
affiliate blog

Advertisement: