From 3331e71e8e14a279dc59e87693e8edeacae00be8 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Mon, 2 Dec 2013 20:25:43 +0100 Subject: [PATCH] disable the output of the "posted" value in shares when item cache is enabled. --- include/bbcode.php | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/include/bbcode.php b/include/bbcode.php index e63a8d394e..412010380d 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -259,16 +259,22 @@ function bb_ShareAttributes($match) { if ($matches[1] != "") $profile = $matches[1]; - $posted = ""; - preg_match("/posted='(.*?)'/ism", $attributes, $matches); - if ($matches[1] != "") - $posted = $matches[1]; + $posted = ""; - preg_match('/posted="(.*?)"/ism', $attributes, $matches); - if ($matches[1] != "") - $posted = $matches[1]; + $itemcache = get_config("system","itemcache"); - $reldate = (($posted) ? " " . relative_date($posted) : ''); + // relative dates only make sense when they aren't cached + if ($itemcache == "") { + preg_match("/posted='(.*?)'/ism", $attributes, $matches); + if ($matches[1] != "") + $posted = $matches[1]; + + preg_match('/posted="(.*?)"/ism', $attributes, $matches); + if ($matches[1] != "") + $posted = $matches[1]; + + $reldate = (($posted) ? " " . relative_date($posted) : ''); + } $headline = '
'; //$headline = '
';