Code Duplication    Length = 10-10 lines in 2 locations

class/class.newsstory.php 2 locations

@@ 259-268 (lines=10) @@
256
                . ') AND (s.topicid=t.topic_id) ';
257
        if ($topic != 0) {
258
            if (!is_array($topic)) {
259
                if ($checkRight) {
260
                    $topics = news_MygetItemIds('news_view');
261
                    if (!in_array($topic, $topics)) {
262
                        return null;
263
                    } else {
264
                        $sql .= ' AND s.topicid=' . (int)$topic . ' AND (s.ihome=1 OR s.ihome=0)';
265
                    }
266
                } else {
267
                    $sql .= ' AND s.topicid=' . (int)$topic . ' AND (s.ihome=1 OR s.ihome=0)';
268
                }
269
            } else {
270
                if ($checkRight) {
271
                    $topics = news_MygetItemIds('news_view');
@@ 1375-1384 (lines=10) @@
1372
               . ')';
1373
        if ($topic != 0) {
1374
            if (!is_array($topic)) {
1375
                if ($checkRight) {
1376
                    $topics = news_MygetItemIds('news_view');
1377
                    if (!in_array($topic, $topics)) {
1378
                        return null;
1379
                    } else {
1380
                        $sql .= ' AND topicid=' . (int)$topic . ' AND (ihome=1 OR ihome=0)';
1381
                    }
1382
                } else {
1383
                    $sql .= ' AND topicid=' . (int)$topic . ' AND (ihome=1 OR ihome=0)';
1384
                }
1385
            } else {
1386
                if (count($topic) > 0) {
1387
                    $sql .= ' AND topicid IN (' . implode(',', $topic) . ')';