Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion class/IconHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public function assignImages($images): void
*/
public function render()
{
//$this->template->assign_by_ref("image", $this->images);
//$this->template->assignByRef("image", $this->images);
$this->template->assign($this->images);

return \count($this->images);
Expand Down
2 changes: 1 addition & 1 deletion class/OnlineHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public function render(Smarty $xoopsTpl): void
$online['users'][] = $user;
}

$xoopsTpl->assign_by_ref('online', $online);
$xoopsTpl->assignByRef('online', $online);
}

/**
Expand Down
20 changes: 10 additions & 10 deletions class/TopicRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ public function buildSelection(\Smarty $xoopsTpl): void
$since = $this->vars['since'] ?? $this->config['since_default'];
$selection['since'] = \newbbSinceSelectBox($since);

$xoopsTpl->assign_by_ref('selection', $selection);
$xoopsTpl->assignByRef('selection', $selection);
}

/**
Expand All @@ -660,7 +660,7 @@ public function buildSearch(\Smarty $xoopsTpl): void
$search['since'] = @$this->vars['since'];
$search['searchin'] = 'both';

$xoopsTpl->assign_by_ref('search', $search);
$xoopsTpl->assignByRef('search', $search);
}

/**
Expand Down Expand Up @@ -689,7 +689,7 @@ public function buildHeaders(\Smarty $xoopsTpl): void
$headers_data[$header]['title'] = $title;
$headers_data[$header]['link'] = $this->page . '?' . \implode('&', \array_merge($args, $_args));
}
$xoopsTpl->assign_by_ref('headers', $headers_data);
$xoopsTpl->assignByRef('headers', $headers_data);
}

/**
Expand All @@ -713,7 +713,7 @@ public function buildFilters(\Smarty $xoopsTpl): void
$status[$link]['title'] = $title;
$status[$link]['link'] = $this->page . '?' . \implode('&', \array_merge($args, $_args));
}
$xoopsTpl->assign_by_ref('filters', $status);
$xoopsTpl->assignByRef('filters', $status);
}

/**
Expand Down Expand Up @@ -761,7 +761,7 @@ public function buildTypes(\Smarty $xoopsTpl)
$status[$id]['title'] = $type['type_name'];
$status[$id]['link'] = $this->page . '?' . \implode('&', \array_merge($args, $_args));
}
$xoopsTpl->assign_by_ref('types', $status);
$xoopsTpl->assignByRef('types', $status);
}

/**
Expand All @@ -784,7 +784,7 @@ public function buildCurrent(\Smarty $xoopsTpl)
//$status['link'] = $this->page.(empty($this->vars['status']) ? '' : '?status='.$this->vars['status']);
$status['link'] = $this->page . (empty($args) ? '' : '?' . \implode('&', $args));

$xoopsTpl->assign_by_ref('current', $status);
$xoopsTpl->assignByRef('current', $status);
}

/**
Expand Down Expand Up @@ -866,7 +866,7 @@ public function renderTopics(\Smarty $xoopsTpl = null)

if ($this->noperm) {
if (\is_object($xoopsTpl)) {
$xoopsTpl->assign_by_ref('topics', $ret);
$xoopsTpl->assignByRef('topics', $ret);

return;
}
Expand Down Expand Up @@ -900,7 +900,7 @@ public function renderTopics(\Smarty $xoopsTpl = null)
$result = $this->handler->db->query($sql, $this->config['topics_per_page'], @$this->vars['start']);
if (!$this->handler->db->isResultSet($result)) {
if (\is_object($xoopsTpl)) {
$xoopsTpl->assign_by_ref('topics', $ret);
$xoopsTpl->assignByRef('topics', $ret);

return;
}
Expand Down Expand Up @@ -1118,8 +1118,8 @@ public function renderTopics(\Smarty $xoopsTpl = null)
}

if (\is_object($xoopsTpl)) {
$xoopsTpl->assign_by_ref('sticky', $sticky);
$xoopsTpl->assign_by_ref('topics', $topics);
$xoopsTpl->assignByRef('sticky', $sticky);
$xoopsTpl->assignByRef('topics', $topics);

return;
}
Expand Down
2 changes: 1 addition & 1 deletion edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
'content' => $p_message,
];
}
$xoopsTpl->assign_by_ref('posts_context', $posts_context);
$xoopsTpl->assignByRef('posts_context', $posts_context);
// irmtfan move to footer.php
require_once __DIR__ . '/footer.php';
require_once $GLOBALS['xoops']->path('footer.php');
10 changes: 5 additions & 5 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
'xoops_module_header',
'
<link rel="alternate" type="application/xml+rss" title="' . $xoopsModule->getVar('name') . '" href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/rss.php" >
' . @$xoopsTpl->get_template_vars('xoops_module_header')
' . @$xoopsTpl->getTemplateVars('xoops_module_header')
);
}
$xoopsTpl->assign('xoops_pagetitle', $xoops_pagetitle);
Expand Down Expand Up @@ -225,8 +225,8 @@
}

unset($categories, $forums_array, $forumsByCat);
$xoopsTpl->assign_by_ref('category_icon', $category_icon);
$xoopsTpl->assign_by_ref('categories', $category_array);
$xoopsTpl->assignByRef('category_icon', $category_icon);
$xoopsTpl->assignByRef('categories', $category_array);
$xoopsTpl->assign('notifyicon', $category_icon);

$xoopsTpl->assign(
Expand All @@ -249,7 +249,7 @@
$userstats['lastvisit'] = sprintf(_MD_NEWBB_USER_LASTVISIT, formatTimestamp($last_visit, 's')); // irmtfan should be removed because it is for anon users too
$userstats['lastpost'] = empty($userstats_row['user_lastpost']) ? _MD_NEWBB_USER_NOLASTPOST : sprintf(_MD_NEWBB_USER_LASTPOST, formatTimestamp($userstats_row['user_lastpost'], 's'));
}
$xoopsTpl->assign_by_ref('userstats', $userstats);
$xoopsTpl->assignByRef('userstats', $userstats);
// irmtfan add lastvisit smarty variable for all users
$xoopsTpl->assign('lastvisit', sprintf(_MD_NEWBB_USER_LASTVISIT, formatTimestamp($last_visit, 'l')));
$xoopsTpl->assign('currenttime', sprintf(_MD_NEWBB_TIMENOW, formatTimestamp(time(), 'm')));
Expand All @@ -259,7 +259,7 @@
///** @var Newbb\StatsHandler $statsHandler */
//$statsHandler = \XoopsModules\Newbb\Helper::getInstance()->getHandler('Stats');
$stats = $statsHandler->getStats(array_merge([0], $forums_available));
$xoopsTpl->assign_by_ref('stats', $stats);
$xoopsTpl->assignByRef('stats', $stats);
$xoopsTpl->assign('subforum_display', $GLOBALS['xoopsModuleConfig']['subforum_display']);
$xoopsTpl->assign('mark_read', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/index.php?mark_read=1');
$xoopsTpl->assign('mark_unread', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/index.php?mark_read=2');
Expand Down
2 changes: 1 addition & 1 deletion list.topic.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
'xoops_module_header',
'
<link rel="alternate" type="application/xml+rss" title="' . $xoopsModule->getVar('name') . '" href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/rss.php" >
' . @$xoopsTpl->get_template_vars('xoops_module_header')
' . @$xoopsTpl->getTemplateVars('xoops_module_header')
);
}
//$xoopsTpl->assign('xoops_module_header', $xoops_module_header);
Expand Down
2 changes: 1 addition & 1 deletion post.php
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@
'meta' => _MD_NEWBB_BY . ' ' . $p_name . ' ' . _MD_NEWBB_ON . ' ' . $p_date,
'content' => $p_message,
];
$xoopsTpl->assign_by_ref('post_preview', $post_preview);
$xoopsTpl->assignByRef('post_preview', $post_preview);
}

