"; if (!isset($chunksPerPage)) $chunksPerPage = 1; if (!isset($sort)) $sort = 'date'; if (!isset($label)) $label = 0; if (!isset($category)) $category = 'all'; if (!isset($section)) $section = 'daily'; if (!isset($sec)) $sec = $section; if (!isset($template)) $template = 'single-image'; if ( $sec == 'blog' ) $template = 'single-text'; 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"]) == $sec) 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; } $thefilename = $chunkData[0]["!!!filename"]; $template = "single-".$chunkData[0]["template"]; $body = $chunkData[0]["body"]; $section = $chunkData[0]["section"]; $category = $chunkData[0]["category"]; $title = $chunkData[0]["title"]; $date = $chunkData[0]["date"]; $emotikon = $chunkData[0]["emotikon"]; $subtitle = $chunkData[0]["subtitle"]; $location = $chunkData[0]["location"]; $image = $chunkData[0]["image"]; $URL = $chunkData[0]["URL"]; $onClick = $chunkData[0]["onClick"]; $author = $chunkData[0]["author"]; $authorURL = $chunkData[0]["authorURL"]; print ""; ?>