From bb34f0f425cb27df3d065cc0cfe55b3a56ddf707 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 4 Feb 2014 06:50:01 -0800 Subject: [PATCH] Fixed {NEWSTHUMBNAIL} to work with images and video. --- e107_core/shortcodes/batch/news_shortcodes.php | 8 +++++--- e107_plugins/news/templates/news_template.php | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/e107_core/shortcodes/batch/news_shortcodes.php b/e107_core/shortcodes/batch/news_shortcodes.php index 907aced88..0fd32eae4 100644 --- a/e107_core/shortcodes/batch/news_shortcodes.php +++ b/e107_core/shortcodes/batch/news_shortcodes.php @@ -414,7 +414,7 @@ class news_shortcodes extends e_shortcode */ function sc_newsthumbnail($parm = '') //TODO Add support {NEWSTHUMBNAIL: x=y} format { - $tmp = $this->handleMultiple($parm); + $tmp = $this->handleMultiple($parm,'all'); $newsThumb = $tmp['file']; $class = 'news-thumbnail-'.$tmp['count']; @@ -557,12 +557,14 @@ class news_shortcodes extends e_shortcode $list['image'][] = $file; } + $list['all'][] = $file; } if(is_string($parm) || !vartrue($parm['item'])) { $item = 0; + $parm = array('item' => 1); } else { @@ -571,9 +573,9 @@ class news_shortcodes extends e_shortcode $file = varset($list[$type][$item]); - $count = $item; + $count = varset($parm['item'],1); - return array('file'=>$file, 'count'=>varset($parm['item'],1)); + return array('file'=>$file, 'count'=> $count); } diff --git a/e107_plugins/news/templates/news_template.php b/e107_plugins/news/templates/news_template.php index 38a6c397b..18f7f604e 100644 --- a/e107_plugins/news/templates/news_template.php +++ b/e107_plugins/news/templates/news_template.php @@ -135,7 +135,7 @@ $NEWS_TEMPLATE['view']['item'] = ' {NEWSBODY=body}
- {SETIMAGE: w=600&h=600} + {SETIMAGE: w=400&h=400}
{NEWSIMAGE: item=2}