dir = BASEDIR.'data/'.$dirname.'/'; $this->projname = $projname; // Identify resources in folder $ls = scandir($this->dir); foreach($ls as $file) { if ($file[0] == '.') continue; if ($file == 'README.txt') { $this->longdesc = file_get_contents($this->dir.'README.txt'); $this->shortdesc = array_shift(explode("\n", $this->longdesc)); continue; } if (is_image($file)) { $this->images[] = $file; } else { $this->downloads[] = $file; } } } public function write() { // Build file mapping // Generate image thumbnails // Copy data files to wwwroot // Generate index page } } // Format project $pagetpl = @file_get_contents(BASEDIR.'page_template.htm'); if ($pagetpl === false) die('Missing page_template.htm'); foreach($projects as $dirname => $projectname) { $pr = new CProject($dirname, $projectname); print_r($pr); } // Index page