diff --git a/_wip_todo/settings/config.ini b/_wip_todo/settings/config.ini new file mode 100644 index 0000000..a49498c --- /dev/null +++ b/_wip_todo/settings/config.ini @@ -0,0 +1,54 @@ +; timeline / twtxt-php +; Copy this file into a config.ini file and edit the following settings + +[main_settings] +; Enable to display PHP errors +; true or false +debug_mode = false + +; Time to wait before reloading URLs +cache_refresh_time = 15 + +; Max execution time to avoid running to the infinite +max_execution_time = 300 + +; Title of your website +; used to navigate to the root of your domain +site_title = "Timeline" + +; Check that your current user has permissions for this file +; Check also the user owner is correct, www-data for instance +; TODO: Implement a way to know we have access to this file +; since there are many different conditions for not having +; access. +txt_file_path = "twtxt.txt" + +; Full URL for your public twtxt.txt file +public_txt_url = "https://example.com/timeline/twtxt.txt" +public_avatar = "https://example.com/timeline/avatar.png" +public_nick = "Timeline" + +; Check available timezones here: +; https://www.php.net/manual/en/timezones.php +timezone = "Europe/Copenhagen" + +twts_per_page = 50 + +; E-mail for comments +email = "" + +; Webmentions log file +webmentions_txt_path = "./mentions.txt" +public_webmentions = "https://example.com/timeline/mentions.txt" + +[security] +; Generate it with the TOTP module +totp_digits = 10 +totp_secret = "1234567890" + +; It's recommended that your site is hosted on HTTPS +; In case it's in HTTP (not secure), set this to false +secure_cookies = true + +; Simple password for unnamed user +password = "" \ No newline at end of file diff --git a/_wip_todo/settings/index.php b/_wip_todo/settings/index.php new file mode 100644 index 0000000..780ceb6 --- /dev/null +++ b/_wip_todo/settings/index.php @@ -0,0 +1,27 @@ +"); +print_r($config); +print_r(""); + +if ($config !== false) { + +echo '

Settings for Timeline

'; + +// TODO: Hardcode each for field and set types +foreach ($config as $key => $value) { + echo '


'; + echo '

'; +} + +echo '
'; + +} else { + echo 'Read INI file Failed.'; +} + + diff --git a/_wip_todo/settings/settings.php b/_wip_todo/settings/settings.php new file mode 100644 index 0000000..45a77c4 --- /dev/null +++ b/_wip_todo/settings/settings.php @@ -0,0 +1,150 @@ + + + + + + + + +

Settings for Timeline

+ +
+ +
+ Advanced + +

+ + +

+ +

+ + +

+

+ + +

+ +
+ +
+ Metadata + +

+ + +

+

+ + +

+ +

+ TODO: The following should be pulled from your twtxt.txt
+ TODO: or should it be saved totwtxt.txt? +

+

+ + +

+

+ + +

+

+ + +

+
+ + +
+ Interface +

+

+

+ + + +

+

+ + +

+
+ +
+ Integrations +

+ + +

+

+ + +

+ +

+ + +

+ +
+ +
+ Login + +

+ + +

+

+ + +

+

+ + + + It's recommended that your site is hosted on HTTPS. + In case it's in HTTP (not secure), turn this off + +

+

+ + +

+ + +
+ +
+ + + +"); +print_r($config); +print_r($configWithSections); +print_r(""); + + + +?> diff --git a/_wip_todo/settings/timezone.php b/_wip_todo/settings/timezone.php new file mode 100644 index 0000000..e1bf472 --- /dev/null +++ b/_wip_todo/settings/timezone.php @@ -0,0 +1,47 @@ + DateTimeZone::AFRICA, + 'America' => DateTimeZone::AMERICA, + 'Antarctica' => DateTimeZone::ANTARCTICA, + 'Aisa' => DateTimeZone::ASIA, + 'Atlantic' => DateTimeZone::ATLANTIC, + 'Europe' => DateTimeZone::EUROPE, + 'Indian' => DateTimeZone::INDIAN, + 'Pacific' => DateTimeZone::PACIFIC +); + +$timezones = array(); +foreach ($regions as $name => $mask) +{ + $zones = DateTimeZone::listIdentifiers($mask); + foreach($zones as $timezone) + { + // Lets sample the time there right now + //$time = new DateTime("Europe/London", new DateTimeZone($timezone)); + + // Us dumb Americans can't handle millitary time + //$ampm = $time->format('H') > 12 ? ' ('. $time->format('g:i a'). ')' : ''; + + // Remove region name and add a sample time + $timezones[$name][$timezone] = substr($timezone, strlen($name) + 1); // . ' - ' . $time->format('H:i') . $ampm; + } +} + + +// View + +print ''; \ No newline at end of file diff --git a/_wip_todo/settings/timezone2.php b/_wip_todo/settings/timezone2.php new file mode 100644 index 0000000..51ffa7f --- /dev/null +++ b/_wip_todo/settings/timezone2.php @@ -0,0 +1,49 @@ + (int)$currentTimezone->getOffset($utcTime), + 'identifier' => $timezoneIdentifier + ); + } + + // Sort the array by offset,identifier ascending + usort($tempTimezones, function($a, $b) { + return ($a['offset'] == $b['offset']) + ? strcmp($a['identifier'], $b['identifier']) + : $a['offset'] - $b['offset']; + }); + + $timezoneList = array(); + foreach ($tempTimezones as $tz) { + $sign = ($tz['offset'] > 0) ? '+' : '-'; + $offset = gmdate('H:i', abs($tz['offset'])); + $tz['identifier'] = str_replace('_', ' ', $tz['identifier']); + $timezoneList[$tz['identifier']] = $tz['identifier'] . ' (UTC ' . $sign . $offset . ')'; + } + + return $timezoneList; +} + +$timezoneList = timezoneList(); +echo ''; \ No newline at end of file