"; if (!isset($chunksPerPage)) $chunksPerPage = 80; if (!isset($sort)) $sort = 'date'; if (!isset($label)) $label = 0; if (!isset($category)) $category = 'all'; if (!isset($section)) $section = 'daily'; if (!isset($template)) $template = 'categories'; if (!isset($showall)) $showall = 0 ; $formatFile = "admin.chunkformat.txt"; include("chunkcommon.php"); if(!isset($page)) $page = 0; grabFormat(); $chunkDataUnculled = getChunkData(); //here's where we exclude whatever chunks have been picked up from the directory list. //we go through and select each element of chunkDataUnculled and if it's what we want, we'll add it to the good list called 'chunkData' for($x = 0; $x < count($chunkDataUnculled); $x++) { $curChunkData = $chunkDataUnculled[$x]; //here we grab out the current chunkData //now come the conditions if( ( strtolower($curChunkData["section"]) == $section ) and ( (strtolower($curChunkData["category"]) == $category) or (($category == 'all') and strtolower($curChunkData["category"]) != 'root' ) ) and ( ( strtolower($curChunkData["status"]) == 'live' or $showall == 1 ) // shows only "status : active" posts, unless 'showall' is set to 1 ) ) { if ( $sort == 'alpha' ) $chunkDataByName[$curChunkData["title"]] = $curChunkData; //then add it to the list of chunks to show else if ( $sort == 'rdate' ) $chunkDataByName[$curChunkData["!!!filename"]] = $curChunkData; //then add it to the list of chunks to show else $chunkData[] = $curChunkData; //then add it to the list of chunks to show } } if ( $sort == 'alpha' or $sort == 'rdate' ) // sort alphabetically { ksort($chunkDataByName); $chunkData = Array(); foreach($chunkDataByName as $chunk) $chunkData[] = $chunk; } if( $label == 1 ){ print ""; print "
" . ucwords( $category )."
"; } print "
"; $numPages = ceil(sizeof($chunkData) / $chunksPerPage); $firstChunkIndex = $page * $chunksPerPage; $lastChunkIndex = $firstChunkIndex + $chunksPerPage - 1; if($lastChunkIndex > sizeof($chunkData) - 1) $lastChunkIndex = sizeof($chunkData) - 1; for($x = $firstChunkIndex; $x <= $lastChunkIndex; $x++){ include("template-".$template.".php"); } ?>