mirror of
https://github.com/sorenpeter/timeline.git
synced 2025-12-15 10:57:01 +00:00
fixed merge isseu
This commit is contained in:
commit
d4df383f4d
5 changed files with 34 additions and 39 deletions
|
|
@ -15,13 +15,15 @@ It then gives you an interface for posting words, links (and images too, soon),
|
|||
|
||||
For the social features timeline are using the [twtxt](https://twtxt.readthedocs.io) format and most of the twtxt Extensions developed in the context of Yarn.social](https://yarn.social/).
|
||||
|
||||
timeline also support its own flavor of WebMentions, so it is possible to be notified about `@mentions` from feeds you are not currently/yet following. You can also search for others feeds using WebFinger, if they got that set up on their server , like it's the case for most yarn.social pods.
|
||||
timeline also support its own flavor of WebMentions, so it is possible to be notified about `@mentions` from feeds you are not currently/yet following.
|
||||
You can also search for others feeds using [WebFinger](https://webfinger.net/), if they got that set up on their servser, like it's the case for most yarn.social pods.
|
||||
|
||||
My visions for timeline is to bring back the fun and quirkiness of bygone sites such as Geocities of the 1990s and Myspace of the 2000s, that enables creating a personalized place for you to express yourself online and also being able to follow others who inspire you.
|
||||
|
||||
At the same time providing a good looking basic design with the help of [Simple.css](https://simplecss.org), which allows you to customize the look and feel. Even to the level where timeline aligns with the design of your excsing webpage, like I did on: [darch.dk/timeline](https://darch.dk/timeline).
|
||||
|
||||
See my talk about twtxt and timeline at Piksel Festival 2024: https://www.darch.dk/twtxtalk-piksel
|
||||
|
||||

|
||||
_Conversation view with replies / Profile view / Gallery View_
|
||||
|
||||
|
|
|
|||
6
libs/load_timezone.php
Normal file
6
libs/load_timezone.php
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
$config = parse_ini_file('private/config.ini');
|
||||
|
||||
if (!date_default_timezone_set($config['timezone'])) {
|
||||
die('Not a valid timezone - Check your config.ini file');
|
||||
}
|
||||
|
|
@ -17,31 +17,20 @@ declare (strict_types = 1);
|
|||
#
|
||||
# hash(string) =
|
||||
|
||||
require_once('libs/session.php');
|
||||
require_once('libs/twtxt.php');
|
||||
require_once('libs/hash.php');
|
||||
require_once('libs/Parsedown.php');
|
||||
require_once 'libs/session.php';
|
||||
require_once 'libs/twtxt.php';
|
||||
require_once 'libs/hash.php';
|
||||
require_once 'libs/Parsedown.php';
|
||||
require_once 'libs/load_timezone.php';
|
||||
|
||||
const TWTS_PER_PAGE = 20;
|
||||
// TODO: Move twts per page to config.ini
|
||||
// Add a fallback if the number is invalid (it should be between 1 and 999)
|
||||
const TWTS_PER_PAGE = 50;
|
||||
|
||||
$config = parse_ini_file('private/config.ini');
|
||||
|
||||
// TODO: Take the title from the config.ini
|
||||
$title = "Timeline"; // Fallback, should be set in all views
|
||||
|
||||
if (isset($config['site_title'])) {
|
||||
$title = $config['site_title'];
|
||||
}
|
||||
$title = $config['site_title'] ?? "Timeline";
|
||||
|
||||
// HACKED by sp@darch.dk
|
||||
if(!empty($_GET['list'])) {
|
||||
$url = $baseURL.$_GET['list'];
|
||||
}
|
||||
else {
|
||||
$url = $config['public_txt_url'];
|
||||
}
|
||||
$url = !empty($_GET['list']) ? $baseURL.$_GET['list'] : $config['public_txt_url'];
|
||||
|
||||
/*
|
||||
if(isset($_GET['selectList'])){
|
||||
|
|
@ -57,11 +46,7 @@ if(isset($_GET['selectList'])){
|
|||
}
|
||||
*/
|
||||
|
||||
date_default_timezone_set('UTC');
|
||||
|
||||
if (!empty($_GET['url'])) {
|
||||
$url = $_GET['url'];
|
||||
}
|
||||
$url = !empty($_GET['url']) ? filter_var($_GET['url'], FILTER_SANITIZE_URL) : $url;
|
||||
|
||||
if (filter_var($url, FILTER_VALIDATE_URL) === FALSE) {
|
||||
die('Not a valid URL');
|
||||
|
|
|
|||
|
|
@ -31,9 +31,14 @@ public_txt_url = "https://example.com/timeline/twtxt.txt"
|
|||
public_avatar = "https://example.com/timeline/avatar.png"
|
||||
public_nick = "Timeline"
|
||||
|
||||
; Timezone for twts in your twtxt.txt
|
||||
; If you use "UTC", the time will be shown as "2024-12-13T21:39:32Z"
|
||||
; Otherwise, a time offset will be show as in "2024-12-13T16:51:20-05:00"
|
||||
|
||||
; Check available timezones here:
|
||||
; https://www.php.net/manual/en/timezones.php
|
||||
timezone = "Europe/Copenhagen"
|
||||
timezone = "UTC"
|
||||
;timezone = "Europe/Copenhagen"
|
||||
|
||||
twts_per_page = 50
|
||||
|
||||
|
|
@ -57,6 +62,9 @@ password = "change_me"
|
|||
totp_digits = 10
|
||||
totp_secret = "1234567890"
|
||||
|
||||
; Simple password for unnamed user
|
||||
password = "123"
|
||||
|
||||
; 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
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<?php
|
||||
require_once 'libs/session.php';
|
||||
|
||||
checkValidSessionOrRedirectToLogin();
|
||||
|
||||
// TODO: Give a warning if the file is not found
|
||||
|
|
@ -14,8 +13,9 @@ if ($config['debug_mode']) {
|
|||
|
||||
$txt_file_path = $config['txt_file_path'];
|
||||
$public_txt_url = $config['public_txt_url'];
|
||||
$timezone = $config['timezone'];
|
||||
|
||||
$timezone = $config['timezone'];
|
||||
require_once 'libs/load_timezone.php';
|
||||
|
||||
if (isset($_POST['submit'])) {
|
||||
$new_post = filter_input(INPUT_POST, 'new_post');
|
||||
|
|
@ -26,11 +26,7 @@ if (isset($_POST['submit'])) {
|
|||
// Remove Carriage return if needed
|
||||
$new_post = str_replace("\r", '', $new_post);
|
||||
|
||||
// TODO: If twt is emply, show an error
|
||||
/*
|
||||
if ($new_post) {
|
||||
}
|
||||
*/
|
||||
// TODO: If twt is empty, show an error
|
||||
|
||||
// Check if we have a point to insert the next Twt
|
||||
define('NEW_TWT_MARKER', "#~~~#\n");
|
||||
|
|
@ -50,7 +46,7 @@ if (isset($_POST['submit'])) {
|
|||
//$twt = $datetime . "\t$new_post\n";
|
||||
//$twt = date('c') . "\t$new_post\n";
|
||||
$datetime = date('Y-m-d\TH:i:sp'); // abracting to be used for webmentions
|
||||
$twt = "\n" . $datetime . "\t" .$new_post; // NB: only works with PHP 8
|
||||
$twt = "\n$datetime\t$new_post"; // NB: only works with PHP 8
|
||||
|
||||
// TODO: Delete?
|
||||
/*if (strpos($contents, NEW_TWT_MARKER) !== false) {
|
||||
|
|
@ -83,12 +79,10 @@ if (isset($_POST['submit'])) {
|
|||
|
||||
} else {
|
||||
require_once "partials/base.php";
|
||||
$title = "New post - ".$title;
|
||||
$title = "New post - $title";
|
||||
include_once 'partials/header.php';
|
||||
|
||||
if (!isset($textareaValue)) {
|
||||
$textareaValue = '';
|
||||
}
|
||||
$textareaValue = $textareaValue ?? '';
|
||||
|
||||
if (isset($_GET['hash'])) {
|
||||
$hash = $_GET['hash'];
|
||||
|
|
|
|||
Loading…
Reference in a new issue