*/
function setCurrentComment(&$comment)
{
- global $manager;
+ global $currentcommentid, $currentcommentarray, $manager;
if ( $comment['memberid'] != 0 )
{
- $comment['authtext'] = $template['COMMENTS_AUTH'];
+ if ( !array_key_exists('COMMENTS_AUTH', $this->template) )
+ {
+ $comment['authtext'] = '';
+ }
+ else
+ {
+ $comment['authtext'] = $this->template['COMMENTS_AUTH'];
+ }
+
$mem =& $manager->getMember($comment['memberid']);
$comment['user'] = $mem->getDisplayName();
else
{
// create smart links
- if ( !empty($comment['userid']) )
+ if ( !array_key_exists('userid', $comment) || !empty($comment['userid']) )
{
if ( (i18n::strpos($comment['userid'], 'http://') === 0) || (i18n::strpos($comment['userid'], 'https://') === 0) )
{
}
$this->currentComment =& $comment;
- global $currentcommentid, $currentcommentarray;
$currentcommentid = $comment['commentid'];
$currentcommentarray = $comment;
return;
else
echo $this->template['COMMENTS_MANY'];
}
-
+
/**
* COMMENTACTIONS::parse_date()
* Parse templatevar date
*
* @format String $format Date format according to PHP
- * @return String formatted datetime
+ * @return void
*
*/
function parse_date($format = '')
{
+ if ( $format !== '' )
+ {
+ /* pass */
+ }
+ else if ( !array_key_exists('FORMAT_DATE', $this->template) || $this->template['FORMAT_DATE'] === '' )
+ {
+ $format = '%X';
+ }
+ else
+ {
+ $format = $this->template['FORMAT_DATE'];
+ }
+
$offset = $this->commentsObj->itemActions->blog->getTimeOffset() * 3600;
- echo i18n::formatted_datetime($format, $this->currentComment['timestamp'], $this->template['FORMAT_DATE'], $offset);
+
+ echo i18n::formatted_datetime($format, $this->currentComment['timestamp'], $offset);
+ return;
}
-
+
/**
* Parse templatevar email
*/
if ($tmp != $this->currentComment['body'])
$this->parser->parse($this->template['COMMENTS_CONTINUED']);
}
-
+
/**
+ * COMMENTACTIONS::parse_time()
* Parse templatevar time
+ *
+ * @param string $format datetime format referring to strftime() in PHP's built-in function
+ * @return void
+ *
*/
- function parse_time($format = '') {
- echo i18n::strftime(
- ($format == '') ? $this->template['FORMAT_TIME'] : $format,
- $this->currentComment['timestamp']
- );
+ function parse_time($format = '')
+ {
+ if ( $format === '' )
+ {
+ /* pass */
+ }
+ else if ( !array_key_exists('FORMAT_TIME', $this->template) || $this->template['FORMAT_TIME'] === '' )
+ {
+ $format = '%x';
+ }
+ else
+ {
+ $format = $this->template['FORMAT_TIME'];
+ }
+
+ echo i18n::strftime($format, $this->currentComment['timestamp']);
+ return;
}
-
+
/**
* Parse templatevar timestamp
*/
}
}
-?>