1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-09 08:06:38 +02:00

Replaced global $menu_pref usage. Updated tests.

This commit is contained in:
Cameron
2021-01-08 13:50:32 -08:00
parent 487c10fc1d
commit d86d8d999f
5 changed files with 22 additions and 10 deletions

View File

@@ -18,7 +18,7 @@
function __construct()
{
$this->gen = new convert; // TODO replace all usage with e107::getParser()->toDate();
$this->gen = e107::getDate(); // TODO replace all usage with e107::getParser()->toDate();
// $this->forum_rules = forum_rules('check');
}
@@ -902,7 +902,7 @@
*/
function sc_threadname($parm=null)
{
global $menu_pref, $forum;
global $forum;
$tp = e107::getParser();
$thread_name = strip_tags($tp->toHTML($this->var['thread_name'], false, 'no_hook, emotes_off'));
@@ -922,6 +922,7 @@
$tip_length = $forum->prefs->get('tiplength', 400);
if(strlen($thread_thread) > $tip_length)
{
$menu_pref = e107::getConfig('menu')->getPref();
//$thread_thread = substr($thread_thread, 0, $tip_length).' '.$menu_pref['newforumposts_postfix'];
$thread_thread = $tp->text_truncate($thread_thread, $tip_length, $menu_pref['newforumposts_postfix']); // Doesn't split entities
}