enable = $_SESSION['customize']['enable']; $archs = $archs ? $archs : array(""); $base = ""; if ($version) { foreach ($archs as $arch) { $path = $arch ? "/".$class."/".$arch."/isos" : ""; $downloaddir = $GLOBALS['config']['download'].$version.$path."-".$system; if(!is_dir($downloaddir)) { $downloaddir = $GLOBALS['config']['download'].$version.$path; } // base image tgz file if ($d = @dir ($downloaddir."/")) { while ($f = $d->read ()) { if (is_file ($d->path.$f) && preg_match ("/MLD-[^_]+_base[-_].+\.tgz/", $f) && $d->path.$f > $base) { $base = $d->path.$f; } } $d->close (); } } $_SESSION['customize']['base'] = $base; } foreach(preg_split("/\n/", @file_get_contents(dirname($base)."/collections")) as $collection) { if ($collection) { list($key, $value) = preg_split("/ *= */", $collection); $this->collections[$key] = $value; } } // download Statistik $db = new Database ("data", $GLOBALS['config']['db']); $filename = preg_replace ("/.*\/(.*)_base([-_])(.*)/", "\\1_customize\\2\\3", $base); $system_version = preg_replace ("/.*?-(.*?)_.*/", "\\1", $base); if ($db->query ("SELECT access FROM state WHERE filename='$filename'")) { $this->klick = $db['access']; } else { $version = preg_replace ("/.*_(.+)_.+\.tgz/", "\\1", $base); $db->query ("INSERT INTO state (name, version, system_version, filename, time, state, access) VALUES ('customize', '$version', '$system_version', '$filename', NOW(), 0, 0)"); } if ($db->query ("SELECT SUM(access) AS access_sum FROM state WHERE name='customize' AND system_version='$system_version'")) { $this->klicksum = $db['access_sum']; } } function getVersions () { $dirs = array (); $d = dir ($GLOBALS['config']['download']); while ($f = $d->read ()) { if ($f != "." && $f != ".." && is_dir ($d->path.$f)) { $dirs[] = $f; } } sort ($dirs); return $dirs; } } ?>