Code Duplication    Length = 3-3 lines in 2 locations

blocks/references_last_news.php 1 location

@@ 37-39 (lines=3) @@
34
    if ($limit > 0) {
35
        $items      = array();
36
        $categories = array();
37
        if (is_array($options) && count($options) > 1) {
38
            $categories = array_slice($options, 1);
39
        }
40
        $items = $h_references_articles->getRecentArticles($start, $limit, 'article_timestamp', 'DESC', true, $categories);
41
        if (count($items) > 0) {
42
            foreach ($items as $item) {

blocks/references_random_news.php 1 location

@@ 38-40 (lines=3) @@
35
        $items = array();
36
        $h_references_articles->setCachingOptions(array('cacheDir' => REFERENCES_CACHE_PATH, 'caching' => false, 'lifeTime' => null, 'automaticSerialization' => true, 'fileNameProtection' => false));
37
        $categories = array();
38
        if (is_array($options) && count($options) > 1) {
39
            $categories = array_slice($options, 1);
40
        }
41
        $items = $h_references_articles->getRecentArticles($start, $limit, 'RAND(), NOW()', 'DESC', true, $categories);
42
        $h_references_articles->setCachingOptions(array('cacheDir' => REFERENCES_CACHE_PATH, 'caching' => true, 'lifeTime' => null, 'automaticSerialization' => true, 'fileNameProtection' => false));
43
        if (count($items) > 0) {