You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sessioncommunities.online/sites/index.php

152 lines
5.4 KiB
PHP

<?php
// prerequisite include for sites and components
require_once '+getenv.php';
require_once 'php/utils/getopt.php';
require_once 'php/utils/utils.php';
require_once 'php/servers/servers-rooms.php';
// Read the server data from disk.
$servers_raw = file_get_contents($ROOMS_FILE);
// Decode the server data to an associative array.
$server_data = json_decode($servers_raw, true);
// Re-build server instances from cached server data.
$servers = CommunityServer::from_details_array($server_data);
// Fetch all server assets ahead of time.
CommunityServer::fetch_assets($servers);
// List all rooms from the cached servers.
$rooms = CommunityServer::enumerate_rooms($servers);
// Sort rooms by name and then host.
CommunityRoom::sort_rooms_str($rooms, 'name');
CommunityRoom::sort_rooms_by_server($rooms);
CommunityRoom::sort_stickied_rooms_first($rooms);
// Set the last-updated timestamp
// to the time the server data file was last modified.
$time_modified = filemtime($ROOMS_FILE);
$time_modified_str = date("Y-m-d H:i:s", $time_modified);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php include "+components/page-head.php" ?>
<link rel="canonical" href="<?=$SITE_CANONICAL_URL?>/">
<link rel="stylesheet" href="/index.css?<?=md5_file("$DOCUMENT_ROOT/index.css")?>">
<link rel="stylesheet" href="/css/banner.css?<?=md5_file("$DOCUMENT_ROOT/css/banner.css")?>">
<script type="module" src="/main.js?<?=md5_file("$DOCUMENT_ROOT/main.js")?>"></script>
<link rel="modulepreload" href="/js/util.js">
<link rel="preload" href="/servers.json" as="fetch" crossorigin="anonymous"/>
<link rel="help" href="/instructions/">
<title>Session Communities — sessioncommunities.online</title>
<meta name="description" content="Public Session Group list — updated daily! <?php
?>Click here to join your favorite Community in Session Messenger. <?php
?>Copy Community links into the Session app!<?php
?>">
<meta name="keywords" content="session communities,session groups,session group list">
<meta name="modified" content="<?=$time_modified_str?>">
<meta property="og:title" content="Click here for Session Communities">
<meta
property="og:description"
content="<?=count($rooms)?> Communities and counting — updated every day!"
>
<meta property="og:url" content="<?=$SITE_CANONICAL_URL?>/">
<meta property="og:type" content="website">
<meta property="og:locale" content="en_US"/>
<meta name="timestamp" content="<?=$time_modified?>">
<noscript>
<style>
.js-only {
display: none;
}
</style>
</noscript>
<?php include "+components/communities-json-ld.php"; ?>
</head>
<body>
<input type="checkbox" id="toggle-theme-switch">
<div id="theming-root">
<?php include "+components/index-header.php" ?>
<h1 id="headline">List of Session Communities</h1>
<?php include "+components/issue-banner.php" ?>
<?php include "+components/communities-search.php"; ?>
<?php include "+components/qr-modals.php" ?>
<?php include "+components/tbl-communities.php" ?>
<gap></gap>
<hr id="footer-divider">
<aside id="summary" itemid="<?=$SITE_CANONICAL_URL?>" itemtype="https://schema.org/WebSite">
<p id="server_summary">
<?=count_rooms($servers)?> unique Session Communities
on <?=count($servers)?> servers have been found.
<span id="servers_hidden">(None hidden as JS is off)</span>
<sup><a href="<?=$REPOSITORY_CANONICAL_URL?>/#policy" target="_blank">why?</a></sup>
</p>
<p id="last_checked">
Last checked <span id="last_checked_value" itemprop="dateModified" value="<?=$time_modified_str?>">
<?=$time_modified_str?> (UTC)
</span>.
</p>
</aside>
<aside id="details">
<details>
<summary class="carousel-label aside__h2 h2-like">What is Session Messenger?</summary>
<p class="carousel-target">
<a href="https://getsession.org/" rel="follow external">Session</a>
is a private messaging app that protects your meta-data,
encrypts your communications, and makes sure your messaging activities
leave no digital trail behind. <a href="/about/">Read more.</a>
</p>
</details>
<details>
<summary class="carousel-label aside__h2 h2-like">What are Session Communities?</summary>
<p class="carousel-target">
Session Communities are public chatrooms accessible from within Session Messenger.
This web project crawls known sources of Session Communities, and
displays information about them as a static HTML page. <a href="/about/">Read more.</a>
</p>
</details>
<p>Disclaimer:</p>
<p id="content-disclaimer">
Session Communities shown on this list are fetched automatically from
<a
href="<?=$REPOSITORY_CANONICAL_URL?>#which-sources-are-crawled"
target="_blank"
>various sources</a>.
<br>
<span class="js-only">
We make an attempt to hide Communities containing
objectionable or illegal content, but
you should still proceed with caution.
</span>
<span class="noscript">
Proceed with caution when joining unofficial Communities.
As JavaScript is disabled, no Communities are filtered from the list.
</span>
</p>
<p class="noscript">
SessionCommunities.online works fine without JavaScript.
However, some interactive features are
only available with JS enabled.
</p>
</aside>
<?php include "+components/footer.php"; ?>
<div id="copy-snackbar"></div>
</div>
</body>
</html>