diff --git a/index.php b/index.php index e3e24d5..55ac564 100644 --- a/index.php +++ b/index.php @@ -20,6 +20,7 @@ // This is where you set up your account's name and bio. You also need to provide a public/private keypair. The posting page is protected with a password that also needs to be set here. // Set up the Actor's information + $siteTitle = "ActivityPub-Single-PHP-File"; $username = rawurlencode("example"); // Encoded as it is often used as part of a URl $realName = "E. Xample. Jr."; $summary = "Some text about the user."; @@ -74,7 +75,7 @@ // Routing: // The .htaccess changes /whatever to /?path=whatever // This runs the function of the path requested. - !empty( $_GET["path"] ) ? $path = $_GET["path"] : die(); + !empty( $_GET["path"] ) ? $path = $_GET["path"] : home(); switch ($path) { case ".well-known/webfinger": webfinger(); @@ -331,6 +332,44 @@ return $headers; } + // User Interface for Homepage: + // This creates a basic HTML page. This content appears when someone visits the root of your site. + function home() { + global $username, $server, $realName, $siteTitle, $summary; + echo <<< HTML + + +
+ +{$summary}
+ + + + + HTML; + die(); + } + // User Interface for Writing: // This creates a basic HTML form. Type in your message and your password. It then POSTs the data to the `/send` endpoint. function write() {