From 56c1496ad31a21c69acc919a734c2e411b55bdc4 Mon Sep 17 00:00:00 2001 From: Garvin Hicking Date: Fri, 12 Dec 2008 10:58:56 +0000 Subject: [PATCH] * Added more parameters to {serendipity_printComments} function: "block" (smarty block variable name), "template" (smarty template file to render) [1.4-beta2] --- docs/NEWS | 5 +++++ include/functions_smarty.inc.php | 18 +++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/docs/NEWS b/docs/NEWS index 864e6d3b..81fcbbc1 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,11 @@ Version 1.4 () ------------------------------------------------------------------------ + * Added more parameters to {serendipity_printComments} function: + "block" (smarty block variable name), + "template" (smarty template file to render) + [1.4-beta2] + * Fixed not remembering entryproperties when re-editing an entry, introduced with 1.4-beta1 [1.4-beta2] diff --git a/include/functions_smarty.inc.php b/include/functions_smarty.inc.php index 3729dd13..644b3c45 100644 --- a/include/functions_smarty.inc.php +++ b/include/functions_smarty.inc.php @@ -730,7 +730,23 @@ function &serendipity_smarty_printComments($params, &$smarty) { ); } - $out = serendipity_printComments($comments, $params['mode']); + if (empty($params['depth'])) { + $params['depth'] = 0; + } + + if (empty($params['trace'])) { + $params['trace'] = null; + } + + if (empty($params['block'])) { + $params['block'] = 'COMMENTS'; + } + + if (empty($params['template'])) { + $params['template'] = 'comments.tpl'; + } + + $out = serendipity_printComments($comments, $params['mode'], $params['depth'], $params['trace'], $params['block'], $params['template']); return $out; }