Code Duplication    Length = 22-24 lines in 3 locations

plugins/daily/weblog-blogid.php 1 location

@@ 74-95 (lines=22) @@
71
                      . $add_whr
72
                      . $group_by;
73
$result             = $db->query($weblog_minical_sql);
74
while (list($title, $blog_id, $server_time) = $db->fetchRow($result)) {
75
    $user_time = $server_time + $tzoffset_s2u;
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'] . '/details.php?blog_id=' . $blog_id,
82
        'id'          => $blog_id . $server_time,
83
        'server_time' => $server_time,
84
        'user_time'   => $user_time,
85
        'name'        => 'blog_id',
86
        'title'       => $myts->htmlSpecialChars($title)
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-blogid.php 1 location

@@ 73-96 (lines=24) @@
70
                      . $add_whr
71
                      . $group_by;
72
$result             = $db->query($weblog_minical_sql);
73
while (list($title, $blog_id, $server_time) = $db->fetchRow($result)) {
74
    $user_time = $server_time + $tzoffset_s2u;
75
    if (date('n', $user_time) != $this->month) {
76
        continue;
77
    }
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'] . '/details.php?blog_id=' . $blog_id,
83
        'id'          => $blog_id . $server_time,
84
        'server_time' => $server_time,
85
        'user_time'   => $user_time,
86
        'name'        => 'blog_id',
87
        'title'       => $myts->htmlSpecialChars($title)
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

plugins/weekly/weblog-blogid.php 1 location

@@ 74-95 (lines=22) @@
71
                      . $add_whr
72
                      . $group_by;
73
$result             = $db->query($weblog_minical_sql);
74
while (list($title, $blog_id, $server_time) = $db->fetchRow($result)) {
75
    $user_time = $server_time + $tzoffset_s2u;
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'] . '/details.php?blog_id=' . $blog_id,
82
        'id'          => $blog_id . $server_time,
83
        'server_time' => $server_time,
84
        'user_time'   => $user_time,
85
        'name'        => 'blog_id',
86
        'title'       => $myts->htmlSpecialChars($title)
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