<div class="content" style="background-color: #2222AA; opacity: 0.9; padding: 10px;"> <? display_block("home"); ?> </div> </div> <div id="slide2"> <div class="content"> <div class="quotes_container"> <? display_block("demo"); ?> </div> </div> </div> <div id="slide3"> <div class="content" > <div class="quotes_container"> <div class="content" style="background-color: #2222AA; opacity: 0.9; padding: 10px; text-align: left;"> <? display_block("datasets"); ?> </div> </div> </div> </div> <div id="slide4"> <div class="content"> <? display_block("contact"); ?> </div> </div> </body> </html>
function build_blocks($items, $folder) { global $ignore_file_list, $ignore_ext_list, $sort_by, $toggle_sub_folders; $objects = array(); $objects['directories'] = array(); $objects['files'] = array(); foreach ($items as $c => $item) { if ($item == ".." or $item == ".") { continue; } // IGNORE FILE if (in_array($item, $ignore_file_list)) { continue; } if ($folder) { $item = "{$folder}/{$item}"; } $file_ext = getFileExt($item); // IGNORE EXT if (in_array($file_ext, $ignore_ext_list)) { continue; } // DIRECTORIES if (is_dir($item)) { $objects['directories'][] = $item; continue; } // FILE DATE $file_time = date("U", filemtime($item)); // FILES $objects['files'][$file_time . "-" . $item] = $item; } foreach ($objects['directories'] as $c => $file) { display_block($file); if ($toggle_sub_folders) { $sub_items = (array) scandir($file); if ($sub_items) { echo "<div class='sub' data-folder=\"{$file}\">"; build_blocks($sub_items, $file); echo "</div>"; } } } // SORT BEFORE LOOP if ($sort_by == "date_asc") { ksort($objects['files']); } elseif ($sort_by == "date_desc") { krsort($objects['files']); } elseif ($sort_by == "name_asc") { natsort($objects['files']); } elseif ($sort_by == "name_desc") { arsort($objects['files']); } foreach ($objects['files'] as $t => $file) { $fileExt = getFileExt($file); if (in_array($file, $ignore_file_list)) { continue; } if (in_array($fileExt, $ignore_ext_list)) { continue; } display_block($file); } }