diff --git a/e107_files/shortcode/batch/news_shortcodes.php b/e107_files/shortcode/batch/news_shortcodes.php
index ff18f4476..db6e776eb 100644
--- a/e107_files/shortcode/batch/news_shortcodes.php
+++ b/e107_files/shortcode/batch/news_shortcodes.php
@@ -1,7 +1,7 @@
db_Count("comments", "(*)", "WHERE comment_item_id='".$news_item['news_id']."' AND comment_type='0' ");
}
-
+
//XXX - ??? - another query? We should cache it in news table.
if ($pref['comments_icon'] && $news_item['news_comment_total'])
{
@@ -166,24 +166,25 @@ class news_shortcodes
function sc_newsdate($parm)
{
+ $date = ($this->news_item['news_start'] > 0) ? $this->news_item['news_start'] : $this->news_item['news_datestamp'];
$con = new convert;
if($parm == '')
{
- return $con->convert_date($this->news_item['news_datestamp'], 'long');
+ return $con->convert_date($date, 'long');
}
switch($parm)
{
case 'long':
- return $con->convert_date($this->news_item['news_datestamp'], 'long');
+ return $con->convert_date($date, 'long');
break;
case 'short':
- return $con->convert_date($this->news_item['news_datestamp'], 'short');
+ return $con->convert_date($date, 'short');
break;
case 'forum':
- return $con->convert_date($this->news_item['news_datestamp'], 'forum');
+ return $con->convert_date($date, 'forum');
break;
default :
- return date($parm, $this->news_item['news_datestamp']);
+ return date($parm, $date);
break;
}
}
@@ -242,7 +243,7 @@ class news_shortcodes
function sc_extended($parm)
{
-
+
if ($this->news_item['news_extended'] && ($this->param['current_action'] != 'extend' || $parm == 'force'))
{
if (defined('PRE_EXTENDEDSTRING'))
@@ -295,11 +296,11 @@ class news_shortcodes
case 'src':
return (isset($this->news_item['news_thumbnail']) && $this->news_item['news_thumbnail'] ? e_IMAGE_ABS."newspost_images/".$this->news_item['news_thumbnail'] : '');
break;
-
+
case 'tag':
return (isset($this->news_item['news_thumbnail']) && $this->news_item['news_thumbnail'] ? "
" : '');
break;
-
+
default:
return (isset($this->news_item['news_thumbnail']) && $this->news_item['news_thumbnail']) ? "news_item['news_id']}&catid={$this->news_item['news_category']}&sef={$this->news_item['news_rewrite_string']}")."'>
" : '';
break;
@@ -313,11 +314,11 @@ class news_shortcodes
case 'src':
return (isset($this->news_item['news_thumbnail']) && $this->news_item['news_thumbnail'] ? e_IMAGE_ABS.$this->news_item['news_thumbnail'] : '');
break;
-
+
case 'tag':
return (isset($this->news_item['news_thumbnail']) && $this->news_item['news_thumbnail'] ? "
" : '');
break;
-
+
default:
return (isset($this->news_item['news_thumbnail']) && $this->news_item['news_thumbnail']) ? "news_item['news_id']}&catid={$this->news_item['news_category']}&sef={$this->news_item['news_rewrite_string']}")."'>
" : '';
break;
@@ -352,26 +353,26 @@ class news_shortcodes
{
$category_icon = e_IMAGE_ABS.'icons/'.$category_icon;
}
-
+
//TODO - remove inline styles
if($this->param['caticon'] == ''){$this->param['caticon'] = 'border:0px';}
-
+
switch($parm)
{
case 'src':
return $category_icon;
break;
-
+
case 'tag':
return "
";
break;
-
+
default:
return "news_item['news_category']}&sef={$this->news_item['news_category_rewrite_string']}")."'>
";
break;
}
}
-
+
/**
* Example usage: {NEWSITEM_SCHOOK=mysc_name|my_var1=val1&myvar2=myval2}
* will fire {MYSC_NAME=news_id=1&my_var1=val1&myvar2=myval2}
@@ -380,7 +381,7 @@ class news_shortcodes
* $newsdata = e107::getRegistry('core/news/schook_data');
* //returns array('data' => (array) $current_news_data, 'params' => array() $current_params)
*
- *
+ *
* @param string $parm
* @return string
*/