mirror of
https://github.com/sorenpeter/timeline.git
synced 2025-12-15 10:57:01 +00:00
fix(webmentions): call to undefined function getMentionsFromTwt()
This commit is contained in:
parent
97a97122bb
commit
d3ce716e9a
2 changed files with 30 additions and 38 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
require_once "libs/twtxt.php";
|
||||||
|
|
||||||
// Send webmentions (TODO: move to it own file?)
|
// Send webmentions (TODO: move to it own file?)
|
||||||
$new_mentions = getMentionsFromTwt($twt);
|
$new_mentions = getMentionsFromTwt($twt);
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
// TODO: Give a warning if the file is not found
|
// TODO: Give a warning if the file is not found
|
||||||
$config = parse_ini_file('private/config.ini');
|
$config = parse_ini_file('private/config.ini');
|
||||||
|
|
||||||
|
|
||||||
if ($config['debug_mode']) {
|
if ($config['debug_mode']) {
|
||||||
ini_set('display_errors', 1);
|
ini_set('display_errors', 1);
|
||||||
ini_set('display_startup_errors', 1);
|
ini_set('display_startup_errors', 1);
|
||||||
|
|
@ -13,19 +12,13 @@ $txt_file_path = $config['txt_file_path'];
|
||||||
$public_txt_url = $config['public_txt_url'];
|
$public_txt_url = $config['public_txt_url'];
|
||||||
$timezone = $config['timezone'];
|
$timezone = $config['timezone'];
|
||||||
|
|
||||||
require_once('libs/session.php');
|
require_once 'libs/session.php';
|
||||||
|
|
||||||
// if (!has_valid_session()) {
|
|
||||||
// header('Location: /login.php');
|
|
||||||
// exit();
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (!isset($_SESSION['password'])) {
|
if (!isset($_SESSION['password'])) {
|
||||||
header('Location: ./login');
|
header('Location: ./login');
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (isset($_POST['submit'])) {
|
if (isset($_POST['submit'])) {
|
||||||
$new_post = filter_input(INPUT_POST, 'new_post');
|
$new_post = filter_input(INPUT_POST, 'new_post');
|
||||||
$new_post = trim($new_post);
|
$new_post = trim($new_post);
|
||||||
|
|
@ -81,7 +74,7 @@ if (isset($_POST['submit'])) {
|
||||||
// https://www.w3docs.com/snippets/php/how-can-i-handle-the-warning-of-file-get-contents-function-in-php.html
|
// https://www.w3docs.com/snippets/php/how-can-i-handle-the-warning-of-file-get-contents-function-in-php.html
|
||||||
|
|
||||||
$file_write_result = file_put_contents($txt_file_path, $contents);
|
$file_write_result = file_put_contents($txt_file_path, $contents);
|
||||||
// TODO: replace with file_put_contents($logfile, $log, FILE_APPEND) -- https://www.w3schools.com/php/func_filesystem_file_put_contents.asp
|
// TODO: replace with file_put_contents($logfile, $log, FILE_APPEND) -- https://www.w3schools.com/php/func_filesystem_file_put_contents.asp
|
||||||
|
|
||||||
// Send webmentions
|
// Send webmentions
|
||||||
include_once 'partials/webmentions_send.php';
|
include_once 'partials/webmentions_send.php';
|
||||||
|
|
@ -91,16 +84,15 @@ if (isset($_POST['submit'])) {
|
||||||
//exit;
|
//exit;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
require_once("partials/base.php");
|
require_once "partials/base.php";
|
||||||
$title = "New post - ".$title;
|
$title = "New post - ".$title;
|
||||||
include_once 'partials/header.php';
|
include_once 'partials/header.php';
|
||||||
|
|
||||||
|
if (!isset($textareaValue)) {
|
||||||
if (!isset($textareaValue)) {
|
|
||||||
$textareaValue = '';
|
$textareaValue = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_GET['hash'])) {
|
if (isset($_GET['hash'])) {
|
||||||
$hash = $_GET['hash'];
|
$hash = $_GET['hash'];
|
||||||
$textareaValue = "(#$hash) ";
|
$textareaValue = "(#$hash) ";
|
||||||
|
|
||||||
|
|
@ -116,8 +108,7 @@ if (isset($_GET['hash'])) {
|
||||||
//$textareaValue .= $twts["nick"];
|
//$textareaValue .= $twts["nick"];
|
||||||
|
|
||||||
include_once 'partials/timeline.php';
|
include_once 'partials/timeline.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<article id="new_twt">
|
<article id="new_twt">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue