From 0f8589efcdb593040b1a00ea75a69e285bb921af Mon Sep 17 00:00:00 2001 From: Tijn Kuyper Date: Thu, 9 May 2019 12:51:24 +0200 Subject: [PATCH] Forum - allow setting dateformat of {JOINED} SC --- .../forum/shortcodes/batch/view_shortcodes.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/e107_plugins/forum/shortcodes/batch/view_shortcodes.php b/e107_plugins/forum/shortcodes/batch/view_shortcodes.php index 5320d1a2d..1256cc032 100644 --- a/e107_plugins/forum/shortcodes/batch/view_shortcodes.php +++ b/e107_plugins/forum/shortcodes/batch/view_shortcodes.php @@ -292,13 +292,24 @@ return "" . $text . ''; } - function sc_joined() + + /** + * @example {JOINED: dateformat=relative} + */ + function sc_joined($parm = '') { - $gen = e107::getDate(); if($this->postInfo['post_user']) { - return LAN_FORUM_2031 . ': ' . $gen->convert_date($this->postInfo['user_join'], 'forum') . '
'; + + if(empty($parm['dateformat'])) + { + return LAN_FORUM_2031 . ': ' . $gen->convert_date($this->postInfo['user_join'], 'forum') . '
'; + } + else + { + return LAN_FORUM_2031 . ': ' . $gen->convert_date($this->postInfo['user_join'], $parm['dateformat']) . '
'; + } } }