diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ece00d7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +config.php +data diff --git a/config.example.php b/config.example.php index 71dbad9..7ea51cb 100644 --- a/config.example.php +++ b/config.example.php @@ -1,7 +1,7 @@ = MAX_SAVED_URLS) - { - // Delete the first element - array_shift($data); + +function sort_array(&$array, $key, $order=SORT_DESC) { + $sort_keys = array(); + + foreach ($array as $key2 => $entry) { + $sort_keys[$key2] = $entry[$key]; } - // Add that to the array - array_push($data, $that); - return $data; + + + return array_multisort($sort_keys, $order, $array); } if(empty($_POST['url'])) { @@ -18,7 +17,7 @@ if(empty($_POST['url'])) { } else { if (is_readable(DATA_FILE)) { - $data = unserialize(gzinflate(file_get_contents(DATA_DIR.ASSOC_NAME))); + $data = unserialize(gzinflate(file_get_contents(DATA_FILE))); } else { $data = array(); @@ -29,7 +28,7 @@ else {
-Short link for:'.$url.''; ?>
+Short link for: '.$url.''; ?>