예제 #1
0
파일: cd.php 프로젝트: romlg/cms36
 function getStatVars()
 {
     $query = mysql_query("select * from {$this->cd_table}");
     $i = 0;
     $ret['itemz_count'] = mysql_num_rows($query);
     $ret['itemz_start'] = mysql_num_rows(mysql_query("select * from {$this->cd_table} where uptime=0"));
     while ($str = mysql_fetch_array($query)) {
         $ret['itemz'][$i][0] = $str['id'];
         $ret['itemz'][$i][1] = $str['uptime'];
         $ret['itemz'][$i][2] = str_replace("'", '"', name_path_by_id($str['id']));
         $i++;
     }
     return $ret;
 }
예제 #2
0
파일: wget.php 프로젝트: romlg/cms36
function wget($id, $console_file)
{
    global $url, $id_array, $backup_dir;
    $path = path_by_id($id);
    $namepath = name_path_by_id($id);
    fputs($console_file, "{$namepath}<br>\n");
    $a = file_get_contents($url . '/' . $path);
    $result = new_wget($a, $url . '/' . $path, true, $id_array);
    if (is_file($backup_dir . '/' . $path)) {
        unlink($backup_dir . '/' . $path);
    }
    if (str_replace('/', '_', $path) . '.html' == '.html') {
        $path = 'index';
    }
    $fp = fopen($backup_dir . '/' . str_replace('/', '_', $path) . '.html', 'wb');
    fputs($fp, $result->text);
    for ($i = 0; $i < sizeof($result->download_name); $i++) {
        copy_the_file($result->download_link[$i], $result->download_name[$i]);
    }
}