protected function renderPostNoticeTemplate($phrase_name, $data = array()) { /* Template display_threadview_post_notice only supports single phrase var atm. If we need to support variable phrase var, we either need a vb:var_array or use vb:raw on the phrase_var parameter and investigate whether allowing vb:raw there is safe, and html-escape any URLs used in html (nextpageurl). */ $template_name = 'display_threadview_post_notice'; switch ($phrase_name) { case 'new_replies_since_x': $phrase_var = vB5_Template_Runtime::time($data['timestamp']); break; case 'replies_below_on_next_page': $phrase_var = $data['nextpageurl']; break; case 'more_replies_after_current_page': $phrase_var = $data['nextpageurl']; break; default: return; break; } $templater = new vB5_Template($template_name); $templater->register('phrase_name', $phrase_name); $templater->register('phrase_var', $phrase_var); return $templater->render(true, true); }