some stuff :3
adding support for text / terminal browsers redone some strings
This commit is contained in:
parent
97295fce69
commit
b201dbfc75
17 changed files with 169 additions and 73 deletions
40
src/loadEnv.php
Normal file
40
src/loadEnv.php
Normal file
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
libxml_use_internal_errors(true);
|
||||
// load config
|
||||
$cfg=parse_ini_file("serve.ini", true);
|
||||
|
||||
// load locale
|
||||
#$lang=locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
||||
$lang="en_US";
|
||||
$strings=parse_ini_file("data/locale/".$lang.".ini");
|
||||
|
||||
|
||||
// cookies
|
||||
if(!isset($_COOKIE['sts_theme'])){
|
||||
setcookie('sts_theme','default');
|
||||
$_COOKIE['sts_theme'] = 'default';
|
||||
}
|
||||
if(!isset($_COOKIE['sts_scripting'])){
|
||||
setcookie('sts_scripting','none');
|
||||
$_COOKIE['sts_scripting'] = 'none';
|
||||
}
|
||||
if(!isset($_COOKIE['sts_flags'])){
|
||||
setcookie('sts_flags',file_get_contents('data/xml/default.flags.xml'));
|
||||
$_COOKIE['sts_flags'] = simplexml_load_file('data/xml/default.flags.xml') or die('failed loading an xml file!');
|
||||
}else{
|
||||
$_COOKIE['sts_flags'] = simplexml_load_string($_COOKIE['sts_flags']);
|
||||
}
|
||||
|
||||
if ($_COOKIE['sts_flags'] === false) {
|
||||
http_response_code(500);
|
||||
header('Content-Type: text/plain; charset=utf-8');
|
||||
echo "An error occured within superTinySearch!\n\nWhat happened:\tfailed to parse cookie 'sts_flags'!\n\nAdditional info:\n";
|
||||
foreach(libxml_get_errors() as $error) {
|
||||
echo "\n\t", $error->message;
|
||||
}
|
||||
die(sprintf("\n\ncontact %s @ %s",$cfg['MAINTAINERS_0']['name'],$cfg['MAINTAINERS_0']['email']));
|
||||
}else{
|
||||
require 'src/validateSTSXML.php';
|
||||
validateXML($_COOKIE['sts_flags'],'flags');
|
||||
}
|
||||
?>
|
15
src/pages/modern/index.php
Normal file
15
src/pages/modern/index.php
Normal file
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
echo "<h1 title=\"".$strings['misc_stslogohover']."\">".file_get_contents("data/misc/icon/html.html")."</h1><br>";
|
||||
?>
|
||||
<?php
|
||||
echo "<div class=\"searchbox\"><form id=\"searchbox\">\n";
|
||||
echo "<input class=\"sbox\" type=\"".$_COOKIE['sts_flags']['index']['sbox_type']."\" placeholder=\"".$strings['interactions_searcharea_hint']."\" name=\"query\">";
|
||||
echo "<input type=\"submit\" action=\"search.php\" formmethod=\"get\" value=\"".$strings['interactions_basic_search']."\">\n";
|
||||
echo "</form></div>"
|
||||
?>
|
||||
|
||||
<iframe style="position:absolute;bottom:30px;right:10px;" src="dynamicGen.php?content=aboutserver" width="376" height="276"></iframe>
|
||||
<div class="footer">
|
||||
<div class="footeri right">
|
||||
</div>
|
||||
</div>
|
0
src/pages/text/about.php
Normal file
0
src/pages/text/about.php
Normal file
9
src/pages/text/footer.php
Normal file
9
src/pages/text/footer.php
Normal file
|
@ -0,0 +1,9 @@
|
|||
<hr>
|
||||
<footer>
|
||||
<div class="footer left">
|
||||
|
||||
</div>
|
||||
<div class="footer right">
|
||||
|
||||
</div>
|
||||
</footer>
|
9
src/pages/text/header.php
Normal file
9
src/pages/text/header.php
Normal file
|
@ -0,0 +1,9 @@
|
|||
<header>
|
||||
<div class="header left">
|
||||
<a href="index.php">[sts]</a>
|
||||
</div>
|
||||
<div class="header right">
|
||||
<a href="about.php">About</a>
|
||||
</div>
|
||||
</header>
|
||||
<hr>
|
1
src/pages/text/index.php
Normal file
1
src/pages/text/index.php
Normal file
|
@ -0,0 +1 @@
|
|||
<?php include 'header.php'; ?>
|
Loading…
Add table
Add a link
Reference in a new issue