Code Duplication    Length = 23-25 lines in 3 locations

plugins/daily/weblog-date.php 1 location

@@ 73-95 (lines=23) @@
70
                      . $add_whr
71
                      . $group_by;
72
$result             = $db->query($weblog_minical_sql);
73
while (list($title, $blog_id, $server_time, $entry_num) = $db->fetchRow($result)) {
74
    $user_time = $server_time + $tzoffset_s2u;
75
    $entry_num = ($entry_num > 1) ? $entry_num . 'entries' : $entry_num . 'entry';
76
    //        if( date( 'n' , $user_time ) != $this->month ) continue ;
77
    $target_date = date('j', $user_time);
78
    $tmp_array   = array(
79
        'dotgif'      => $plugin['dotgif'],
80
        'dirname'     => $plugin['dirname'],
81
        'link'        => XOOPS_URL . '/modules/' . $plugin['dirname'] . '/index.php?caldate=' . date('Y-n-j', $user_time) . '&date=' . date('Ymd', $user_time),
82
        'id'          => $blog_id . $server_time,
83
        'server_time' => $server_time,
84
        'user_time'   => $user_time,
85
        'name'        => 'blog_id',
86
        'title'       => $plugin['name'] . '(' . $entry_num . ')'
87
    );
88
    if ($just1gif) {
89
        // just 1 gif per a plugin & per a day
90
        $plugin_returns[$target_date][$plugin['dirname']] = $tmp_array;
91
    } else {
92
        // multiple gifs allowed per a plugin & per a day
93
        $plugin_returns[$target_date][] = $tmp_array;
94
    }
95
}
96

plugins/monthly/weblog-date.php 1 location

@@ 73-97 (lines=25) @@
70
                      . $add_whr
71
                      . $group_by;
72
$result             = $db->query($weblog_minical_sql);
73
while (list($title, $blog_id, $server_time, $entry_num) = $db->fetchRow($result)) {
74
    $user_time = $server_time + $tzoffset_s2u;
75
    $entry_num = ($entry_num > 1) ? $entry_num . 'entries' : $entry_num . 'entry';
76
    if (date('n', $user_time) != $this->month) {
77
        continue;
78
    }
79
    $target_date = date('j', $user_time);
80
    $tmp_array   = array(
81
        'dotgif'      => $plugin['dotgif'],
82
        'dirname'     => $plugin['dirname'],
83
        'link'        => XOOPS_URL . '/modules/' . $plugin['dirname'] . '/index.php?caldate=' . date('Y-n-j', $user_time) . '&date=' . date('Ymd', $user_time),
84
        'id'          => $blog_id . $server_time,
85
        'server_time' => $server_time,
86
        'user_time'   => $user_time,
87
        'name'        => 'blog_id',
88
        'title'       => $plugin['name'] . '(' . $entry_num . ')'
89
    );
90
    if ($just1gif) {
91
        // just 1 gif per a plugin & per a day
92
        $plugin_returns[$target_date][$plugin['dirname']] = $tmp_array;
93
    } else {
94
        // multiple gifs allowed per a plugin & per a day
95
        $plugin_returns[$target_date][] = $tmp_array;
96
    }
97
}
98

plugins/weekly/weblog-date.php 1 location

@@ 74-96 (lines=23) @@
71
                      . $add_whr
72
                      . $group_by;
73
$result             = $db->query($weblog_minical_sql);
74
while (list($title, $blog_id, $server_time, $entry_num) = $db->fetchRow($result)) {
75
    $user_time = $server_time + $tzoffset_s2u;
76
    $entry_num = ($entry_num > 1) ? $entry_num . 'entries' : $entry_num . 'entry';
77
    //        if( date( 'n' , $user_time ) != $this->month ) continue ;
78
    $target_date = date('j', $user_time);
79
    $tmp_array   = array(
80
        'dotgif'      => $plugin['dotgif'],
81
        'dirname'     => $plugin['dirname'],
82
        'link'        => XOOPS_URL . '/modules/' . $plugin['dirname'] . '/index.php?caldate=' . date('Y-n-j', $user_time) . '&date=' . date('Ymd', $user_time),
83
        'id'          => $blog_id . $server_time,
84
        'server_time' => $server_time,
85
        'user_time'   => $user_time,
86
        'name'        => 'blog_id',
87
        'title'       => $plugin['name'] . '(' . $entry_num . ')'
88
    );
89
    if ($just1gif) {
90
        // just 1 gif per a plugin & per a day
91
        $plugin_returns[$target_date][$plugin['dirname']] = $tmp_array;
92
    } else {
93
        // multiple gifs allowed per a plugin & per a day
94
        $plugin_returns[$target_date][] = $tmp_array;
95
    }
96
}
97