1
Lupin
Change scrolling direction in Shoutbox
  • 2020/5/21 14:01

  • Lupin

  • Just popping in

  • Posts: 92

  • Since: 2007/6/1 2


In the "stand alone" version of this module I can choose in wich direction I read messages.

In the Xoops module, I can only have last message first ... but it is just a little problematic if user must follow a discussion...
I found a way to change the shouts reading : (shoutframe.php line 79 )
if (!empty($shouts)) {     $xoopsTpl->assign('shouts'array_reverse($shouts)); }


Buy I should change the scrollbar starting from below ... How can I do?
Better try a different way?

TY

Pino

2
Mamba
Re: Change scrolling direction in Shoutbox
  • 2020/5/22 0:49

  • Mamba

  • Moderator

  • Posts: 11409

  • Since: 2004/4/23


I've added the scrolling as an option in Preferences.

Check it out at in Shoutbox 5.10 RC-1:

https://github.com/mambax7/shoutbox/releases/

In the future, you can do it this way:
in xoops_version.php add a new Preference:
$modversion['config'][] = [
    
'name'        => 'scroll_type',
    
'title'       => '_MI_SHOUTBOX_TITLE47',
    
'description' => '_MI_SHOUTBOX_DESC47',
    
'formtype'    => 'select',
    
'valuetype'   => 'int',
    
'options'     => ['_MI_SHOUTBOX_OP47_TL' => 0'_MI_SHOUTBOX_OP47_TA' => 1],
    
'default'     => 1,
];


In /language/english/modinfo.php add translations for the new preference:
define('_MI_SHOUTBOX_TITLE47''Scrolling direction');
define('_MI_SHOUTBOX_DESC47''Should the new message be added on top or at the bottom?');
define('_MI_SHOUTBOX_OP47_TL''Bottom');
define('_MI_SHOUTBOX_OP47_TA''Top');


in shoutframe.php check for the new preference:
$scrollDirection $helper->getConfig('scroll_type');
if (!empty(
$shouts)) {
    if (
=== $scrollDirection) {
        
$xoopsTpl->assign('shouts'array_reverse($shouts));
    } else {
        
$xoopsTpl->assign('shouts'$shouts);
    }
}


Of course, you would have to update the module to make it work.
Support XOOPS => DONATE
Use 2.5.11 | Docs | Modules | Bugs

Login

Who's Online

421 user(s) are online (288 user(s) are browsing Support Forums)


Members: 0


Guests: 421


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits