Code Duplication    Length = 10-10 lines in 2 locations

blocks/news_top.php 2 locations

@@ 196-205 (lines=10) @@
193
                } else {
194
                    $tmpstory = $permstory;
195
                }
196
            } else { // Use the most recent news
197
                $stories = array();
198
                $stories = NewsStory::getAllPublished(1, 0, $restricted, 0, 1, true, $options[0]);
199
                if (count($stories) > 0) {
200
                    $firststory = $stories[0];
201
                    $tmpstory->NewsStory($firststory->storyid());
202
                } else {
203
                    $block['use_spotlight'] = false;
204
                }
205
            }
206
            $spotlight          = array();
207
            $spotlight['title'] = $tmpstory->title();
208
            if ($options[7] !== '') {
@@ 516-525 (lines=10) @@
513
                } else {
514
                    $block['use_spotlight'] = false;
515
                }
516
            } else { // Use the most recent news
517
                $stories = array();
518
                $stories = NewsStory::getAllPublished(1, 0, $restricted, 0, 1, true, $options[0]);
519
                if (count($stories) > 0) {
520
                    $firststory       = $stories[0];
521
                    $spotlightArticle = new NewsStory($firststory->storyid());
522
                } else {
523
                    $block['use_spotlight'] = false;
524
                }
525
            }
526
            if ($block['use_spotlight'] == true) {
527
                $spotlight          = array();
528
                $spotlight['title'] = xoops_substr($spotlightArticle->title(), 0, $options[2] - 1);