MyBB Community Forums

Full Version: Scrollable announcemens on Portal page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I saw on some board this kind of look of announcements, how to do the same? I know similar plugin allready exists (Portal Short Writing) but that's not really what i need.
I would like to specify the lenght of announsements, but you could read the whole announcement by scrolling it without entering the thread.
Thanks Smile
Add a max-height + overflow CSS properties to the table?
I dont't know what needs to be added, i'm not good at php Smile
I'm not too certain what you want.

If it's what I'm thinking, all you need to do is edit either a theme (add appropriate CSS) or edit the portal announcement template.


For example, open up the portal_announcement template, find:
<table border="0" cellpadding="{$theme['tablespace']}" width="100%">
Replace with
<table border="0" cellpadding="{$theme['tablespace']}" width="100%" style="max-height: 300px; overflow: auto;">
I did what you say but nothing changed.
here's my portal_announcement template :
<table cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead"><strong>{$icon} <a href="{$mybb->settings['bburl']}/showthread.php?tid={$announcement['tid']}">{$announcement['subject']}</a></strong></td>
</tr>
<tr>
<td class="trow2" align="right">
<span class="smalltext">{$lang->posted_by} <a href="{$mybb->settings['bburl']}/member.php?action=profile&uid={$announcement['uid']}">{$announcement['username']}</a>  - {$anndate} {$anntime} {$numcomments}</span>
</td>
</tr>
<tr>
<td class="trow1">
<table border="0" cellpadding="{$theme['tablespace']}" width="100%" style="max-height: 300px; overflow: auto;"><tr>{$avatar}<td class="trow1"><p>{$message}

<a href="{$mybb->settings['bburl']}/showthread.php?tid={$announcement['tid']}"></a>

<a href="{$mybb->settings['bburl']}/showthread.php?tid={$announcement['tid']}"></a></p>{$post['attachments']}</td></tr>
<tr><td align="right" colspan="2" valign="bottom"><span class="smalltext"><a href="{$mybb->settings['bburl']}/printthread.php?tid={$announcement['tid']}"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/printable.gif" alt="" /></a> <a href="{$mybb->settings['bburl']}/sendthread.php?tid={$announcement['tid']}"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/send.gif" alt="" /></a></span></td></tr>
</table>
</td>
</tr>
</table>
<br />
I meant this:

[attachment=8141]
Reduce the "300px" to something small like "30px".

This won't work in crappy IE6.
If you want IE6 compatibility, replace "max-height" with "height" - do note that this may have unwanted side effects.
edited
<table cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead"><strong>{$icon} <a href="{$mybb->settings['bburl']}/showthread.php?tid={$announcement['tid']}">{$announcement['subject']}</a></strong></td>
</tr>
<tr>
<td class="trow2" align="right">
<span class="smalltext">{$lang->posted_by} <a href="{$mybb->settings['bburl']}/member.php?action=profile&uid={$announcement['uid']}">{$announcement['username']}</a>  - {$anndate} {$anntime} {$numcomments}</span>
</td>
</tr>
<tr>
<td class="trow1">
<table border="0" cellpadding="{$theme['tablespace']}" width="100%" style="height: 30px; overflow: auto;"><tr>{$avatar}<td class="trow1"><p>{$message}

<a href="{$mybb->settings['bburl']}/showthread.php?tid={$announcement['tid']}"></a>

<a href="{$mybb->settings['bburl']}/showthread.php?tid={$announcement['tid']}"></a>

<a href="{$mybb->settings['bburl']}/showthread.php?tid={$announcement['tid']}"></a></p>{$post['attachments']}</td></tr>
<tr><td align="right" colspan="2" valign="bottom"><span class="smalltext"><a href="{$mybb->settings['bburl']}/printthread.php?tid={$announcement['tid']}"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/printable.gif" alt="" /></a> <a href="{$mybb->settings['bburl']}/sendthread.php?tid={$announcement['tid']}"><img src="{$mybb->settings['bburl']}/{$theme['imgdir']}/send.gif" alt="" /></a></span></td></tr>
</table>
</td>
</tr>
</table>
<br />
nothing changed Sad
take a look www.vitz-omsk.com
i did this
<table border="0" cellpadding="{$theme['tablespace']}" width="100%"><tr>{$avatar}<td class="trow1"><p><textarea name="textfield" cols="50" rows="10">{$message}</textarea>
but thats not what i need Smile
take a look if you want Smile
YEAH!!!!! I DID IT!!!! Big Grin

here's correct code:

<div id="text" style="height: 200px; overflow: auto;">