Qvitter/index.php

307 lines
17 KiB
PHP
Raw Normal View History

2013-11-23 08:31:04 +09:00
<?php
require_once 'settings.php';
// url to this instance
$instanceurl = strtolower(substr($_SERVER["SERVER_PROTOCOL"],0,strpos( $_SERVER["SERVER_PROTOCOL"],'/'))).'://'.$siterootdomain.'/';
// if used as a webapp
if($usehistorypushstate) {
define('INSTALLDIR', realpath(dirname(__FILE__) . '/../../..'));
define('STATUSNET', true);
define('LACONICA', true);
require_once INSTALLDIR . '/lib/common.php';
// if this is a users url we a http header
if(substr_count($_SERVER['REQUEST_URI'], '/') == 1) {
$nickname = substr($_SERVER['REQUEST_URI'],1);
if(preg_match("/^[a-zA-Z0-9]+$/", $nickname) == 1) {
header('Link: <'.$instanceurl.'main/xrd?uri=acct:'.$nickname.'@'.$siterootdomain.'>; rel="lrdd"; type="application/xrd+xml"');
}
}
}
?><!--
2013-08-19 22:30:57 +09:00
· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·
· ·
· ·
· Q V I T T E R ·
· ·
· http://github.com/hannesmannerheim/qvitter ·
· ·
· ·
· <o) ·
· /_//// ·
· (____/ ·
· (o< ·
· o> \\\\_\ ·
· \\) \____) ·
· ·
· ·
· ·
· Qvitter is free software: you can redistribute it and / or modify it ·
· under the terms of the GNU Affero General Public License as published by ·
· the Free Software Foundation, either version three of the License or (at ·
· your option) any later version. ·
· ·
· Qvitter is distributed in hope that it will be useful but WITHOUT ANY ·
· WARRANTY; without even the implied warranty of MERCHANTABILTY or FITNESS ·
· FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for ·
· more details. ·
· ·
· You should have received a copy of the GNU Affero General Public License ·
· along with Qvitter. If not, see <http://www.gnu.org/licenses/>. ·
· ·
· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·
--><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php print $sitetitle; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
2013-11-29 20:49:54 +09:00
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
<link rel="stylesheet" type="text/css" href="<?php print $qvitterpath; ?>css/7.css" />
<link rel="stylesheet" type="text/css" href="<?php print $qvitterpath; ?>css/jquery.minicolors.css" />
2013-11-29 20:49:54 +09:00
<link rel="shortcut icon" type="image/x-icon" href="<?php print $qvitterpath; ?>favicon.ico?v=2">
2013-11-23 08:31:04 +09:00
<?php
// if qvitter is a webapp and this is a users url we add feeds
if($usehistorypushstate && substr_count($_SERVER['REQUEST_URI'], '/') == 1) {
$nickname = substr($_SERVER['REQUEST_URI'],1);
if(preg_match("/^[a-zA-Z0-9]+$/", $nickname) == 1) {
$user = User::staticGet('nickname', $nickname);
if(!isset($user->id)) {
error_log("QVITTER: Could not get user id for user with nickname: $nickname REQUEST_URI: ".$_SERVER['REQUEST_URI']);
}
else {
print '<link title="Notice feed for '.$nickname.' (Activity Streams JSON)" type="application/stream+json" href="'.$apiroot.'statuses/user_timeline/'.$user->id.'.as" rel="alternate">'."\n";
print ' <link title="Notice feed for '.$nickname.' (RSS 1.0)" type="application/rdf+xml" href="'.$instanceurl.$nickname.'/rss" rel="alternate">'."\n";
2013-11-29 20:49:54 +09:00
print ' <link title="Notice feed for '.$nickname.' (RSS 2.0)" type="application/rss+xml" href="'.$instanceurl.'api/statuses/user_timeline/'.$user->id.'.rss" rel="alternate">'."\n";
print ' <link title="Notice feed for '.$nickname.' (Atom)" type="application/atom+xml" href="'.$instanceurl.'api/statuses/user_timeline/'.$user->id.'.atom" rel="alternate">'."\n";
2013-11-23 08:31:04 +09:00
print ' <link title="FOAF for '.$nickname.'" type="application/rdf+xml" href="'.$instanceurl.$nickname.'/foaf" rel="meta">'."\n";
print ' <link href="'.$instanceurl.$nickname.'/microsummary" rel="microsummary">'."\n";
}
}
}
elseif(substr($_SERVER['REQUEST_URI'],0,7) == '/group/') {
$group_id_or_name = substr($_SERVER['REQUEST_URI'],7);
if(stristr($group_id_or_name,'/id')) {
$group_id_or_name = substr($group_id_or_name, 0, strpos($group_id_or_name,'/id'));
$group = User_group::staticGet('id', $group_id_or_name);
$group_name = $group->nickname;
$group_id = $group_id_or_name;
}
else {
$group = User_group::staticGet('nickname', $group_id_or_name);
$group_id = $group->id;
$group_name = $group_id_or_name;
}
if(preg_match("/^[a-zA-Z0-9]+$/", $group_id_or_name) == 1) {
print '<link rel="alternate" href="'.$apiroot.'statusnet/groups/timeline/'.$group_id.'.as" type="application/stream+json" title="Notice feed for '.$group_id_or_name.' group (Activity Streams JSON)"/>'."\n";
print ' <link rel="alternate" href="'.$instanceurl.'group/'.$group_name.'/rss" type="application/rdf+xml" title="Notice feed for '.$group_id_or_name.' group (RSS 1.0)"/>'."\n";
2013-11-29 20:49:54 +09:00
print ' <link rel="alternate" href="'.$instanceurl.'api/statusnet/groups/timeline/'.$group_id.'.rss" type="application/rss+xml" title="Notice feed for '.$group_id_or_name.' group (RSS 2.0)"/>'."\n";
print ' <link rel="alternate" href="'.$instanceurl.'api/statusnet/groups/timeline/'.$group_id.'.atom" type="application/atom+xml" title="Notice feed for '.$group_id_or_name.' group (Atom)"/>'."\n";
2013-11-23 08:31:04 +09:00
print ' <link rel="meta" href="'.$instanceurl.'group/'.$group_name.'/foaf" type="application/rdf+xml" title="FOAF for '.$group_id_or_name.' group"/>'."\n";
}
}
?>
2013-08-19 22:30:57 +09:00
<script>
window.timeBetweenPolling = <?php print $timebetweenpolling; ?>;
window.fullUrlToThisQvitterApp = '<?php print $qvitterpath; ?>';
window.siteRootDomain = '<?php print $siterootdomain; ?>';
2013-11-23 08:31:04 +09:00
window.siteInstanceURL = '<?php print $instanceurl; ?>';
2013-08-19 22:30:57 +09:00
window.useHistoryPushState = <?php if($usehistorypushstate) print 'true'; else print 'false'; ?>;
2013-08-26 05:34:09 +09:00
window.defaultLinkColor = '<?php print $defaultlinkcolor; ?>';
window.defaultBackgroundColor = '<?php print $defaultbackgroundcolor; ?>';
2013-08-19 22:30:57 +09:00
</script>
<style>
a, a:visited, a:active,
ul.stats li:hover a,
ul.stats li:hover a strong,
#user-body a:hover div strong,
#user-body a:hover div div,
.permalink-link:hover,
.stream-item.expanded > .queet .stream-item-expand,
.stream-item-footer .with-icn .requeet-text a b:hover,
ul.queet-actions li .with-icn,
.queet-text span.attachment.more,
.stream-item-header .created-at a:hover,
.stream-item-header a.account-group:hover .name,
.queet:hover .stream-item-expand,
.show-full-conversation:hover,
#new-queets-bar,
.menu-container div,
2013-11-23 08:31:04 +09:00
#user-header:hover #user-name,
.cm-mention, .cm-tag, .cm-group, .cm-url, .cm-email {
color:#0084B4;/*COLOREND*/
}
2013-11-23 08:31:04 +09:00
ul.queet-actions li .icon,
.topbar .global-nav,
.menu-container {
background-color:#0084B4;/*BACKGROUNDCOLOREND*/
}
</style>
2013-08-19 22:30:57 +09:00
</head>
2013-08-26 05:34:09 +09:00
<body style="background-color:<?php print $defaultbackgroundcolor; ?>">
2013-08-19 22:30:57 +09:00
<div class="topbar">
2013-11-23 08:31:04 +09:00
<a href="<?php print $instanceurl; ?>"><div id="logo"></div></a>
<a id="settingslink">
2013-08-19 22:30:57 +09:00
<div class="dropdown-toggle">
<i class="nav-session"></i>
<b class="caret"></b>
</div>
</a>
2013-11-23 08:31:04 +09:00
<div id="top-compose" class="hidden"></div>
2013-08-19 22:30:57 +09:00
<ul class="quitter-settings dropdown-menu">
<li class="dropdown-caret right">
<span class="caret-outer"></span>
<span class="caret-inner"></span>
</li>
<li><a id="settings"></a></li>
2013-11-23 08:31:04 +09:00
<?php
if($siterootdomain == 'quitter.se') { print '<li><a id="classic" href="https://old.quitter.se/">Classic Quitter</a></li>'; } // sry for this junk
?><li class="dropdown-divider"></li>
2013-08-19 22:30:57 +09:00
<li><a id="logout"></a></li>
2013-09-03 01:17:16 +09:00
<li class="language dropdown-divider"></li>
<li class="language"><a class="language-link" title="Arabic" data-lang-code="ar">العربيّة</a></li>
<li class="language"><a class="language-link" title="German" data-lang-code="de">Deutsch</a></li>
<li class="language"><a class="language-link" title="English" data-lang-code="en">English</a></li>
2013-11-23 08:31:04 +09:00
<li class="language"><a class="language-link" title="Spanish" data-lang-code="es">Español</a></li>
<li class="language"><a class="language-link" title="Esperanto" data-lang-code="eo">Esperanto</a></li>
2013-09-03 01:17:16 +09:00
<li class="language"><a class="language-link" title="Farsi" data-lang-code="fa">فارسی</a></li>
<li class="language"><a class="language-link" title="French" data-lang-code="fr">français</a></li>
2013-11-23 08:31:04 +09:00
<li class="language"><a class="language-link" title="Italian" data-lang-code="it">Italiano</a></li>
2013-09-03 01:17:16 +09:00
<li class="language"><a class="language-link" title="Swedish" data-lang-code="sv">svenska</a></li>
2013-08-19 22:30:57 +09:00
</ul>
2013-11-29 20:49:54 +09:00
<div id="birds-top"></div>
2013-08-19 22:30:57 +09:00
<div class="global-nav">
<div class="global-nav-inner">
<div class="container">
<div id="search">
<input type="text" spellcheck="false" autocomplete="off" name="q" placeholder="Sök" id="search-query" class="search-input">
<span class="search-icon">
<button class="icon nav-search" type="submit" tabindex="-1">
<span> Sök </span>
</button>
</span>
<input type="text" spellcheck="false" autocomplete="off" id="search-query-hint" class="search-input search-hinting-input" disabled="disabled">
</div>
<ul class="language-dropdown">
<li class="dropdown">
<a class="dropdown-toggle">
<small></small>
<span class="current-language"></span>
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li class="dropdown-caret right">
<span class="caret-outer"></span>
<span class="caret-inner"></span>
</li>
<li><a class="language-link" title="Arabic" data-lang-code="ar">العربيّة</a></li>
<li><a class="language-link" title="German" data-lang-code="de">Deutsch</a></li>
<li><a class="language-link" title="English" data-lang-code="en">English</a></li>
<li><a class="language-link" title="Spanish" data-lang-code="es">Español</a></li>
2013-11-23 08:31:04 +09:00
<li><a class="language-link" title="Esperanto" data-lang-code="eo">Esperanto</a></li>
2013-08-19 22:30:57 +09:00
<li><a class="language-link" title="Farsi" data-lang-code="fa">فارسی</a></li>
2013-11-23 08:31:04 +09:00
<li><a class="language-link" title="French" data-lang-code="fr">français</a></li>
<li><a class="language-link" title="Italian" data-lang-code="it">Italiano</a></li>
2013-08-19 22:30:57 +09:00
<li><a class="language-link" title="Swedish" data-lang-code="sv">svenska</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id="page-container">
2013-09-03 01:17:16 +09:00
<div class="front-welcome-text">
<h1></h1>
<p></p>
</div>
<div id="user-container" style="display:none;">
2013-08-19 22:30:57 +09:00
<div id="login-content">
<div id="username-container">
<input id="username" type="text" value="" tabindex="1" />
</div>
<table class="password-signin"><tbody><tr>
<td class="flex-table-primary">
<div class="placeholding-input">
<input id="password" type="password" tabindex="2" value="" />
</div>
</td>
<td class="flex-table-secondary">
<button class="submit" type="submit" id="submit-login" tabindex="4"></button>
</td>
</tr></tbody></table>
<div id="remember-forgot">
2013-11-23 08:31:04 +09:00
<input type="checkbox" id="rememberme" name="rememberme" value="yes" tabindex="3" checked="checked"> <span id="rememberme_label"></span> · <a href="<?php print $instanceurl ?>main/recoverpassword"></a>
2013-08-19 22:30:57 +09:00
</div>
</div>
2013-09-03 01:17:16 +09:00
<div class="front-signup">
<h2></h2>
<div class="signup-input-container"><input placeholder="" type="text" name="user[name]" autocomplete="off" class="text-input" id="signup-user-name"></div>
<div class="signup-input-container"><input placeholder="" type="text" name="user[email]" autocomplete="off" id="signup-user-email"></div>
<div class="signup-input-container"><input placeholder="" type="password" name="user[user_password]" class="text-input" id="signup-user-password"></div>
<button id="signup-btn-step1" class="signup-btn" type="submit"></button>
2013-11-29 20:49:54 +09:00
<div id="other-servers-link"></div>
2013-09-03 01:17:16 +09:00
</div>
2013-08-19 22:30:57 +09:00
<div id="user-header">
<img id="user-avatar" src="" />
<div id="user-name"></div>
<div id="user-screen-name"></div>
<div id="user-profile-link"></div>
</div>
<div id="user-body">
<a><div id="user-queets"><strong></strong><div class="label"></div></div></a>
<a><div id="user-following"><strong></strong><div class="label"></div></div></a>
<a><div id="user-followers"><strong></strong><div class="label"></div></div></a>
<a><div id="user-groups"><strong></strong><div class="label"></div></div></a>
</div>
<div id="user-footer">
2013-11-23 08:31:04 +09:00
<textarea id="codemirror-queet-box"></textarea>
2013-08-19 22:30:57 +09:00
<div id="queet-box" class="queet-box"></div>
<div id="queet-toolbar">
<div id="queet-box-extras"></div>
<div id="queet-button">
<span id="queet-counter"></span>
<button id="queet"></button>
</div>
</div>
</div>
<div class="menu-container">
2013-11-23 08:31:04 +09:00
<a class="stream-selection friends-timeline" data-stream-header="" data-stream-name="statuses/friends_timeline.json"><i class="chev-right"></i></a>
<a class="stream-selection mentions" data-stream-header="" data-stream-name="statuses/mentions.json"><i class="chev-right"></i></a>
<a class="stream-selection my-timeline" data-stream-header="@statuses/user_timeline.json" data-stream-name="statuses/user_timeline.json"><i class="chev-right"></i></a>
<a class="stream-selection favorites" data-stream-header="" data-stream-name="favorites.json"><i class="chev-right"></i></a>
<a href="<?php print $instanceurl ?>" class="stream-selection public-timeline" data-stream-header="" data-stream-name="statuses/public_timeline.json"><i class="chev-right"></i></a>
2013-08-19 22:30:57 +09:00
</div>
<div class="menu-container" id="history-container"></div>
</div>
<div id="feed">
<div id="feed-header">
<div id="feed-header-inner">
<h2></h2>
</div>
</div>
<div class="stream-item hidden"><div id="new-queets-bar"></div></div>
<div id="feed-body"></div>
</div>
<div id="footer"></div>
</div>
2013-11-29 20:49:54 +09:00
<script type="text/javascript" src="<?php print $qvitterpath; ?>js/codemirror.3.20.js"></script>
2013-08-19 22:30:57 +09:00
<script type="text/javascript" src="<?php print $qvitterpath; ?>js/jquery-2.0.2.min.js"></script>
<script type="text/javascript" src="<?php print $qvitterpath; ?>js/jquery-ui-1.10.3.min.js"></script>
<script type="text/javascript" src="<?php print $qvitterpath; ?>js/jquery.easing.1.3.js"></script>
<script type="text/javascript" src="<?php print $qvitterpath; ?>js/jquery.minicolors.min.js"></script>
2013-11-29 20:49:54 +09:00
<script type="text/javascript" src="<?php print $qvitterpath; ?>js/dom-functions-7.js"></script>
<script type="text/javascript" src="<?php print $qvitterpath; ?>js/misc-functions-7.js"></script>
2013-11-23 08:31:04 +09:00
<script type="text/javascript" src="<?php print $qvitterpath; ?>js/ajax-functions-4.js"></script>
2013-11-29 20:49:54 +09:00
<script type="text/javascript" src="<?php print $qvitterpath; ?>js/lan-7.js"></script>
<script type="text/javascript" src="<?php print $qvitterpath; ?>js/qvitter-7.js"></script>
2013-08-19 22:30:57 +09:00
</body>
</html>