Code Duplication    Length = 12-13 lines in 6 locations

bookmark.php 1 location

@@ 28-39 (lines=12) @@
25
list($lid, $cid, $ltitle, $url) = $xoopsDB->fetchRow($result);
26
27
//bookmark func
28
switch ($mylinks_can_bookmark) {
29
    case _MD_MYLINKS_MEMBERONLY:
30
        $can_bookmark = $xoopsUser ? _MD_MYLINKS_ALLOW : _MD_MYLINKS_DISALLOW;
31
        break;
32
    case _MD_MYLINKS_ALLOW:
33
        $can_bookmark = _MD_MYLINKS_ALLOW;
34
        break;
35
    case _MD_MYLINKS_DISALLOW:
36
    default:
37
        $can_bookmark = _MD_MYLINKS_DISALLOW;
38
        break;
39
}
40
if ( _MD_MYLINKS_DISALLOW == $can_bookmark ) {
41
    redirect_header('index.php', 3, _MD_MYLINKS_BOOKMARKDISALLOWED);
42
    exit();

footer.php 4 locations

@@ 57-69 (lines=13) @@
54
$can_bookmark = _MD_MYLINKS_DISALLOW;
55
56
//print func
57
switch ($mylinks_can_print)
58
{
59
    case _MD_MYLINKS_MEMBERONLY:
60
        $can_print = $xoopsUser ? _MD_MYLINKS_ALLOW : _MD_MYLINKS_DISALLOW;
61
        break;
62
    case _MD_MYLINKS_ALLOW:
63
        $can_print = _MD_MYLINKS_ALLOW;
64
        break;
65
    case _MD_MYLINKS_DISALLOW:
66
    default:
67
        $can_print = _MD_MYLINKS_DISALLOW;
68
        break;
69
}
70
71
if ( _MD_MYLINKS_DISALLOW == $can_print ) {
72
    $xoopsTpl->assign('mylinksextrafuncprint', false);
@@ 78-89 (lines=12) @@
75
}
76
77
//pdf function
78
switch ($mylinks_can_pdf) {
79
    case _MD_MYLINKS_MEMBERONLY:
80
        $can_pdf = $xoopsUser ? _MD_MYLINKS_ALLOW : _MD_MYLINKS_DISALLOW;
81
        break;
82
    case _MD_MYLINKS_ALLOW:
83
        $can_pdf = _MD_MYLINKS_ALLOW;
84
        break;
85
    case _MD_MYLINKS_DISALLOW:
86
    default:
87
        $can_pdf = _MD_MYLINKS_DISALLOW;
88
        break;
89
}
90
if ( _MD_MYLINKS_DISALLOW == $can_pdf ) {
91
    $xoopsTpl->assign('mylinksextrafuncpdf', false);
92
} else {
@@ 97-108 (lines=12) @@
94
}
95
96
//qrcode func
97
switch ($mylinks_can_qrcode) {
98
    case _MD_MYLINKS_MEMBERONLY:
99
        $can_qrcode = $xoopsUser ? _MD_MYLINKS_ALLOW : _MD_MYLINKS_DISALLOW;
100
        break;
101
    case _MD_MYLINKS_ALLOW:
102
        $can_qrcode = _MD_MYLINKS_ALLOW;
103
        break;
104
    case _MD_MYLINKS_DISALLOW:
105
    default:
106
        $can_qrcode = _MD_MYLINKS_DISALLOW;
107
        break;
108
}
109
if ( _MD_MYLINKS_DISALLOW == $can_qrcode ) {
110
    $xoopsTpl->assign('mylinksextrafuncqrcode', false);
111
} else {
@@ 117-128 (lines=12) @@
114
115
//ver3.0 bookmark
116
//bookmark func
117
switch ($mylinks_can_bookmark) {
118
    case _MD_MYLINKS_MEMBERONLY:
119
        $can_bookmark = $xoopsUser ? _MD_MYLINKS_ALLOW : _MD_MYLINKS_DISALLOW;
120
        break;
121
    case _MD_MYLINKS_ALLOW:
122
        $can_bookmark = _MD_MYLINKS_ALLOW;
123
        break;
124
    case _MD_MYLINKS_DISALLOW:
125
    default:
126
        $can_bookmark = _MD_MYLINKS_DISALLOW;
127
        break;
128
}
129
if ( _MD_MYLINKS_DISALLOW == $can_bookmark ) {
130
    $xoopsTpl->assign('mylinksextrafuncbookmark', false);
131
} else {

qrcode.php 1 location

@@ 55-66 (lines=12) @@
52
list($lid, $cid, $ltitle, $url, $logourl, $status, $time, $hits, $rating, $votes, $comments, $description) = $xoopsDB->fetchRow($result);
53
54
//qrcode func
55
switch ($mylinks_can_qrcode) {
56
    case _MD_MYLINKS_MEMBERONLY:
57
        $can_qrcode = $xoopsUser ? _MD_MYLINKS_ALLOW : _MD_MYLINKS_DISALLOW;
58
        break;
59
    case _MD_MYLINKS_ALLOW:
60
        $can_qrcode = _MD_MYLINKS_ALLOW;
61
        break;
62
    case _MD_MYLINKS_DISALLOW:
63
    default:
64
        $can_qrcode = _MD_MYLINKS_DISALLOW;
65
        break;
66
}
67
/*
68
if ( _MD_MYLINKS_DISALLOW == $can_qrcode ) {
69
    $xoopsTpl->assign( 'mylinksextrafuncqrcode' , false );