if (Request::getString('contents_upload', null, 'POST') || Request::getString('contents_preview', null, 'POST')
Expand Down
2 changes: 1 addition & 1 deletion reply.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
'content' => $p_message,
];
}
$xoopsTpl->assign_by_ref('posts_context', $posts_context);
$xoopsTpl->assignByRef('posts_context', $posts_context);
// irmtfan move to footer.php
require_once __DIR__ . '/footer.php';
require_once $GLOBALS['xoops']->path('footer.php');
4 changes: 2 additions & 2 deletions search.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@
$select_forum .= '<option value="all">' . _MD_NEWBB_SEARCHALLFORUMS . '</option>';
$select_forum .= newbbForumSelectBox($forum);
$select_forum .= '</select>';
$xoopsTpl->assign_by_ref('forum_selection_box', $select_forum);
$xoopsTpl->assignByRef('forum_selection_box', $select_forum);

/* searchin */
$searchin_select = '';
Expand Down Expand Up @@ -342,7 +342,7 @@
// irmtfan get since from the user for selction box
$since = Request::getInt('since', $GLOBALS['xoopsModuleConfig']['since_default']);
$select_since = newbbSinceSelectBox($since);
$xoopsTpl->assign_by_ref('since_selection_box', $select_since);
$xoopsTpl->assignByRef('since_selection_box', $select_since);

