not sure i change something - just in case

This commit is contained in:
sørenpeter 2023-11-13 20:10:04 +01:00
parent b8529f4b9b
commit b43c8f7342
5 changed files with 13 additions and 11 deletions

View file

@ -33,7 +33,8 @@ $routes = [
'/refresh' => 'load_twt_files.php', '/refresh' => 'load_twt_files.php',
'/login' => 'login.php', '/login' => 'login.php',
'/logout' => 'logout.php', '/logout' => 'logout.php',
'/profile/([a-zA-Z0-9_-]+)' => 'profile.php', '/profile' => 'profile.php',
//'/profile/([a-zA-Z0-9_-]+)' => 'profile.php',
'/conv/([a-zA-Z0-9]{7})' => 'conv.php', // matches only twtHash of exactly 7 alphanumeric characters '/conv/([a-zA-Z0-9]{7})' => 'conv.php', // matches only twtHash of exactly 7 alphanumeric characters
'/post/([a-zA-Z0-9]{7})' => 'post.php', // matches only twtHash of exactly 7 alphanumeric characters '/post/([a-zA-Z0-9]{7})' => 'post.php', // matches only twtHash of exactly 7 alphanumeric characters
]; ];

View file

@ -18,8 +18,8 @@ $profile = getTwtsFromTwtxtString($config['public_txt_url']);
<p> <p>
<a href="<?= $baseURL ?>"> <a href="<?= $baseURL ?>">
<img class="avatar" src="<?= $profile->avatar ?>" alt="" loading="lazy"> <img class="avatar" src="<?= $profile->avatar ?>" alt="" loading="lazy">
Timeline for <?= $profile->nick ?>@<?= parse_url($profile->mainURL, PHP_URL_HOST); ?> <!-- Timeline for --><?= $profile->nick ?></a>@<?= parse_url($profile->mainURL, PHP_URL_HOST); ?>
</a>
</p> </p>
<nav> <nav>

View file

@ -22,14 +22,14 @@ $profile = getTwtsFromTwtxtString($url);
<p><?= $profile->description ?></p> <p><?= $profile->description ?></p>
<small> <small>
<a href="">Posts</a> | <!-- <a href="">Posts</a> | -->
<a href="">Replies</a> | <!-- <a href="">Replies</a> | -->
<a href="">Gallery</a> | <!-- <a href="">Gallery</a> | -->
<!-- <span class="right"> --> <!-- <span class="right"> -->
<a href="following.php">Following <?php echo count($twtFollowingList); ?></a> | <!-- <a href="following.php">Following <?php echo count($twtFollowingList); ?></a> | -->
<a target="_blank" href="<?= $profile->mainURL ?>"></i>twtxt.txt</a> | <a target="_blank" href="<?= $profile->mainURL ?>"></i><?= $profile->mainURL ?></a>
<a href="https://yarn.social">How to follow</a> (<a href="https://yarn.social">How to follow</a>)
<!-- </span> --> <!-- </span> -->
</small> </small>

View file

@ -28,7 +28,8 @@ if (!empty($_GET['profile'])) { // Show twts for some user
<?php <?php
if( isset($_SESSION['password'])) { if( isset($_SESSION['password'])) {
include 'views/new_twt.php'; // TODO: Split up new_twt into a view and a partial include 'views/new_twt.php'; // TODO: Split up new_twt into a view and a partial
} ?> }
?>
<!-- PHP: TIMELINE --><?php include 'partials/timeline.php'?> <!-- PHP: TIMELINE --><?php include 'partials/timeline.php'?>

View file

@ -35,7 +35,7 @@ else { // Show timeline for the URL
$twtsURL = $config['public_txt_url']; $twtsURL = $config['public_txt_url'];
// $twtsURL = "https://lyse.isobeef.org/twtxt.txt"; // $twtsURL = "https://lyse.isobeef.org/twtxt.txt";
// $profile = getTwtsFromTwtxtString($twtsURL); // $profile = getTwtsFromTwtxtString($twtsURL);
header("Location: /profile?url=".$twtsURL); header("Location: ".$baseURL."/profile?url=".$twtsURL);
/* /*
if (filter_var($twtsURL, FILTER_VALIDATE_URL) === FALSE) { if (filter_var($twtsURL, FILTER_VALIDATE_URL) === FALSE) {