Make config more robust

This commit is contained in:
Clortox
2021-01-04 19:18:26 -05:00
parent 610e15a68c
commit 187501c286
3 changed files with 52 additions and 10 deletions

View File

@@ -14,11 +14,20 @@
* These can start with "#" to direct to a tag on the page, could be an internal
* link by using "/listing.php?folder=SomeFolder", or could be an external site
*
* $nav_rname and $nav_rlink are for a link on the right side of the nav bar.
* This link is by default an ad for this repo, however you can disable it by
* setting $isrNav to false, or change it to advertise anything you choose!
*
* The navbar can be disabled by changing isNav to false
*
* These associate in order ie the Tag $nav_names[3] will direct the user to
* the link in $nav_links[3]
*
*/
$isNav = true;
$isrNav = true;
$nav_names = array(
'Home',
'Github',
@@ -29,6 +38,10 @@
'https://github.com/Clortox',
);
//$nav_rname = 'Git this site!';
//$nav_rlink = 'https://github.com/Clortox/SimpleFileRepository';
/* Directory Variables
*
* Each variable in $dir_dirs will be a listing
@@ -43,6 +56,8 @@
* the title $dir_names[3]
*/
$isDir = true;
$dir_names = array(
'Printable Guns',
'GNU Software',
@@ -85,4 +100,20 @@
' is asking for help with their homework from ',
);
//Be safe, check arrays
if(empty($nav_names) or empty($nav_links)){
$isNav = false;
} else if(count($nav_names) !== count($nav_links)){
$isNav = false;
}
if(empty($dir_names) or empty($dir_dirs)){
$isDir = false;
} else if (count($dir_names) !== count($dir_dirs)){
$isDir = false;
}
if(empty($convo)){
$isConvo = false;
}
?>