if ($xoopsConfigSearch['keyword_min'] > 0) {
$xoopsTpl->assign('search_rule', sprintf(_SR_KEYIGNORE, $xoopsConfigSearch['keyword_min']));
Expand Down
18 changes: 9 additions & 9 deletions viewforum.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
'xoops_module_header',
'
<link rel="alternate" type="application/xml+rss" title="' . $xoopsModule->getVar('name') . '-' . $forumObject->getVar('forum_name') . '" href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/rss.php?f=' . $forum_id . '" >
' . @$xoopsTpl->get_template_vars('xoops_module_header')
' . @$xoopsTpl->getTemplateVars('xoops_module_header')
);
}
$forumDescription = $forumObject->getVar('forum_desc');
Expand Down Expand Up @@ -151,7 +151,7 @@
}
}
$parentforum = $forumHandler->getParents($forumObject);
$xoopsTpl->assign_by_ref('parentforum', $parentforum);
$xoopsTpl->assignByRef('parentforum', $parentforum);

$criteria = new \CriteriaCompo(new \Criteria('parent_forum', $forum_id));
$criteria->add(new \Criteria('forum_id', '(' . implode(', ', $forumHandler->getIdsByPermission('access')) . ')', 'IN'));
Expand All @@ -162,7 +162,7 @@
$subforum_array = $forumHandler->display($forums, $GLOBALS['xoopsModuleConfig']['length_title_index'], $GLOBALS['xoopsModuleConfig']['count_subforum']);
$subforum = array_values($subforum_array[$forum_id]);
unset($subforum_array);
$xoopsTpl->assign_by_ref('subforum', $subforum);
$xoopsTpl->assignByRef('subforum', $subforum);
}

//$categoryHandler = \XoopsModules\Newbb\Helper::getInstance()->getHandler('Category');
Expand Down Expand Up @@ -195,7 +195,7 @@
}
$forum_selection_sort .= '</select>';

$xoopsTpl->assign_by_ref('forum_selection_sort', $forum_selection_sort);
$xoopsTpl->assignByRef('forum_selection_sort', $forum_selection_sort);

$order = (!Request::getString('order', '', 'GET')
|| 'ASC' !== Request::getString('order', '', 'GET')) ? 'DESC' : 'ASC';
Expand All @@ -204,12 +204,12 @@
$forum_selection_order .= '<option value="DESC"' . (('DESC' === $order) ? ' selected' : '') . '>' . _MD_NEWBB_DESCENDING . '</option>';
$forum_selection_order .= '</select>';

$xoopsTpl->assign_by_ref('forum_selection_order', $forum_selection_order);
$xoopsTpl->assignByRef('forum_selection_order', $forum_selection_order);

$since = Request::getInt('since', $GLOBALS['xoopsModuleConfig']['since_default'], 'GET');
require_once __DIR__ . '/include/functions.time.php';
$forum_selection_since = newbbSinceSelectBox($since);
$xoopsTpl->assign_by_ref('forum_selection_since', $forum_selection_since);
$xoopsTpl->assignByRef('forum_selection_since', $forum_selection_since);

$query_sort = $query_array;
unset($query_sort['sort'], $query_sort['order']);
Expand Down Expand Up @@ -246,7 +246,7 @@

[$allTopics, $sticky] = $forumHandler->getAllTopics($forumObject, $criteria_topic);

$xoopsTpl->assign_by_ref('topics', $allTopics);
$xoopsTpl->assignByRef('topics', $allTopics);
$xoopsTpl->assign('sticky', $sticky);
$xoopsTpl->assign('rating_enable', $GLOBALS['xoopsModuleConfig']['rating_enabled']);
$xoopsTpl->assign('img_newposts', newbbDisplayImage('topic_new', _MD_NEWBB_NEWPOSTS));
Expand Down Expand Up @@ -287,7 +287,7 @@
require_once __DIR__ . '/include/functions.topic.php';
$xoopsTpl->assign('forum_topictype', getTopicTitle('', $types[$type]['type_name'], $types[$type]['type_color']));
}
$xoopsTpl->assign_by_ref('typeOptions', $typeOptions);
$xoopsTpl->assignByRef('typeOptions', $typeOptions);

$query_status = $query_array;
unset($query_status['status']);
Expand Down Expand Up @@ -353,7 +353,7 @@
// /** var Newbb\PermissionHandler $permHandler */
// $permHandler = \XoopsModules\Newbb\Helper::getInstance()->getHandler('Permission');
$permission_table = $permHandler->getPermissionTable($forum_id, false, $isAdmin);
$xoopsTpl->assign_by_ref('permission_table', $permission_table);
$xoopsTpl->assignByRef('permission_table', $permission_table);
unset($permission_table);
}

Expand Down
8 changes: 4 additions & 4 deletions viewpost.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
'name' => $parent_forumObject->getVar('forum_name'),
];
unset($parent_forumObject);
$xoopsTpl->assign_by_ref('parentforum', $parentforum);
$xoopsTpl->assignByRef('parentforum', $parentforum);
}
$xoopsTpl->assign('forum_name', $forumObject->getVar('forum_name'));
$xoopsTpl->assign('forum_moderators', $forumObject->dispForumModerators());
Expand All @@ -200,15 +200,15 @@
'xoops_module_header',
'
<link rel="alternate" type="application/xml+rss" title="' . $xoopsModule->getVar('name') . '-' . $forumObject->getVar('forum_name') . '" href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/rss.php?f=' . $forum_id . '" >
' . @$xoopsTpl->get_template_vars('xoops_module_header')
' . @$xoopsTpl->getTemplateVars('xoops_module_header')
);
}
} elseif (!empty($GLOBALS['xoopsModuleConfig']['rss_enable'])) {
$xoopsTpl->assign(
'xoops_module_header',
'
<link rel="alternate" type="application/xml+rss" title="' . $xoopsModule->getVar('name') . '" href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/rss.php" >
' . @$xoopsTpl->get_template_vars('xoops_module_header')
' . @$xoopsTpl->getTemplateVars('xoops_module_header')
);
}
// irmtfan remove and move to footer.php
Expand Down Expand Up @@ -439,7 +439,7 @@
}

//$xoopsTpl->assign('viewmode_compact', ($viewmode=="compact")?1:0);
$xoopsTpl->assign_by_ref('viewmode_options', $viewmode_options);
$xoopsTpl->assignByRef('viewmode_options', $viewmode_options);
$xoopsTpl->assign('menumode', $menumode);
$xoopsTpl->assign('menumode_other', $menumode_other);

Expand Down
12 changes: 6 additions & 6 deletions viewtopic.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
'xoops_module_header',
'
<link rel="alternate" type="application/rss+xml" title="' . $xoopsModule->getVar('name') . '-' . $forumObject->getVar('forum_name') . '" href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/rss.php?f=' . $forumObject->getVar('forum_id') . '" >
' . @$xoopsTpl->get_template_vars('xoops_module_header')
' . @$xoopsTpl->getTemplateVars('xoops_module_header')
);
}

Expand Down Expand Up @@ -251,7 +251,7 @@
}
}
// irmtfan for backward compatibility assign forum_post_or_register smarty again.
$xoopsTpl->assign('forum_post_or_register', @$xoopsTpl->get_template_vars('forum_post') . @$xoopsTpl->get_template_vars('forum_register') . @$xoopsTpl->get_template_vars('topic_lock'));
$xoopsTpl->assign('forum_post_or_register', @$xoopsTpl->getTemplateVars('forum_post') . @$xoopsTpl->getTemplateVars('forum_register') . @$xoopsTpl->getTemplateVars('topic_lock'));

if ($topicHandler->getPermission($forumObject, $topicObject->getVar('topic_status'), 'reply')) {
$xoopsTpl->assign('forum_reply', '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/reply.php?topic_id=' . $topic_id . '"> ' . $t_reply . '</a>');
Expand Down Expand Up @@ -468,14 +468,14 @@
}
// END irmtfan add restore to viewtopic

$xoopsTpl->assign_by_ref('admin_actions', $admin_actions);
$xoopsTpl->assignByRef('admin_actions', $admin_actions);
$xoopsTpl->assign('viewer_level', (int)($isAdmin ? 2 : is_object($GLOBALS['xoopsUser'])));

if ($GLOBALS['xoopsModuleConfig']['show_permissiontable']) {
// /** var Newbb\PermissionHandler $permHandler */
// $permHandler = \XoopsModules\Newbb\Helper::getInstance()->getHandler('Permission');
$permission_table = $permHandler->getPermissionTable($forumObject, $topicObject->getVar('topic_status'), $isAdmin);
$xoopsTpl->assign_by_ref('permission_table', $permission_table);
$xoopsTpl->assignByRef('permission_table', $permission_table);
}

///////////////////////////////
Expand Down Expand Up @@ -651,7 +651,7 @@
'name' => _MD_NEWBB_POLL_VIEWLOG,
];

$xoopsTpl->assign_by_ref('adminpoll_actions', $adminpoll_actions);
$xoopsTpl->assignByRef('adminpoll_actions', $adminpoll_actions);
}
}
// END can add poll
Expand Down Expand Up @@ -742,7 +742,7 @@
$xoopsTpl->assign('mode', $mode);
$xoopsTpl->assign('status', $status);
//$xoopsTpl->assign('viewmode_compact', ($viewmode=="compact")?1:0);
$xoopsTpl->assign_by_ref('viewmode_options', $viewmode_options);
$xoopsTpl->assignByRef('viewmode_options', $viewmode_options);
unset($viewmode_options);
$xoopsTpl->assign('menumode', $menumode);
$xoopsTpl->assign('menumode_other', $menumode_other);
Expand Down