Code Duplication    Length = 18-18 lines in 5 locations

plugins/weekly/myalbum-p-photos.php 1 location

@@ 63-80 (lines=18) @@
60
// query (added 86400 second margin "begin" & "end")
61
$result = $db->query('SELECT title,lid,`date` FROM ' . $db->prefix("myalbum{$mydirnumber}_photos") . " WHERE ($whr_cid) AND `date` >= $range_start_s AND `date` < $range_end_s AND `status` > 0");
62
63
while (list($title, $id, $server_time) = $db->fetchRow($result)) {
64
    $user_time = $server_time + $tzoffset_s2u;
65
    // if( date( 'n' , $user_time ) != $this->month ) continue ;
66
    $target_date = date('j', $user_time);
67
    $tmp_array   = array(
68
        'dotgif'      => $plugin['dotgif'],
69
        'dirname'     => $plugin['dirname'],
70
        'link'        => XOOPS_URL . "/modules/{$plugin['dirname']}/photo.php?lid=$id&amp;caldate={$this->year}-{$this->month}-$target_date",
71
        'id'          => $id,
72
        'server_time' => $server_time,
73
        'user_time'   => $user_time,
74
        'name'        => 'lid',
75
        'title'       => $myts->htmlSpecialChars($title)
76
    );
77
78
    // multiple gifs allowed per a plugin & per a day
79
    $plugin_returns[$target_date][] = $tmp_array;
80
}
81

plugins/weekly/mydownloads.php 1 location

@@ 48-65 (lines=18) @@
45
// query (added 86400 second margin "begin" & "end")
46
$result = $db->query('SELECT title,lid,`date`,cid FROM ' . $db->prefix('mydownloads_downloads') . " WHERE `date` >= $range_start_s AND `date` < $range_end_s AND `status` > 0");
47
48
while (list($title, $id, $server_time, $cid) = $db->fetchRow($result)) {
49
    $user_time = $server_time + $tzoffset_s2u;
50
    // if( date( 'n' , $user_time ) != $this->month ) continue ;
51
    $target_date = date('j', $user_time);
52
    $tmp_array   = array(
53
        'dotgif'      => $plugin['dotgif'],
54
        'dirname'     => $plugin['dirname'],
55
        'link'        => XOOPS_URL . "/modules/{$plugin['dirname']}/singlefile.php?lid=$id&amp;cid=$cid&amp;caldate={$this->year}-{$this->month}-$target_date",
56
        'id'          => $id,
57
        'server_time' => $server_time,
58
        'user_time'   => $user_time,
59
        'name'        => 'lid',
60
        'title'       => $myts->htmlSpecialChars($title)
61
    );
62
63
    // multiple gifs allowed per a plugin & per a day
64
    $plugin_returns[$target_date][] = $tmp_array;
65
}
66

plugins/weekly/mylinks.php 1 location

@@ 48-65 (lines=18) @@
45
// query (added 86400 second margin "begin" & "end")
46
$result = $db->query('SELECT title,lid,`date`,cid FROM ' . $db->prefix('mylinks_links') . " WHERE `date` >= $range_start_s AND `date` < $range_end_s AND `status` > 0");
47
48
while (list($title, $id, $server_time, $cid) = $db->fetchRow($result)) {
49
    $user_time = $server_time + $tzoffset_s2u;
50
    // if( date( 'n' , $user_time ) != $this->month ) continue ;
51
    $target_date = date('j', $user_time);
52
    $tmp_array   = array(
53
        'dotgif'      => $plugin['dotgif'],
54
        'dirname'     => $plugin['dirname'],
55
        'link'        => XOOPS_URL . "/modules/{$plugin['dirname']}/singlelink.php?lid=$id&amp;cid=$cid&amp;caldate={$this->year}-{$this->month}-$target_date",
56
        'id'          => $id,
57
        'server_time' => $server_time,
58
        'user_time'   => $user_time,
59
        'name'        => 'lid',
60
        'title'       => $myts->htmlSpecialChars($title)
61
    );
62
63
    // multiple gifs allowed per a plugin & per a day
64
    $plugin_returns[$target_date][] = $tmp_array;
65
}
66

plugins/weekly/weblinks.php 1 location

@@ 48-65 (lines=18) @@
45
// query (added 86400 second margin "begin" & "end")
46
$result = $db->query('SELECT title,lid,`time_update` FROM ' . $db->prefix('weblinks_link') . " WHERE `time_update` >= $range_start_s AND `time_update` < $range_end_s");
47
48
while (list($title, $id, $server_time) = $db->fetchRow($result)) {
49
    $user_time = $server_time + $tzoffset_s2u;
50
    // if( date( 'n' , $user_time ) != $this->month ) continue ;
51
    $target_date = date('j', $user_time);
52
    $tmp_array   = array(
53
        'dotgif'      => $plugin['dotgif'],
54
        'dirname'     => $plugin['dirname'],
55
        'link'        => XOOPS_URL . "/modules/{$plugin['dirname']}/singlelink.php?lid=$id&amp;caldate={$this->year}-{$this->month}-$target_date",
56
        'id'          => $id,
57
        'server_time' => $server_time,
58
        'user_time'   => $user_time,
59
        'name'        => 'lid',
60
        'title'       => $myts->htmlSpecialChars($title)
61
    );
62
63
    // multiple gifs allowed per a plugin & per a day
64
    $plugin_returns[$target_date][] = $tmp_array;
65
}
66

plugins/weekly/yomi.php 1 location

@@ 47-64 (lines=18) @@
44
// query (added 86400 second margin "begin" & "end")
45
$result = $db->query('SELECT title,id,`stamp` FROM ' . $db->prefix('yomi_log') . " WHERE `stamp` >= $range_start_s AND `stamp` < $range_end_s");
46
47
while (list($title, $id, $server_time) = $db->fetchRow($result)) {
48
    $user_time = $server_time + $tzoffset_s2u;
49
    // if( date( 'n' , $user_time ) != $this->month ) continue ;
50
    $target_date = date('j', $user_time);
51
    $tmp_array   = array(
52
        'dotgif'      => $plugin['dotgif'],
53
        'dirname'     => $plugin['dirname'],
54
        'link'        => XOOPS_URL . "/modules/{$plugin['dirname']}/single_link.php?item_id=$id&amp;caldate={$this->year}-{$this->month}-$target_date",
55
        'id'          => $id,
56
        'server_time' => $server_time,
57
        'user_time'   => $user_time,
58
        'name'        => 'item_id',
59
        'title'       => $myts->htmlSpecialChars($title)
60
    );
61
62
    // multiple gifs allowed per a plugin & per a day
63
    $plugin_returns[$target_date][] = $tmp_array;
64
}
65