diff --git a/LICENSE b/LICENSE index ccdcdde..7c20f89 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 Trevor Slocum +Copyright (c) 2020 Trevor Slocum Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/imgboard.php b/imgboard.php index cfb21fb..d74f58d 100644 --- a/imgboard.php +++ b/imgboard.php @@ -1,7 +1,29 @@ + +MIT License + +Copyright (c) 2020 Trevor Slocum + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +*/ error_reporting(E_ALL); ini_set("display_errors", 1); @@ -57,6 +79,9 @@ foreach ($writedirs as $dir) { } $includes = array("inc/defines.php", "inc/functions.php", "inc/html.php"); +if (TINYIB_JSON) { + $includes[] = 'inc/json.php'; +} if (in_array(TINYIB_DBMODE, array('flatfile', 'mysql', 'mysqli', 'sqlite', 'sqlite3', 'pdo'))) { $includes[] = 'inc/database_' . TINYIB_DBMODE . '.php'; } else { @@ -71,6 +96,8 @@ if (TINYIB_TIMEZONE != '') { date_default_timezone_set(TINYIB_TIMEZONE); } +writePage('threads.json', buildThreadsJSON()); + $redirect = true; // Check if the request is to make a post if (!isset($_GET['delete']) && !isset($_GET['manage']) && (isset($_POST['name']) || isset($_POST['email']) || isset($_POST['subject']) || isset($_POST['message']) || isset($_POST['file']) || isset($_POST['embed']) || isset($_POST['password']))) { diff --git a/inc/defines.php b/inc/defines.php index b4054c4..4087dfb 100644 --- a/inc/defines.php +++ b/inc/defines.php @@ -43,6 +43,9 @@ if (!defined('TINYIB_WORDBREAK')) { if (!defined('TINYIB_TIMEZONE')) { define('TINYIB_TIMEZONE', ''); } +if (!defined('TINYIB_JSON')) { + define('TINYIB_JSON', true); +} if (!defined('TINYIB_DBMIGRATE')) { define('TINYIB_DBMIGRATE', false); } diff --git a/inc/json.php b/inc/json.php new file mode 100644 index 0000000..f25b9ae --- /dev/null +++ b/inc/json.php @@ -0,0 +1,16 @@ +