Code Duplication    Length = 4-4 lines in 5 locations

makepdf.php 1 location

@@ 50-53 (lines=4) @@
47
48
$article = new NewsStory($storyid);
49
// Not yet published
50
if ( $article->published() == 0 || $article->published() > time() ) {
51
    redirect_header(XOOPS_URL.'/modules/news/index.php', 2, _NW_NOSTORY);
52
53
}
54
55
// Expired
56
if ( $article->expired() != 0 && $article->expired() < time() ) {

print.php 2 locations

@@ 56-59 (lines=4) @@
53
// Verify that the article is published
54
$story = new NewsStory($storyid);
55
// Not yet published
56
if ($story->published() == 0 || $story->published() > time()) {
57
    redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);
58
59
}
60
61
// Expired
62
if ($story->expired() != 0 && $story->expired() < time()) {
@@ 62-65 (lines=4) @@
59
}
60
61
// Expired
62
if ($story->expired() != 0 && $story->expired() < time()) {
63
    redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);
64
65
}
66
67
// Verify permissions
68
$gperm_handler =& xoops_gethandler('groupperm');

ratenews.php 1 location

@@ 100-103 (lines=4) @@
97
98
if (!empty($storyid)) {
99
    $article = new NewsStory($storyid);
100
    if ($article->published() == 0 || $article->published() > time()) {
101
        redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);
102
103
    }
104
105
    // Expired
106
    if ($article->expired() != 0 && $article->expired() < time()) {

visit.php 1 location

@@ 42-45 (lines=4) @@
39
// Do we have the right to see the file ?
40
$article = new NewsStory($sfiles->getStoryid());
41
// and the news, can we see it ?
42
if ($article->published() == 0 || $article->published() > time()) {
43
    redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);
44
45
}
46
// Expired
47
if ($article->expired() != 0 && $article->expired() < time()) {
48
    redirect_header(XOOPS_URL . '/modules/news/index.php', 2, _NW_NOSTORY);