[Picfinity-commit] SF.net SVN: picfinity: [12]
Status: Beta
Brought to you by:
espadav8
From: <esp...@us...> - 2007-07-19 04:23:23
|
Revision: 12 http://picfinity.svn.sourceforge.net/picfinity/?rev=12&view=rev Author: espadav8 Date: 2007-07-18 21:23:25 -0700 (Wed, 18 Jul 2007) Log Message: ----------- Scan the ./.themes folder and add the themes to the layout of the XML file Update the DTD to show this as well Modified Paths: -------------- gallery.dtd index.php Modified: gallery.dtd =================================================================== --- gallery.dtd 2007-07-19 03:16:05 UTC (rev 11) +++ gallery.dtd 2007-07-19 04:23:25 UTC (rev 12) @@ -1,12 +1,20 @@ -<!ELEMENT layout (folder*)> +<!ELEMENT layout (folder*,themes)> <!ELEMENT folder (folder*,image*)> +<!ELEMENT themes (theme*)> <!ELEMENT image EMPTY> +<!ELEMENT theme EMPTY> -<!ATTLIST layout id ID #REQUIRED> +<!ATTLIST layout id ID #IMPLIED> <!ATTLIST layout name CDATA #REQUIRED> -<!ATTLIST folder id ID #REQUIRED> +<!ATTLIST folder id ID #IMPLIED> <!ATTLIST folder name CDATA #REQUIRED> -<!ATTLIST image id ID #REQUIRED> +<!ATTLIST themes id ID #IMPLIED> +<!ATTLIST themes name CDATA #REQUIRED> + +<!ATTLIST theme id ID #IMPLIED> +<!ATTLIST theme name CDATA #REQUIRED> + +<!ATTLIST image id ID #IMPLIED> <!ATTLIST image file CDATA #REQUIRED> \ No newline at end of file Modified: index.php =================================================================== --- index.php 2007-07-19 03:16:05 UTC (rev 11) +++ index.php 2007-07-19 04:23:25 UTC (rev 12) @@ -49,9 +49,15 @@ // for each entry while (list(,$folder_entry) = each($folder_contents)) { - if (strpos($folder_entry, '.') === 0) + if ((is_dir($folder . '/' . $folder_entry)) && + (($folder . '/' . $folder_entry) == "./.themes")) { + $layout['themes'] = create_themes_layout(); + } + else if (strpos($folder_entry, '.') === 0) + { // this is a hidden file/folder, ignore + continue; } // if it's a directory and doesn't start with a . else if (is_dir($folder . '/' . $folder_entry)) @@ -81,6 +87,27 @@ return $layout; } + function create_themes_layout() + { + $folder_contents = scandir(".themes"); + $layout = array('name' => '.themes', 'id' => uniqid('id')); + + // for each entry + while (list(,$folder_entry) = each($folder_contents)) + { + if (strpos($folder_entry, '.') === 0) + { + continue; + } + else if (is_dir(".themes/" . $folder_entry)) + { + $layout['theme'][] = array('name' => $folder_entry, 'id' => uniqid('id')); + } + } + + return $layout; + } + function create_thumbnail($folder, $image, $ext) { if (!is_dir('.thumbs/'.$folder)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |