TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,021
  • Total Topics: 21,332
  • Online today: 582
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 247
  • Total: 247

Scrollable Recent Posts Block + Selfscrolling ShoutBox???

Started by misjka, January 09, 2006, 07:06:38 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

misjka

Hi!

I wonder: What should I do/change to get a scrollable Recent Forum Posts block? I'd prefer the 20 most recent posts to occur on my site, but the box height shouldn't exceed let's say about 8 posts...

I would also like to make the ShoutBox autoscroll about the 20 most recent shouts... How do I achieve that?

Rasyr

Making Recent Posts be scrolling:

Go to TPortalBlocks.template.php and find the  TPortal_recentbox() function.

Replace


function TPortal_recentbox()
{
    global $context, $settings, $options, $txt , $modSettings;
    // is it a number?
    if(!is_numeric($context['TPortal']['recentboxnum']))
                     $context['TPortal']['recentboxnum']='10';

    // leave out the recycle baord, if any
    if(isset($modSettings['recycle_board']))
      $bb=array($modSettings['recycle_board']);
    else
      $bb=array();
    $what=ssi_recentTopics($num_recent = $context['TPortal']['recentboxnum'], $bb, $output_method = 'array');

    // Output the topics
    foreach($what as $w){
            echo '<span class="smalltext"><a href="'.$w['href'].'"> '.$w['time'];
            if(!$w['new'])
               echo ' <img border="0" src="'.$settings['images_url'].'/'.$context['user']['language'].'/new.gif" alt="new" />';

           echo '<br />'.$w['short_subject'].'</a></span><hr style="background-color: #c0c0c0;margin: 0px; " />';
    }
}


with:


function TPortal_recentbox()
{
    global $context, $settings, $options, $txt , $modSettings;
    // is it a number?
    if(!is_numeric($context['TPortal']['recentboxnum']))
                     $context['TPortal']['recentboxnum']='10';

    // leave out the recycle baord, if any
    if(isset($modSettings['recycle_board']))
      $bb=array($modSettings['recycle_board']);
    else
      $bb=array();
    $what=ssi_recentTopics($num_recent = $context['TPortal']['recentboxnum'], $bb, $output_method = 'array');

echo '<div style="height: 150px; overflow: auto; width: 100%;">';
    // Output the topics
    foreach($what as $w){
            echo '<span class="smalltext"><a href="'.$w['href'].'"> '.$w['time'];
            if(!$w['new'])
               echo ' <img border="0" src="'.$settings['images_url'].'/'.$context['user']['language'].'/new.gif" alt="new" />';

           echo '<br />'.$w['short_subject'].'</a></span><hr style="background-color: #c0c0c0;margin: 0px; " />';
    }
echo '</div>';
}


To set the height of the box, change the height size in this line from 150px to whatever size you want it to be.
echo '<div style="height: 150px; overflow: auto; width: 100%;">';

For the Shoutbox, there is an Edit Shoutbox page in TPAdmin, and you can set the height of the shoutbox there. It also allows you to delete any shouts you want as well.


misjka

Thanks - much obliged!

What about the autscroll for the Shoutbox?

Rasyr

In the Edit Shoutbox page in TPAdmin, there is a spot for you to set the height of the shoutbox. I will automatically add a scrollbar if there are more shouts than the size can display.


misjka

Oh yes, but I'd like it autoscrolling, i.e. moving by it self (probably upwards) like a marquee or something...

Rasyr

ahh.... okay, not sure how to do that offhand, but will check around to see if there are any premade scripts that can do that (and yes, it would require javascript to accomplish)


misjka


crip



whoesa

hi, im looking for an auto scrolling shoutbox to.

Any know how to do that?

This website is proudly hosted on Crocweb Cloud Website Hosting.