2
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 (0 === $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.