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

159 lines
4.8 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_pubkey($rooms);
// Set the last-updated timestamp
// to the time the server data file was last modified.
$timestamp = filemtime($ROOMS_FILE);
?>
<!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">
<script type="module" src="./main.js"></script>
<link rel="modulepreload" href="js/util.js">
<link rel="help" href="./instructions.html">
<title>List of active Session Communities</title>
<meta name="description" content="
Directory of Session Communities: public groups in Session Messenger. <?php
?>Join these Communities in the Session app <?php
?>to talk anonymously about Privacy, Security, or Cryptocurrency.">
<meta name="modified" content="<?=date("Y-m-d H:i:s", $timestamp)?>">
<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="<?=$timestamp?>">
<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">
<header>
<div id="header-start"></div>
<div id="header-end">
<a
id="link-about"
href="#footer"
title="See more links to resources about sessioncommunities.online."
>About</a>
<span
id="btn-toggle-search"
class="anchorstyle clickable enter-clicks js-only"
title="Open search bar."
tabindex="0"
>Search</span>
<a
id="link-more-sites"
href="#more-sites"
title="Find other Session groups."
>More groups</a>
<label
for="toggle-theme-switch"
class="anchorstyle clickable enter-clicks"
title="Switch color theme"
tabindex="0"
>Switch theme</label>
<a
id="link-instructions"
target="_blank"
rel="help"
title="Multi-language guide to using the site."
href="instructions.html"
>Instructions</a>
</div>
</header>
<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">
<footer id="summary">
<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>
</p>
<p id="last_checked">
Last checked <span id="last_checked_value">
<?=date("Y-m-d H:i:s", $timestamp)?> (UTC)
</span>.
</p>
<p id="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">
This site works fine without JavaScript.
However, some interactive features are
only available with JS enabled.
</p>
</footer>
<?php include "+components/footer.php"; ?>
<div id="copy-snackbar"></div>
</div>
</body>
</html>