Skip to content

Instantly share code, notes, and snippets.

Created June 13, 2016 16:00
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
$url_parts = preg_split('/@|\//',$_SERVER["REQUEST_URI"]);
if (count($url_parts) < 4 || empty($url_parts[3])) {
} else {
$localpart = strtolower(urldecode($url_parts[2]));
$domainpart = strtolower(urldecode($url_parts[3]));
$jid = $localpart.'@'.$domainpart;
$muc = $url_parts[1] === 'j';
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<meta content="IE=edge" http-equiv="X-UA-Compatible">
<meta content="width=device-width, initial-scale=1, user-scalable=0" name="viewport">
<title>Join the Conversation</title>
<link href="/css/bootstrap.min.css" rel="stylesheet">
.main {
padding-top: 40px;
max-width: 600px;
width: 90%;
margin: 0 auto;
<!--[if lt IE 9]>
<script src=""></script>
<script src=""></script>
<div class="main">
$contact = htmlentities(ucwords($localpart,"-."));
$play = ';referrer=utm_source%3Dinvite';
if (strpos(strtolower($_SERVER["HTTP_USER_AGENT"]),'android') !== false) {
$target = 'market://details?id=eu.siacs.conversations';
} else {
$target = $play;
<p class="lead text-center">
<?php if ($muc) {?>
You have been invited to
<?php } else {?>
The user <?= $contact ?> has invited you to
<?php }?>
<h3 class="text-center">Join the Conversation</h3>
XMPP is a provider independent form of instant messaging.
That means you can pick from many different clients and have a free choice of server operators to
<?php if ($muc) {?>
participate in the conference <em><?=$contact?></em>
<?php } else { ?>
communicate with <em><?=$contact?></em>
<?php } ?>
<p class="lead">
If you use Android we recommand that you <strong><a href="<?=$target?>">install&nbsp;Conversations</a></strong>, follow the steps to create an account and then come back to this page to
<?php if ($muc) { ?>
join the conference <em><?=$contact?></em>
<?php } else { ?>
add <em><?=$contact?></em> to your contact list
<?php } ?>
by clicking the following link:</p>
<p class="text-center">
<a class="btn btn-primary" href="xmpp:<?=htmlentities($jid)?>">
<?php if ($muc) { ?>
Join <?=$contact?>
<?php } else { ?>
Add <?=$contact?>
<?php } ?>
<p>If you want to know more about Conversations visit the website <a href=""></a> or check it out on <a href="<?=$play?>">Google Play</a>.
<br>By the way: Conversations is Free and Open Source software and available on <a href="">Github</a>.</p>
Copy link


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment