diff --git a/rebuild.php b/rebuild.php index b980b8c..09753e1 100644 --- a/rebuild.php +++ b/rebuild.php @@ -124,6 +124,7 @@ class CProject { private $longdesc = ''; private $images = array(); private $downloads = array(); + public $tags = array(); public $homeimage = null; @@ -144,6 +145,10 @@ class CProject { $this->subtag = rtrim($matches[1], ' .'); } + if (preg_match('~Tags: ([^\\r\\n]+)~', $this->longdesc, $matches)) { + $this->tags = array_map('trim', explode(',', $matches[1])); + } + $this->shortdesc = array_shift(explode("\n", $this->longdesc)); $this->shortdesc[0] = strtolower($this->shortdesc[0]); // cosmetic lowercase continue; @@ -190,6 +195,14 @@ class CProject { file_put_contents(BASEDIR.'wwwroot/'.$this->projname.'.html', $idxfile); } + public function getClassAttr() { + if (count($this->tags)) { + return 'taggedWith-'.implode(' taggedWith-', $this->tags); + } else { + return ''; + } + } + public function index() { ?>

projname)?>

@@ -322,7 +335,7 @@ function buildall() { - + @@ -330,9 +343,17 @@ function buildall() { projname)?>, shortdesc)?> more... - subtag)) { ?> + subtag) || count($pr->tags)) { ?>
- subtag)?> + + subtag)?> + subtag) && count($pr->tags)) { ?> + :: + + tags as $tag) { ?> + + +
projname]) ? '
' : '
')?>