Reviewed-on: #20
This commit is contained in:
commit
b01c237d5d
18
blog/by_tag/index.php
Normal file → Executable file
18
blog/by_tag/index.php
Normal file → Executable file
@ -32,8 +32,7 @@
|
||||
//}
|
||||
//echo "</ul>\n";
|
||||
//}
|
||||
|
||||
# Tags rewrite
|
||||
function read_tags($tags_file){
|
||||
$tags_csv = array_map('str_getcsv', file('tags.csv'));
|
||||
$tags_rows = sizeof($tags_csv);
|
||||
$tags_coloums = sizeof($tags_csv[0]);
|
||||
@ -64,5 +63,20 @@
|
||||
$coloum_number++;
|
||||
}
|
||||
echo "</ul>\n";
|
||||
}
|
||||
|
||||
|
||||
# Tags rewrite
|
||||
if (file_exists('tags.csv')){
|
||||
read_tags('tags.csv');
|
||||
} elseif( file_exists('tags.csv.bak') ){
|
||||
if (copy('tags.csv.bak', './tags.csv')) {
|
||||
read_tags('tags.csv');
|
||||
}
|
||||
}else {
|
||||
$empty_csv = fopen("tags.csv", "w") or die("Cannot write new tags.csv file.");
|
||||
fwrite($empty_csv, "");
|
||||
fclose($empty_csv);
|
||||
}
|
||||
include_once ($_SERVER['DOCUMENT_ROOT'].'/common/php/footer.php');
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user