mirror of
https://github.com/Clortox/SimpleFileRepository.git
synced 2025-01-10 02:47:59 +00:00
Make config more robust
This commit is contained in:
parent
610e15a68c
commit
187501c286
12
index.php
12
index.php
@ -30,7 +30,17 @@
|
|||||||
<h2>Folders</h2>
|
<h2>Folders</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<p>Select a catagory to start browsing</p>
|
<?php
|
||||||
|
if(!$isDir){
|
||||||
|
echo <<< errorblock
|
||||||
|
<h2><b>THERE ARE NO TRACKED DIRECTORIES,
|
||||||
|
OR THERE IS AN ERROR IN YOU CONFIGURATION.
|
||||||
|
PLEASE CHECK 'var/config'</b></h2>
|
||||||
|
errorblock;
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<p>Select a category to start browsing</p>
|
||||||
<table id="catTable" class="display table text-white">
|
<table id="catTable" class="display table text-white">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -14,11 +14,20 @@
|
|||||||
* These can start with "#" to direct to a tag on the page, could be an internal
|
* 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
|
* 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
|
* These associate in order ie the Tag $nav_names[3] will direct the user to
|
||||||
* the link in $nav_links[3]
|
* the link in $nav_links[3]
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$isNav = true;
|
||||||
|
$isrNav = true;
|
||||||
|
|
||||||
$nav_names = array(
|
$nav_names = array(
|
||||||
'Home',
|
'Home',
|
||||||
'Github',
|
'Github',
|
||||||
@ -29,6 +38,10 @@
|
|||||||
'https://github.com/Clortox',
|
'https://github.com/Clortox',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//$nav_rname = 'Git this site!';
|
||||||
|
//$nav_rlink = 'https://github.com/Clortox/SimpleFileRepository';
|
||||||
|
|
||||||
|
|
||||||
/* Directory Variables
|
/* Directory Variables
|
||||||
*
|
*
|
||||||
* Each variable in $dir_dirs will be a listing
|
* Each variable in $dir_dirs will be a listing
|
||||||
@ -43,6 +56,8 @@
|
|||||||
* the title $dir_names[3]
|
* the title $dir_names[3]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$isDir = true;
|
||||||
|
|
||||||
$dir_names = array(
|
$dir_names = array(
|
||||||
'Printable Guns',
|
'Printable Guns',
|
||||||
'GNU Software',
|
'GNU Software',
|
||||||
@ -85,4 +100,20 @@
|
|||||||
' is asking for help with their homework from ',
|
' 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;
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -12,16 +12,17 @@
|
|||||||
$saying = $convo[rand(0,count($convo)-1)];
|
$saying = $convo[rand(0,count($convo)-1)];
|
||||||
echo '<p>' . $clientip . $saying . $serverip . '</p>';
|
echo '<p>' . $clientip . $saying . $serverip . '</p>';
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
|
|
||||||
<nav class="navbar navbar-expand-lg navbar-dark border border-secondary">
|
if($isNav){
|
||||||
<?php
|
echo '<nav class="navbar navbar-expand-lg
|
||||||
foreach($nav_names as $index=>$name){
|
navbar-dark border border-secondary">';
|
||||||
echo '<a class="navbar-brand" href="' . $nav_links[$index] . '">'
|
foreach($nav_names as $index=>$name){
|
||||||
. $name . '</a>';
|
echo '<a class="navbar-brand" href="' . $nav_links[$index] . '">'
|
||||||
}
|
. $name . '</a>';
|
||||||
?>
|
}
|
||||||
</nav>
|
echo '</nav>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user