Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 95... Línea 95...
95
        global $CFG, $DB;
95
        global $CFG, $DB;
Línea 96... Línea 96...
96
 
96
 
Línea 97... Línea 97...
97
        $timenow = time();
97
        $timenow = time();
98
 
98
 
99
        // Delete any really old posts in the digest queue.
99
        // Delete any really old posts in the digest queue.
-
 
100
        $weekago = $timenow - WEEKSECS;
-
 
101
        $this->log_start("Removing old digest records from 7 days ago.");
-
 
102
 
-
 
103
        $selectsqlcondition = "timemodified < :weekago
-
 
104
            AND discussionid IN (SELECT id FROM {forum_discussions} WHERE timestart < :holdperiod)";
-
 
105
 
-
 
106
        $params = [
-
 
107
            'weekago' => $weekago,
-
 
108
            'holdperiod' => $weekago,
100
        $weekago = $timenow - (7 * 24 * 3600);
109
        ];
101
        $this->log_start("Removing old digest records from 7 days ago.");
110
 
Línea 102... Línea 111...
102
        $DB->delete_records_select('forum_queue', "timemodified < ?", array($weekago));
111
        $DB->delete_records_select('forum_queue', $selectsqlcondition, $params);
103
        $this->log_finish("Removed all old digest records.");
112
        $this->log_finish("Removed all old digest records.");
104
 
113