2011-12-05, 06:55:09
Hi,
This is a feature that I think would be great to add to the GS core.
A loop function in the admin/basic/theme_functions.php to loop through all the pages that are children of some parent.
The $LANG appended to the GSDATAPAGESPATH is a remnant of a previous post:
http://get-simple.info/forum/topic/2965/...-the-code/
A functional demo of this loop can be observed at:
http://getsimple.mechantdesign.com/en_US/videos/
Please let me know what you think of this.
Thank you.
This is a feature that I think would be great to add to the GS core.
A loop function in the admin/basic/theme_functions.php to loop through all the pages that are children of some parent.
The $LANG appended to the GSDATAPAGESPATH is a remnant of a previous post:
http://get-simple.info/forum/topic/2965/...-the-code/
A functional demo of this loop can be observed at:
http://getsimple.mechantdesign.com/en_US/videos/
Code:
function loop($parent = null) {
global $LANG;
$path = GSDATAPAGESPATH . $LANG . '/';
$dir_handle = opendir($path) or die("Unable to open $path");
$filenames = array();
while ($filename = readdir($dir_handle)) {
$filenames[] = $filename;
}
closedir($dir_handle);
$count="0";
$pagesArray = array();
if (count($filenames) != 0) {
foreach ($filenames as $file) {
if ($file == "." || $file == ".." || is_dir($path . $file) || $file == ".htaccess" ) {
// not a page data file
} else {
$data = getXML($path . $file);
if ($data->private != 'Y' && $data->parent == $parent) {
$pagesArray[$count] = $data;
$count++;
}
}
}
}
return $pagesArray;
}
Please let me know what you think of this.
Thank you.