Code Duplication    Length = 7-7 lines in 8 locations

class/class.newsstory.php 8 locations

@@ 264-270 (lines=7) @@
261
        $sql .= " ORDER BY s.$order DESC";
262
        $result = $db->query($sql, (int)$limit, (int)$start);
263
264
        while ($myrow = $db->fetchArray($result)) {
265
            if ($asobject) {
266
                $ret[] = new NewsStory($myrow);
267
            } else {
268
                $ret[$myrow['storyid']] = $myts->htmlSpecialChars($myrow['title']);
269
            }
270
        }
271
272
        return $ret;
273
    }
@@ 302-308 (lines=7) @@
299
        }
300
        $sql .= " ORDER BY $order DESC";
301
        $result = $db->query($sql);
302
        while ($myrow = $db->fetchArray($result)) {
303
            if ($asobject) {
304
                $ret[] = new NewsStory($myrow);
305
            } else {
306
                $ret[$myrow['storyid']] = $myts->htmlSpecialChars($myrow['title']);
307
            }
308
        }
309
310
        return $ret;
311
    }
@@ 360-366 (lines=7) @@
357
        }
358
        $sql .= " ORDER BY $order DESC";
359
        $result = $db->query($sql, (int)$limit, (int)$start);
360
        while ($myrow = $db->fetchArray($result)) {
361
            if ($asobject) {
362
                $ret[] = new NewsStory($myrow);
363
            } else {
364
                $ret[$myrow['storyid']] = $myts->htmlSpecialChars($myrow['title']);
365
            }
366
        }
367
368
        return $ret;
369
    }
@@ 457-463 (lines=7) @@
454
455
        $sql .= ' ORDER BY expired DESC';
456
        $result = $db->query($sql, (int)$limit, (int)$start);
457
        while ($myrow = $db->fetchArray($result)) {
458
            if ($asobject) {
459
                $ret[] = new NewsStory($myrow);
460
            } else {
461
                $ret[$myrow['storyid']] = $myts->htmlSpecialChars($myrow['title']);
462
            }
463
        }
464
465
        return $ret;
466
    }
@@ 482-488 (lines=7) @@
479
        $ret    = array();
480
        $sql    = 'SELECT * FROM ' . $db->prefix('news_stories') . ' WHERE published > ' . time() . ' ORDER BY published ASC';
481
        $result = $db->query($sql, (int)$limit, (int)$start);
482
        while ($myrow = $db->fetchArray($result)) {
483
            if ($asobject) {
484
                $ret[] = new NewsStory($myrow);
485
            } else {
486
                $ret[$myrow['storyid']] = $myts->htmlSpecialChars($myrow['title']);
487
            }
488
        }
489
490
        return $ret;
491
    }
@@ 525-531 (lines=7) @@
522
        $sql = 'SELECT s.*, t.* FROM ' . $db->prefix('news_stories') . ' s, ' . $db->prefix('news_topics') . ' t ';
523
        $sql .= ' ' . $criteria->renderWhere() . ' AND (s.topicid=t.topic_id) ORDER BY created DESC';
524
        $result = $db->query($sql, (int)$limit, (int)$start);
525
        while ($myrow = $db->fetchArray($result)) {
526
            if ($asobject) {
527
                $ret[] = new NewsStory($myrow);
528
            } else {
529
                $ret[$myrow['storyid']] = $myts->htmlSpecialChars($myrow['title']);
530
            }
531
        }
532
533
        return $ret;
534
    }
@@ 953-959 (lines=7) @@
950
        }
951
        $sql .= " ORDER BY $order DESC";
952
        $result = $this->db->query($sql);
953
        while ($myrow = $this->db->fetchArray($result)) {
954
            if ($asobject) {
955
                $ret[] = new NewsStory($myrow);
956
            } else {
957
                $ret[$myrow['storyid']] = $myts->htmlSpecialChars($myrow['title']);
958
            }
959
        }
960
961
        return $ret;
962
    }
@@ 1554-1560 (lines=7) @@
1551
        $sql .= " ORDER BY s.$order DESC";
1552
        $result = $db->query($sql, (int)$limit, (int)$start);
1553
1554
        while ($myrow = $db->fetchArray($result)) {
1555
            if ($asobject) {
1556
                $ret[$myrow['storyid']] = new NewsStory($myrow);
1557
            } else {
1558
                $ret[$myrow['storyid']] = $myts->htmlSpecialChars($myrow['title']);
1559
            }
1560
        }
1561
1562
        return $ret;
1563
    }