commit 19a5dbb07cd6890b89751dc976ef4569fde51a56 Author: mappu Date: Sat Sep 21 13:22:48 2013 +1200 initial commit diff --git a/.hgignore b/.hgignore new file mode 100644 index 0000000..bfe7df4 --- /dev/null +++ b/.hgignore @@ -0,0 +1,2 @@ +wwwroot/* +nbproject/* \ No newline at end of file diff --git a/data/0010-oldutil/README.txt b/data/0010-oldutil/README.txt new file mode 100644 index 0000000..523b80a --- /dev/null +++ b/data/0010-oldutil/README.txt @@ -0,0 +1,3 @@ +assorted old projects + +A longer description goes here. \ No newline at end of file diff --git a/index_template.htm b/index_template.htm new file mode 100644 index 0000000..e69de29 diff --git a/page_template.htm b/page_template.htm new file mode 100644 index 0000000..6d92929 --- /dev/null +++ b/page_template.htm @@ -0,0 +1,20 @@ + + + + + + + +

##PROJECTNAME##

+ +

##DESCRIPTION##

+ + ##IMAGESECTION## + + ##ENDIMAGESECTION## + + ##DOWNLOADSECTION## + ##FILENAME## + ##ENDDOWNLOADSECTION## + + diff --git a/rebuild.cmd b/rebuild.cmd new file mode 100644 index 0000000..03c72f3 --- /dev/null +++ b/rebuild.cmd @@ -0,0 +1,3 @@ +@echo off +C:\bin\php54\php.exe rebuild.php +pause \ No newline at end of file diff --git a/rebuild.php b/rebuild.php new file mode 100644 index 0000000..b10aa85 --- /dev/null +++ b/rebuild.php @@ -0,0 +1,105 @@ +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 + +