'; $papers = array(); foreach (glob('*'.PAPER_SUFFIX) as $k) { $metadata = json_decode(file_get_contents($k), true); $metadata['name'] = $k; $papers[$metadata["creation_time"]] = $metadata; } krsort($papers); foreach ($papers as $xx=>$metadata) { $k=$metadata['name']; $slug = substr($k,0,-strlen(PAPER_SUFFIX)); echo ''; echo ''."$slug.pdf".''; $status = "pb"; if (isset($metadata['redirect'])) { $status = "redirect"; if (preg_match('/^overleaf:(.*)/', $metadata['redirect'], $matches)) { $status = "overleaf"; } } if (file_exists(actual_file($slug))) { $status = "local"; if (isset($metadata['redirect'])) { $status = "OOPS both redirect and local"; } } echo ''.$status.''; // echo ''.json_encode($metadata).''; // echo ''."del".''; echo ''; } echo ''; } function form($paper=NULL) { ?>
New paper:
Paper id:
New paper with redirect / new redirect:
Paper id:
Redirect: