Code Duplication    Length = 3-3 lines in 3 locations

blocks/news_randomnews.php 1 location

@@ 63-65 (lines=3) @@
60
    foreach ($stories as $story) {
61
        $news  = array();
62
        $title = $story->title();
63
        if (strlen($title) > $options[2]) {
64
            $title = xoops_substr($title, 0, $options[2] + 3);
65
        }
66
        $news['title']       = $title;
67
        $news['id']          = $story->storyid();
68
        $news['date']        = formatTimestamp($story->published(), $dateformat);

blocks/news_top.php 2 locations

@@ 266-268 (lines=3) @@
263
                foreach ($stories as $key => $story) {
264
                    $news  = array();
265
                    $title = $story->title();
266
                    if (strlen($title) > $options[2]) {
267
                        $title = xoops_substr($title, 0, $options[2] + 3);
268
                    }
269
                    $news['title']       = $title;
270
                    $news['id']          = $story->storyid();
271
                    $news['date']        = formatTimestamp($story->published(), $dateformat);
@@ 411-413 (lines=3) @@
408
        foreach ($stories as $key => $story) {
409
            $news  = array();
410
            $title = $story->title();
411
            if (strlen($title) > $options[2]) {
412
                $title = xoops_substr($title, 0, $options[2] + 3);
413
            }
414
415
            //if spotlight is enabled and this is either the first article or the selected one
416
            if (($options[5] == 0) && ($options[4] == 1) && (($options[6] > 0 && $options[6] == $story->storyid()) || ($options[6] == 0 && $key == 0))) {