qvitter.php 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913
  1. <?php
  2. /* · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·
  3. · ·
  4. · ·
  5. · Q V I T T E R ·
  6. · ·
  7. · https://git.gnu.io/h2p/Qvitter ·
  8. · ·
  9. · ·
  10. · <o) ·
  11. · /_//// ·
  12. · (____/ ·
  13. · (o< ·
  14. · o> \\\\_\ ·
  15. · \\) \____) ·
  16. · ·
  17. · ·
  18. · ·
  19. · Qvitter is free software: you can redistribute it and / or modify it ·
  20. · under the terms of the GNU Affero General Public License as published by ·
  21. · the Free Software Foundation, either version three of the License or (at ·
  22. · your option) any later version. ·
  23. · ·
  24. · Qvitter is distributed in hope that it will be useful but WITHOUT ANY ·
  25. · WARRANTY; without even the implied warranty of MERCHANTABILTY or FITNESS ·
  26. · FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for ·
  27. · more details. ·
  28. · ·
  29. · You should have received a copy of the GNU Affero General Public License ·
  30. · along with Qvitter. If not, see <http://www.gnu.org/licenses/>. ·
  31. · ·
  32. · Contact h@nnesmannerhe.im if you have any questions. ·
  33. · ·
  34. · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · */
  35. class QvitterAction extends ApiAction
  36. {
  37. function isReadOnly($args)
  38. {
  39. return true;
  40. }
  41. protected function prepare(array $args=array())
  42. {
  43. parent::prepare($args);
  44. // redirect user/:id for local users to their nickname url
  45. if(substr($_SERVER['REQUEST_URI'],0,6) == '/user/') {
  46. $user_id = substr($_SERVER['REQUEST_URI'],6);
  47. try {
  48. $user = User::getKV('id', $user_id);
  49. if($user instanceof User) {
  50. $nickname = $user->nickname;
  51. common_redirect(common_local_url('showstream',array('nickname'=>$nickname)), 303);
  52. }
  53. } catch (Exception $e) {
  54. //
  55. }
  56. }
  57. $user = common_current_user();
  58. return true;
  59. }
  60. protected function handle()
  61. {
  62. parent::handle();
  63. $this->showQvitter();
  64. }
  65. function showQvitter()
  66. {
  67. $logged_in_user_nickname = '';
  68. $logged_in_user_obj = false;
  69. $logged_in_user = common_current_user();
  70. if($logged_in_user) {
  71. $logged_in_user_nickname = $logged_in_user->nickname;
  72. $logged_in_user_obj = ApiAction::twitterUserArray($logged_in_user->getProfile());
  73. }
  74. $registrationsclosed = false;
  75. if(common_config('site','closed') == 1 || common_config('site','inviteonly') == 1) {
  76. $registrationsclosed = true;
  77. }
  78. // check if the client's ip address is blocked for registration
  79. if(is_array(QvitterPlugin::settings("blocked_ips"))) {
  80. $client_ip_is_blocked = in_array($_SERVER['REMOTE_ADDR'], QvitterPlugin::settings("blocked_ips"));
  81. }
  82. $sitetitle = common_config('site','name');
  83. $siterootdomain = common_config('site','server');
  84. $qvitterpath = Plugin::staticPath('Qvitter', '');
  85. $apiroot = common_path('api/', GNUsocial::isHTTPS());
  86. $instanceurl = common_path('', GNUsocial::isHTTPS());
  87. $favicon_path = QvitterPlugin::settings("favicon_path");
  88. $attachmentconfig=common_config('attachments');
  89. if(GNUsocial::isHTTPS() && $attachmentconfig['sslserver']){
  90. $attachmentroot ='https://'.$attachmentconfig['sslserver'].$attachmentconfig['path'];
  91. } elseif(!GNUsocial::isHTTPS() && $attachmentconfig['server']) {
  92. $attachmentroot ='http://'.$attachmentconfig['server'].$attachmentconfig['path'];
  93. } else {
  94. $attachmentroot = $instanceurl.$attachmentconfig['path'];
  95. }
  96. $avatarconfig=common_config('avatar');
  97. if($avatarconfig['server']) {
  98. if(GNUsocial::isHTTPS() ){
  99. $avatarroot ='https://'.$avatarconfig['server'].$avatarconfig['path'];
  100. } else {
  101. $avatarroot ='http://'.$avatarconfig['server'].$avatarconfig['path'];
  102. }
  103. } else {
  104. $avatarroot = $instanceurl.$avatarconfig['path'];
  105. }
  106. // user's browser's language setting
  107. $user_browser_language = 'en'; // use english if we can't find the browser language
  108. if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
  109. $user_browser_language = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
  110. }
  111. common_set_returnto(''); // forget this
  112. // if this is a profile we add a link header for LRDD Discovery (see WebfingerPlugin.php)
  113. if(substr_count($_SERVER['REQUEST_URI'], '/') == 1) {
  114. $nickname = substr($_SERVER['REQUEST_URI'],1);
  115. if(preg_match("/^[a-zA-Z0-9]+$/", $nickname) == 1) {
  116. $acct = 'acct:'. $nickname .'@'. common_config('site', 'server');
  117. $url = common_local_url('webfinger') . '?resource='.$acct;
  118. foreach (array(Discovery::JRD_MIMETYPE, Discovery::XRD_MIMETYPE) as $type) {
  119. header('Link: <'.$url.'>; rel="'. Discovery::LRDD_REL.'"; type="'.$type.'"');
  120. }
  121. }
  122. }
  123. ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  124. "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  125. <html xmlns="http://www.w3.org/1999/xhtml">
  126. <head>
  127. <title><?php print $sitetitle; ?></title>
  128. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  129. <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
  130. <link rel="stylesheet" type="text/css" href="<?php print $qvitterpath; ?>css/qvitter.css?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/css/qvitter.css')); ?>" />
  131. <link rel="stylesheet" type="text/css" href="<?php print $qvitterpath; ?>css/jquery.minicolors.css" />
  132. <link rel="apple-touch-icon" sizes="57x57" href="<?php print $favicon_path ?>apple-touch-icon-57x57.png">
  133. <link rel="apple-touch-icon" sizes="60x60" href="<?php print $favicon_path ?>apple-touch-icon-60x60.png">
  134. <link rel="apple-touch-icon" sizes="72x72" href="<?php print $favicon_path ?>apple-touch-icon-72x72.png">
  135. <link rel="apple-touch-icon" sizes="76x76" href="<?php print $favicon_path ?>apple-touch-icon-76x76.png">
  136. <link rel="apple-touch-icon" sizes="114x114" href="<?php print $favicon_path ?>apple-touch-icon-114x114.png">
  137. <link rel="apple-touch-icon" sizes="120x120" href="<?php print $favicon_path ?>apple-touch-icon-120x120.png">
  138. <link rel="apple-touch-icon" sizes="144x144" href="<?php print $favicon_path ?>apple-touch-icon-144x144.png">
  139. <link rel="apple-touch-icon" sizes="152x152" href="<?php print $favicon_path ?>apple-touch-icon-152x152.png">
  140. <link rel="apple-touch-icon" sizes="180x180" href="<?php print $favicon_path ?>apple-touch-icon-180x180.png">
  141. <link rel="icon" type="image/png" href="<?php print $favicon_path ?>favicon-16x16.png" sizes="16x16">
  142. <link rel="icon" type="image/png" href="<?php print $favicon_path ?>favicon-32x32.png" sizes="32x32">
  143. <link rel="icon" type="image/png" href="<?php print $favicon_path ?>android-chrome-192x192.png" sizes="192x192">
  144. <link rel="icon" type="image/png" href="<?php print $favicon_path ?>favicon-96x96.png" sizes="96x96">
  145. <link rel="manifest" href="<?php print $favicon_path ?>manifest.json">
  146. <link rel="mask-icon" href="<?php print $favicon_path ?>safari-pinned-tab.svg" color="#a22430">
  147. <meta name="apple-mobile-web-app-title" content="<?php print $sitetitle; ?>">
  148. <meta name="application-name" content="<?php print $sitetitle; ?>">
  149. <meta name="msapplication-TileColor" content="#da532c">
  150. <meta name="msapplication-TileImage" content="<?php print $favicon_path ?>mstile-144x144.png">
  151. <meta name="theme-color" content="#ffffff">
  152. <?php
  153. // if qvitter is a webapp and this is a users url we add feeds
  154. if(substr_count($_SERVER['REQUEST_URI'], '/') == 1) {
  155. $nickname = substr($_SERVER['REQUEST_URI'],1);
  156. if(preg_match("/^[a-zA-Z0-9]+$/", $nickname) == 1) {
  157. $user = User::getKV('nickname', $nickname);
  158. if(!isset($user->id)) {
  159. //error_log("QVITTER: Could not get user id for user with nickname: $nickname – REQUEST_URI: ".$_SERVER['REQUEST_URI']);
  160. }
  161. else {
  162. print '<link title="Notice feed for '.$nickname.' (Activity Streams JSON)" type="application/stream+json" href="'.$instanceurl.'api/statuses/user_timeline/'.$user->id.'.as" rel="alternate">'."\n";
  163. print ' <link title="Notice feed for '.$nickname.' (RSS 1.0)" type="application/rdf+xml" href="'.$instanceurl.$nickname.'/rss" rel="alternate">'."\n";
  164. 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";
  165. print ' <link title="Notice feed for '.$nickname.' (Atom)" type="application/atom+xml" href="'.$instanceurl.'api/statuses/user_timeline/'.$user->id.'.atom" rel="alternate">'."\n";
  166. print ' <link title="FOAF for '.$nickname.'" type="application/rdf+xml" href="'.$instanceurl.$nickname.'/foaf" rel="meta">'."\n";
  167. print ' <link href="'.$instanceurl.$nickname.'/microsummary" rel="microsummary">'."\n";
  168. // rel="me" for the IndieWeb audience
  169. // (no indieweb for users of older gnu social versions)
  170. if(method_exists('Profile','getHomepage')) {
  171. $user_homepage = $user->getProfile()->getHomepage();
  172. $relMes = array(
  173. ['href' => $user->getProfile()->getHomepage(),
  174. 'text' => _('Homepage'),
  175. 'image' => null],
  176. );
  177. Event::handle('OtherAccountProfiles', array($user->getProfile(), &$relMes));
  178. foreach ($relMes as $relMe) {
  179. print ' <link href="'.htmlspecialchars($relMe['href']).'" title="'.$relMe['text'].'" rel="me" />'."\n";
  180. }
  181. }
  182. // maybe openid
  183. if (array_key_exists('OpenID', GNUsocial::getActiveModules())) {
  184. print ' <link rel="openid2.provider" href="'.common_local_url('openidserver').'"/>'."\n";
  185. print ' <link rel="openid2.local_id" href="'.$user->getProfile()->profileurl.'"/>'."\n";
  186. print ' <link rel="openid2.server" href="'.common_local_url('openidserver').'"/>'."\n";
  187. print ' <link rel="openid2.delegate" href="'.$user->getProfile()->profileurl.'"/>'."\n";
  188. }
  189. }
  190. }
  191. }
  192. elseif(substr($_SERVER['REQUEST_URI'],0,7) == '/group/') {
  193. $group_id_or_name = substr($_SERVER['REQUEST_URI'],7);
  194. if(stristr($group_id_or_name,'/id')) {
  195. $group_id_or_name = substr($group_id_or_name, 0, strpos($group_id_or_name,'/id'));
  196. $group = User_group::getKV('id', $group_id_or_name);
  197. if($group instanceof User_group) {
  198. $group_name = $group->nickname;
  199. $group_id = $group_id_or_name;
  200. }
  201. } else {
  202. $group = Local_group::getKV('nickname', $group_id_or_name);
  203. if($group instanceof Local_group) {
  204. $group_id = $group->group_id;
  205. $group_name = $group_id_or_name;
  206. }
  207. }
  208. if(preg_match("/^[a-zA-Z0-9]+$/", $group_id_or_name) == 1 && isset($group_name) && isset($group_id)) {
  209. ?>
  210. <link rel="alternate" href="<?php echo htmlspecialchars(common_local_url('ApiTimelineGroup', array('id'=>$group_id, 'format'=>'as'))); ?>" type="application/stream+json" title="Notice feed for '<?php echo htmlspecialchars($group_name); ?>' group (Activity Streams JSON)" />
  211. <link rel="alternate" href="<?php echo htmlspecialchars(common_local_url('grouprss', array('nickname'=>$group_name))); ?>" type="application/rdf+xml" title="Notice feed for '<?php echo htmlspecialchars($group_name); ?>' group (RSS 1.0)" />
  212. <link rel="alternate" href="<?php echo htmlspecialchars(common_local_url('ApiTimelineGroup', array('id'=>$group_id, 'format'=>'rss'))); ?>" type="application/rss+xml" title="Notice feed for '<?php echo htmlspecialchars($group_name); ?>' group (RSS 2.0)" />
  213. <link rel="alternate" href="<?php echo htmlspecialchars(common_local_url('ApiTimelineGroup', array('id'=>$group_id, 'format'=>'atom'))); ?>" type="application/atom+xml" title="Notice feed for '<?php echo htmlspecialchars($group_name); ?>' group (Atom)" />
  214. <link rel="meta" href="<?php echo htmlspecialchars(common_local_url('foafgroup', array('nickname'=>$group_name))); ?>" type="application/rdf+xml" title="FOAF for '<?php echo htmlspecialchars($group_name); ?>' group" />
  215. <?php
  216. }
  217. }
  218. // oembed discovery for local notices, and twitter cards
  219. if(substr($_SERVER['REQUEST_URI'],0,8) == '/notice/'
  220. && $this->arg('notice')
  221. && array_key_exists('Oembed', GNUsocial::getActiveModules())) {
  222. $notice = Notice::getKV('id', $this->arg('notice'));
  223. if($notice instanceof Notice) {
  224. $profile = $notice->getProfile();
  225. if ($notice->isLocal() && $profile instanceof Profile) {
  226. // maybe get thumbnail url
  227. $embed_thumbnail_url = false;
  228. $attachments = $notice->attachments();
  229. if (!empty($attachments)) {
  230. foreach ($attachments as $attachment) {
  231. if(is_object($attachment)) {
  232. try {
  233. $thumb = $attachment->getThumbnail();
  234. } catch (ServerException $e) {
  235. //
  236. }
  237. if(!empty($thumb) && method_exists('File_thumbnail','url')) {
  238. try {
  239. $embed_thumbnail_url = File_thumbnail::url($thumb->filename);
  240. break; // only first one
  241. } catch (ClientException $e) {
  242. //
  243. }
  244. }
  245. }
  246. }
  247. }
  248. try {
  249. $notice_url = $notice->getUrl();
  250. print '<link title="oEmbed" href="'.common_local_url('apiqvitteroembednotice', array('id' => $notice->id, 'format'=>'json')).'?url='.urlencode($notice_url).'" type="application/json+oembed" rel="alternate">'."\n";
  251. print '<link title="oEmbed" href="'.common_local_url('apiqvitteroembednotice', array('id' => $notice->id, 'format'=>'xml')).'?url='.urlencode($notice_url).'" type="application/xml+oembed" rel="alternate">'."\n";
  252. } catch (Exception $e) {
  253. //
  254. }
  255. // single notice feeds
  256. try {
  257. $single_notice_json = common_local_url('ApiStatusesShow', array( 'id' => $notice->getID(),'format' => 'json'));
  258. $single_notice_atom = common_local_url('ApiStatusesShow', array( 'id' => $notice->getID(),'format' => 'atom'));
  259. print '<link title="Single notice (JSON)" href="'.$single_notice_json.'" type="application/stream+json" rel="alternate">'."\n";
  260. print '<link title="Single notice (Atom)" href="'.$single_notice_atom.'" type="application/atom+xml" rel="alternate">'."\n";
  261. } catch (Exception $e) {
  262. //
  263. }
  264. // twitter cards
  265. print '<meta name="twitter:card" content="summary" />'."\n";
  266. print '<meta name="twitter:title" content="'.htmlspecialchars($profile->fullname).' (@'.$profile->nickname.')" />'."\n";
  267. print '<meta name="twitter:description" content="'.htmlspecialchars($notice->content).'" />'."\n";
  268. if($embed_thumbnail_url) {
  269. print '<meta name="twitter:image" content="'.$embed_thumbnail_url.'" />'."\n";
  270. }
  271. // opengraph
  272. print '<meta property="og:description" content="'.htmlspecialchars($notice->content).'" />'."\n";
  273. print '<meta property="og:site_name" content="'.$sitetitle.'" />'."\n";
  274. if($embed_thumbnail_url) {
  275. print '<meta property="og:image" content="'.$embed_thumbnail_url.'" />'."\n";
  276. }
  277. }
  278. }
  279. }
  280. ?>
  281. <script>
  282. /*
  283. @licstart The following is the entire license notice for the
  284. JavaScript code in this page.
  285. Copyright (C) 2015 Hannes Mannerheim and other contributors
  286. This program is free software: you can redistribute it and/or modify
  287. it under the terms of the GNU Affero General Public License as
  288. published by the Free Software Foundation, either version 3 of the
  289. License, or (at your option) any later version.
  290. This program is distributed in the hope that it will be useful,
  291. but WITHOUT ANY WARRANTY; without even the implied warranty of
  292. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  293. GNU Affero General Public License for more details.
  294. You should have received a copy of the GNU Affero General Public License
  295. along with this program. If not, see <http://www.gnu.org/licenses/>.
  296. @licend The above is the entire license notice
  297. for the JavaScript code in this page.
  298. */
  299. window.usersLanguageCode = <?php print json_encode($user_browser_language) ?>;
  300. window.usersLanguageNameInEnglish = <?php print json_encode(Locale::getDisplayLanguage($user_browser_language, 'en')) ?>;
  301. window.englishLanguageData = <?php print file_get_contents(QVITTERDIR.'/locale/en.json'); ?>;
  302. window.defaultAvatarStreamSize = <?php print json_encode(Avatar::defaultImage(AVATAR_STREAM_SIZE)) ?>;
  303. window.defaultAvatarProfileSize = <?php print json_encode(Avatar::defaultImage(AVATAR_PROFILE_SIZE)) ?>;
  304. window.textLimit = <?php print json_encode((int)common_config('site','textlimit')) ?>;
  305. window.registrationsClosed = <?php print json_encode($registrationsclosed) ?>;
  306. window.thisSiteThinksItIsHttpButIsActuallyHttps = <?php
  307. // this is due to a crazy setup at quitter.se, sorry about that
  308. $siteSSL = common_config('site', 'ssl');
  309. if(isset($_SERVER['HTTPS'])
  310. && $_SERVER['HTTPS'] != 'off'
  311. && $siteSSL == 'never' ) {
  312. $this_site_thinks_it_is_http_but_is_actually_https = true;
  313. print 'true';
  314. }
  315. else {
  316. $this_site_thinks_it_is_http_but_is_actually_https = false;
  317. print 'false';
  318. }
  319. ?>;
  320. window.siteTitle = <?php print json_encode($sitetitle) ?>;
  321. window.loggedIn = <?php
  322. $logged_in_user_json = json_encode($logged_in_user_obj);
  323. $logged_in_user_json = str_replace('http:\/\/quitter.se\/','https:\/\/quitter.se\/',$logged_in_user_json);
  324. print $logged_in_user_json;
  325. ?>;
  326. window.timeBetweenPolling = <?php print QvitterPlugin::settings("timebetweenpolling"); ?>;
  327. window.apiRoot = <?php
  328. $api_root = common_path("api/", GNUsocial::isHTTPS());
  329. if($this_site_thinks_it_is_http_but_is_actually_https) {
  330. $api_root = str_replace('http://','https://',$api_root);
  331. }
  332. print '\''.$api_root.'\'';
  333. ?>;
  334. window.fullUrlToThisQvitterApp = '<?php print $qvitterpath; ?>';
  335. window.siteRootDomain = '<?php print $siterootdomain; ?>';
  336. window.siteInstanceURL = '<?php print $instanceurl; ?>';
  337. window.avatarServer= <?php print json_encode(common_config('avatar', 'server')) ?>;
  338. window.defaultLinkColor = '<?php print QvitterPlugin::settings("defaultlinkcolor"); ?>';
  339. window.defaultBackgroundColor = '<?php print QvitterPlugin::settings("defaultbackgroundcolor"); ?>';
  340. window.siteBackground = '<?php print QvitterPlugin::settings("sitebackground"); ?>';
  341. window.enableWelcomeText = <?php print json_encode(QvitterPlugin::settings("enablewelcometext")); ?>;
  342. window.customWelcomeText = <?php print json_encode(QvitterPlugin::settings("customwelcometext")); ?>;
  343. window.urlShortenerAPIURL = '<?php print QvitterPlugin::settings("urlshortenerapiurl"); ?>';
  344. window.urlShortenerSignature = '<?php print QvitterPlugin::settings("urlshortenersignature"); ?>';
  345. window.urlshortenerFormat = '<?php print QvitterPlugin::settings("urlshortenerformat"); ?>';
  346. window.commonSessionToken = '<?php print common_session_token(); ?>';
  347. window.siteMaxThumbnailSize = <?php print common_config('thumbnail', 'maxsize'); ?>;
  348. window.siteAttachmentURLBase = '<?php print $attachmentroot; ?>';
  349. window.siteAvatarURLBase = '<?php print $avatarroot; ?>';
  350. window.siteEmail = '<?php print common_config('site', 'email'); ?>';
  351. window.siteLicenseTitle = '<?php print common_config('license', 'title'); ?>';
  352. window.siteLicenseURL = '<?php print common_config('license', 'url'); ?>';
  353. window.customTermsOfUse = <?php print json_encode(QvitterPlugin::settings("customtermsofuse")); ?>;
  354. window.siteLocalOnlyDefaultPath = <?php print (common_config('public', 'localonly') ? 'true' : 'false'); ?>;
  355. <?php
  356. // Get all topics in Qvitter's namespace in Profile_prefs
  357. if($logged_in_user) {
  358. try {
  359. $qvitter_profile_prefs = Profile_prefs::getNamespace(Profile::current(),'qvitter');
  360. } catch (Exception $e) {
  361. $qvitter_profile_prefs = array();
  362. }
  363. if(count($qvitter_profile_prefs)>0) {
  364. $topic_data = new stdClass();
  365. foreach($qvitter_profile_prefs as $pref) {
  366. $topic_data->{$pref->topic} = $pref->data;
  367. }
  368. print 'window.qvitterProfilePrefs = '.json_encode($topic_data).';';
  369. }
  370. else {
  371. print 'window.qvitterProfilePrefs = false;';
  372. }
  373. }
  374. // keyboard shortcuts can be disabled
  375. $disable_keyboard_shortcuts = false;
  376. if($logged_in_user) {
  377. try {
  378. $disable_keyboard_shortcuts = Profile_prefs::getData($logged_in_user->getProfile(), 'qvitter', 'disable_keyboard_shortcuts');
  379. if($disable_keyboard_shortcuts == '1' || $disable_keyboard_shortcuts == 1) {
  380. $disable_keyboard_shortcuts = true;
  381. }
  382. } catch (Exception $e) {
  383. //
  384. }
  385. }
  386. print 'window.disableKeyboardShortcuts = '.var_export($disable_keyboard_shortcuts, true).';';
  387. ?>
  388. // available language files and their last update time
  389. window.availableLanguages = {<?php
  390. // scan all files in the locale directory and create a json object with their change date added
  391. $available_languages = array_diff(scandir(QVITTERDIR.'/locale'), array('..', '.'));
  392. foreach($available_languages as $lankey=>$lan) {
  393. $lancode = substr($lan,0,strpos($lan,'.'));
  394. // for the paranthesis containing language region to work with rtl in ltr enviroment and vice versa, we add a
  395. // special rtl or ltr html char after the paranthesis
  396. // this list is incomplete, but if any rtl language gets a regional translation, it will probably be arabic
  397. $rtl_or_ltr_special_char = '&lrm;';
  398. $base_lancode = substr($lancode,0,strpos($lancode,'_'));
  399. if($base_lancode == 'ar'
  400. || $base_lancode == 'fa'
  401. || $base_lancode == 'he') {
  402. $rtl_or_ltr_special_char = '&rlm;';
  403. }
  404. // also make an array with all language names, to use for generating menu
  405. $languagecodesandnames[$lancode]['english_name'] = Locale::getDisplayName($lancode, 'en');
  406. $languagecodesandnames[$lancode]['name'] = Locale::getDisplayName($lancode, $lancode);
  407. $languagecodesandnames[$lancode]['tooltip'] = $languagecodesandnames[$lancode]['name'].' – '.$languagecodesandnames[$lancode]['english_name'];
  408. if($languagecodesandnames[$lancode]['name'] == $languagecodesandnames[$lancode]['english_name']) {
  409. $languagecodesandnames[$lancode]['tooltip'] = $languagecodesandnames[$lancode]['english_name'];
  410. }
  411. // ahorita meme only on quitter.es
  412. if($lancode == 'es_ahorita') {
  413. if($siterootdomain == 'quitter.es') {
  414. $languagecodesandnames[$lancode]['name'] = 'español (ahorita)';
  415. }
  416. else {
  417. unset($available_languages[$lankey]);
  418. unset($languagecodesandnames[$lancode]);
  419. continue;
  420. }
  421. }
  422. print "\n".' "'.$lancode.'": "'.$lan.'?changed='.date('YmdHis',filemtime(QVITTERDIR.'/locale/'.$lan)).'",';
  423. }
  424. ?>
  425. };
  426. </script>
  427. <?php
  428. // event for other plugins to use to add head elements to qvitter
  429. Event::handle('QvitterEndShowHeadElements', array($this));
  430. ?>
  431. </head>
  432. <body class="<?php
  433. // rights as body classes
  434. if($logged_in_user) {
  435. if($logged_in_user_obj['rights']['silence']){
  436. print 'has-right-to-silence';
  437. }
  438. if($logged_in_user_obj['rights']['sandbox']){
  439. print ' has-right-to-sandbox';
  440. }
  441. }
  442. ?>" style="background-color:<?php print QvitterPlugin::settings("defaultbackgroundcolor"); ?>">
  443. <?php
  444. // add an accessibility toggle link to switch to standard UI, if we're logged in
  445. if($logged_in_user) {
  446. print '<a id="accessibility-toggle-link" href="#"></a>';
  447. }
  448. ?>
  449. <input id="upload-image-input" class="upload-image-input" type="file" name="upload-image-input">
  450. <div class="topbar">
  451. <a href="<?php
  452. // if we're logged in, the logo links to the home stream
  453. // if logged out it links to the site's public stream
  454. if($logged_in_user) {
  455. print $instanceurl.$logged_in_user_nickname.'/all';
  456. }
  457. else {
  458. print $instanceurl.'main/public';
  459. }
  460. ?>"><div id="logo"></div></a><?php
  461. // menu for logged in users
  462. if($logged_in_user) { ?>
  463. <a id="settingslink">
  464. <div class="dropdown-toggle">
  465. <div class="nav-session" style="background-image:url('<?php print htmlspecialchars($logged_in_user_obj['profile_image_url_profile_size']) ?>')"></div>
  466. </div>
  467. </a><?php
  468. }
  469. ?><div id="top-compose" class="hidden"></div>
  470. <ul class="quitter-settings dropdown-menu">
  471. <li class="dropdown-caret right">
  472. <span class="caret-outer"></span>
  473. <span class="caret-inner"></span>
  474. </li>
  475. <li class="fullwidth"><a id="top-menu-profile-link" class="no-hover-card" href="<?php print $instanceurl.$logged_in_user_obj['screen_name']; ?>"><div id="top-menu-profile-link-fullname"><?php print htmlspecialchars($logged_in_user_obj['name']); ?></div><div id="top-menu-profile-link-view-profile"></div></a></li>
  476. <li class="fullwidth dropdown-divider"></li>
  477. <li class="fullwidth"><a id="faq-link"></a></li>
  478. <li class="fullwidth"><a id="tou-link"></a></li>
  479. <?php
  480. if($disable_keyboard_shortcuts === true) {
  481. print '<li class="fullwidth"><a id="shortcuts-link" class="disabled" href="'.$instanceurl.'settings/qvitter"></a></li>';
  482. }
  483. else {
  484. print '<li class="fullwidth"><a id="shortcuts-link"></a></li>';
  485. }
  486. if (common_config('invite', 'enabled') && !common_config('site', 'closed')) { ?>
  487. <li class="fullwidth"><a id="invite-link" href="<?php print $instanceurl; ?>main/invite"></a></li>
  488. <?php } ?>
  489. <li class="fullwidth"><a id="classic-link"></a></li>
  490. <li class="fullwidth dropdown-divider"></li>
  491. <li class="fullwidth"><a id="logout"></a></li>
  492. <li class="fullwidth language dropdown-divider"></li>
  493. <?php
  494. // languages
  495. foreach($languagecodesandnames as $lancode=>$lan) {
  496. print '<li class="language"><a class="language-link" data-tooltip="'.$lan['tooltip'].'" data-lang-code="'.$lancode.'">'.$lan['name'].'</a></li>';
  497. }
  498. ?>
  499. <li class="fullwidth language dropdown-divider"></li>
  500. <li class="fullwidth"><a href="https://git.gnu.io/h2p/Qvitter/tree/master/locale" target="_blank" id="add-edit-language-link"></a></li>
  501. </ul>
  502. <div class="global-nav">
  503. <div class="global-nav-inner">
  504. <div class="container">
  505. <div id="search">
  506. <input type="text" spellcheck="false" autocomplete="off" name="q" placeholder="Sök" id="search-query" class="search-input">
  507. <span class="search-icon">
  508. <button class="icon nav-search" type="submit" tabindex="-1">
  509. <span> Sök </span>
  510. </button>
  511. </span>
  512. </div>
  513. <ul class="language-dropdown">
  514. <li class="dropdown">
  515. <a class="dropdown-toggle">
  516. <small></small>
  517. <span class="current-language"></span>
  518. <b class="caret"></b>
  519. </a>
  520. <ul class="dropdown-menu">
  521. <li class="dropdown-caret right">
  522. <span class="caret-outer"></span>
  523. <span class="caret-inner"></span>
  524. </li>
  525. <?php
  526. // languages
  527. foreach($languagecodesandnames as $lancode=>$lan) {
  528. print '<li><a class="language-link" data-tooltip="'.$lan['english_name'].'" data-lang-code="'.$lancode.'">'.$lan['name'].'</a></li>';
  529. }
  530. ?>
  531. </ul>
  532. </li>
  533. </ul>
  534. </div>
  535. </div>
  536. </div>
  537. </div>
  538. <div id="no-js-error">Please enable javascript to use this site.<script>var element = document.getElementById('no-js-error'); element.parentNode.removeChild(element);</script></div>
  539. <div id="page-container">
  540. <?php
  541. $site_notice = common_config('site', 'notice');
  542. if(!empty($site_notice)) {
  543. print '<div id="site-notice">'.common_config('site', 'notice').'</div>';
  544. }
  545. // welcome text, login and register container if logged out
  546. if($logged_in_user === null) { ?>
  547. <div class="front-welcome-text <?php if ($registrationsclosed) { print 'registrations-closed'; } ?>"></div>
  548. <div id="login-register-container">
  549. <div id="login-content">
  550. <form id="form_login" class="form_settings" action="<?php print common_local_url('qvitterlogin'); ?>" method="post">
  551. <div id="username-container">
  552. <input id="nickname" name="nickname" type="text" value="<?php print $logged_in_user_nickname ?>" tabindex="1" />
  553. </div>
  554. <table class="password-signin"><tbody><tr>
  555. <td class="flex-table-primary">
  556. <div class="placeholding-input">
  557. <input id="password" name="password" type="password" tabindex="2" value="" />
  558. </div>
  559. </td>
  560. <td class="flex-table-secondary">
  561. <button class="submit" type="submit" id="submit-login" tabindex="4"></button>
  562. </td>
  563. </tr></tbody></table>
  564. <div id="remember-forgot">
  565. <input type="checkbox" id="rememberme" name="rememberme" value="yes" tabindex="3" checked="checked"> <span id="rememberme_label"></span> · <a id="forgot-password" href="<?php print $instanceurl ?>main/recoverpassword" ></a>
  566. <input type="hidden" id="token" name="token" value="<?php print common_session_token(); ?>">
  567. <?php
  568. if (array_key_exists('OpenID', GNUsocial::getActiveModules())) {
  569. print '<a href="'.$instanceurl.'main/openid" id="openid-login" title="OpenID" donthijack>OpenID</a>';
  570. }
  571. ?>
  572. </div>
  573. </form>
  574. </div>
  575. <?php
  576. if($registrationsclosed === false && $client_ip_is_blocked === false) {
  577. ?><div class="front-signup">
  578. <h2></h2>
  579. <div class="signup-input-container"><input placeholder="" type="text" name="user[name]" autocomplete="off" class="text-input" id="signup-user-name"></div>
  580. <div class="signup-input-container"><input placeholder="" type="text" name="user[email]" autocomplete="off" id="signup-user-email"></div>
  581. <div class="signup-input-container"><input placeholder="" type="password" name="user[user_password]" class="text-input" id="signup-user-password"></div>
  582. <button id="signup-btn-step1" class="signup-btn" type="submit"></button>
  583. </div>
  584. <div id="other-servers-link"></div><?php }
  585. ?><div id="qvitter-notice-logged-out"><?php print common_config('site', 'qvitternoticeloggedout'); ?></div><?php
  586. // event for other plugins to add html to the logged in sidebar
  587. Event::handle('QvitterEndShowSidebarLoggedOut', array($this));
  588. ?></div><?php
  589. }
  590. // box containing the logged in users queet count and compose form
  591. if($logged_in_user) { ?>
  592. <div id="user-container" style="display:none;">
  593. <div id="user-header" style="background-image:url('<?php print htmlspecialchars($logged_in_user_obj['cover_photo']) ?>')">
  594. <div id="mini-logged-in-user-cog-wheel"></div>
  595. <div class="profile-header-inner-overlay"></div>
  596. <div id="user-avatar-container"><img id="user-avatar" src="<?php print htmlspecialchars($logged_in_user_obj['profile_image_url_profile_size']) ?>" /></div>
  597. <div id="user-name"><?php print htmlspecialchars($logged_in_user_obj['name']) ?></div>
  598. <div id="user-screen-name"><?php print htmlspecialchars($logged_in_user_obj['screen_name']) ?></div>
  599. </div>
  600. <ul id="user-body">
  601. <li><a href="<?php print $instanceurl.$logged_in_user->nickname ?>" id="user-queets"><span class="label"></span><strong><?php print $logged_in_user_obj['statuses_count'] ?></strong></a></li>
  602. <li><a href="<?php print $instanceurl.$logged_in_user->nickname ?>/subscriptions" id="user-following"><span class="label"></span><strong><?php print $logged_in_user_obj['friends_count'] ?></strong></a></li>
  603. <li><a href="<?php print $instanceurl.$logged_in_user->nickname ?>/groups" id="user-groups"><span class="label"></span><strong><?php print $logged_in_user_obj['groups_count'] ?></strong></a></li>
  604. </ul>
  605. <div id="user-footer">
  606. <div id="user-footer-inner">
  607. <div id="queet-box" class="queet-box queet-box-syntax" data-start-text=""></div>
  608. <div class="syntax-middle"></div>
  609. <div class="syntax-two" contenteditable="true"></div>
  610. <div class="mentions-suggestions"></div>
  611. <div class="queet-toolbar">
  612. <div class="queet-box-extras">
  613. <button class="upload-image"></button>
  614. <button class="shorten disabled">URL</button>
  615. </div>
  616. <div class="queet-button">
  617. <span class="queet-counter"></span>
  618. <button></button>
  619. </div>
  620. </div>
  621. </div>
  622. </div>
  623. <div id="main-menu" class="menu-container"><?php
  624. if($logged_in_user) {
  625. ?><a href="<?php print $instanceurl.$logged_in_user->nickname ?>/all" class="stream-selection friends-timeline"><i class="chev-right"></i></a>
  626. <a href="<?php print $instanceurl.$logged_in_user->nickname ?>/notifications" class="stream-selection notifications"><span id="unseen-notifications"></span><i class="chev-right"></i></a>
  627. <a href="<?php print $instanceurl.$logged_in_user->nickname ?>" class="stream-selection my-timeline"><i class="chev-right"></i></a>
  628. <a href="<?php print $instanceurl.$logged_in_user->nickname ?>/favorites" class="stream-selection favorites"><i class="chev-right"></i></a>
  629. <a href="<?php print $instanceurl ?>main/public" class="stream-selection public-timeline"><i class="chev-right"></i></a>
  630. <a href="<?php print $instanceurl ?>main/all" class="stream-selection public-and-external-timeline"><i class="chev-right"></i></a>
  631. <?php
  632. }
  633. ?>
  634. </div>
  635. <div class="menu-container" id="bookmark-container"></div>
  636. <div id="find-someone"><input id="find-someone-input" placeholder="" data-tooltip=""/></div>
  637. <div class="menu-container" id="history-container"></div>
  638. <div id="clear-history"></div>
  639. <div id="qvitter-notice"><?php print common_config('site', 'qvitternotice'); ?></div><?php
  640. // event for other plugins to add html to the logged in sidebar
  641. Event::handle('QvitterEndShowSidebarLoggedIn', array($this));
  642. ?></div><?php
  643. } ?>
  644. <div id="feed">
  645. <div id="feed-header">
  646. <div id="feed-header-inner">
  647. <h2>
  648. <span id="stream-header"></span>
  649. </h2>
  650. <div class="reload-stream"></div>
  651. </div>
  652. <div id="feed-header-description"></div>
  653. </div>
  654. <div id="new-queets-bar-container" class="hidden"><div id="new-queets-bar"></div></div>
  655. <div id="feed-body"></div>
  656. </div>
  657. <div id="hidden-html"><?php
  658. // adds temporary support for microformats and linkbacks on the notice page
  659. if(substr($_SERVER['REQUEST_URI'],0,8) == '/notice/' && $this->arg('notice')) {
  660. echo '<ol class="notices xoxo">';
  661. if($notice instanceof Notice) {
  662. $widget = new NoticeListItem($notice, $this);
  663. $widget->show();
  664. $this->flush();
  665. }
  666. echo '</ol>';
  667. }
  668. Event::handle('QvitterHiddenHtml', array($this));
  669. ?></div>
  670. <div id="footer"><div id="footer-spinner-container"></div></div>
  671. </div>
  672. <script type="text/javascript" src="<?php print $qvitterpath; ?>js/lib/jquery-2.1.4.min.js?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/js/lib/jquery-2.1.4.min.js')); ?>"></script>
  673. <script type="text/javascript" src="<?php print $qvitterpath; ?>js/lib/jquery-ui.min.js?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/js/lib/jquery-ui.min.js')); ?>"></script>
  674. <script type="text/javascript" src="<?php print $qvitterpath; ?>js/lib/jquery.minicolors.min.js?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/js/lib/jquery.minicolors.min.js')); ?>"></script>
  675. <script type="text/javascript" src="<?php print $qvitterpath; ?>js/lib/jquery.jWindowCrop.js?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/js/lib/jquery.jWindowCrop.js')); ?>"></script>
  676. <script type="text/javascript" src="<?php print $qvitterpath; ?>js/lib/load-image.min.js?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/js/lib/load-image.min.js')); ?>"></script>
  677. <script type="text/javascript" src="<?php print $qvitterpath; ?>js/lib/xregexp-all-3.0.0-pre.js?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/js/lib/xregexp-all-3.0.0-pre.js')); ?>"></script>
  678. <script type="text/javascript" src="<?php print $qvitterpath; ?>js/lib/lz-string.js?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/js/lib/lz-string.js')); ?>"></script>
  679. <script type="text/javascript" src="<?php print $qvitterpath; ?>js/lib/bowser.min.js?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/js/lib/bowser.min.js')); ?>"></script>
  680. <script charset="utf-8" type="text/javascript" src="<?php print $qvitterpath; ?>js/dom-functions.js?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/js/dom-functions.js')); ?>"></script>
  681. <script charset="utf-8" type="text/javascript" src="<?php print $qvitterpath; ?>js/misc-functions.js?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/js/misc-functions.js')); ?>"></script>
  682. <script charset="utf-8" type="text/javascript" src="<?php print $qvitterpath; ?>js/ajax-functions.js?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/js/ajax-functions.js')); ?>"></script>
  683. <script charset="utf-8" type="text/javascript" src="<?php print $qvitterpath; ?>js/stream-router.js?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/js/stream-router.js')); ?>"></script>
  684. <script charset="utf-8" type="text/javascript" src="<?php print $qvitterpath; ?>js/qvitter.js?changed=<?php print date('YmdHis',filemtime(QVITTERDIR.'/js/qvitter.js')); ?>"></script>
  685. <?php
  686. // event for other plugins to add scripts to qvitter
  687. Event::handle('QvitterEndShowScripts', array($this));
  688. // we might have custom javascript in the config file that we want to add
  689. if(QvitterPlugin::settings('js')) {
  690. print '<script type="text/javascript">'.QvitterPlugin::settings('js').'</script>';
  691. }
  692. ?>
  693. <div id="dynamic-styles">
  694. <style>
  695. a, a:visited, a:active,
  696. ul.stats li:hover a,
  697. ul.stats li:hover a strong,
  698. #user-body a:hover div strong,
  699. #user-body a:hover div div,
  700. .permalink-link:hover,
  701. .stream-item.expanded > .queet .stream-item-expand,
  702. .stream-item-footer .with-icn .requeet-text a b:hover,
  703. .queet-text span.attachment.more,
  704. .stream-item-header .created-at a:hover,
  705. .stream-item-header a.account-group:hover .name,
  706. .queet:hover .stream-item-expand,
  707. .show-full-conversation:hover,
  708. #new-queets-bar,
  709. .menu-container div,
  710. .cm-mention, .cm-tag, .cm-group, .cm-url, .cm-email,
  711. div.syntax-middle span,
  712. #user-body strong,
  713. ul.stats,
  714. .stream-item:not(.temp-post) ul.queet-actions li .icon:not(.is-mine):hover:before,
  715. .show-full-conversation,
  716. #user-body #user-queets:hover .label,
  717. #user-body #user-groups:hover .label,
  718. #user-body #user-following:hover .label,
  719. ul.stats a strong,
  720. .queet-box-extras button,
  721. #openid-login:hover:after,
  722. .post-to-group,
  723. .stream-item-header .addressees .reply-to .h-card.not-mentioned-inline {
  724. color:/*COLORSTART*/<?php print QvitterPlugin::settings("defaultlinkcolor"); ?>/*COLOREND*/;
  725. }
  726. #unseen-notifications,
  727. .stream-item.notification.not-seen > .queet::before,
  728. #top-compose,
  729. #logo,
  730. .queet-toolbar button,
  731. #user-header,
  732. .profile-header-inner,
  733. .topbar,
  734. .menu-container,
  735. .member-button.member,
  736. .external-follow-button.following,
  737. .qvitter-follow-button.following,
  738. .save-profile-button,
  739. .crop-and-save-button,
  740. .topbar .global-nav.show-logo:before,
  741. .topbar .global-nav.pulse-logo:before,
  742. .dropdown-menu li:not(.dropdown-caret) a:hover {
  743. background-color:/*BACKGROUNDCOLORSTART*/<?php print QvitterPlugin::settings("defaultlinkcolor"); ?>/*BACKGROUNDCOLOREND*/;
  744. }
  745. .queet-box-syntax[contenteditable="true"]:focus,
  746. .stream-item.selected-by-keyboard::before {
  747. border-color:/*BORDERCOLORSTART*/#999999/*BORDERCOLOREND*/;
  748. }
  749. #user-footer-inner,
  750. .inline-reply-queetbox,
  751. #popup-faq #faq-container p.indent,
  752. #find-someone {
  753. background-color:/*LIGHTERBACKGROUNDCOLORSTART*/rgb(205,230,239)/*LIGHTERBACKGROUNDCOLOREND*/;
  754. }
  755. #user-footer-inner,
  756. .queet-box,
  757. .queet-box-syntax[contenteditable="true"],
  758. .inline-reply-queetbox,
  759. span.inline-reply-caret,
  760. .stream-item.expanded .stream-item.first-visible-after-parent,
  761. #popup-faq #faq-container p.indent,
  762. .post-to-group,
  763. .quoted-notice:hover,
  764. .oembed-item:hover,
  765. .stream-item:hover:not(.expanded) .quoted-notice:hover,
  766. .stream-item:hover:not(.expanded) .oembed-item:hover,
  767. #find-someone input:focus {
  768. border-color:/*LIGHTERBORDERCOLORSTART*/rgb(155,206,224)/*LIGHTERBORDERCOLOREND*/;
  769. }
  770. span.inline-reply-caret .caret-inner {
  771. border-bottom-color:/*LIGHTERBORDERBOTTOMCOLORSTART*/rgb(205,230,239)/*LIGHTERBORDERBOTTOMCOLOREND*/;
  772. }
  773. .modal-close .icon,
  774. .chev-right,
  775. .close-right,
  776. button.icon.nav-search,
  777. .member-button .join-text i,
  778. .external-member-button .join-text i,
  779. .external-follow-button .follow-text i,
  780. .qvitter-follow-button .follow-text i,
  781. #logo,
  782. .upload-cover-photo,
  783. .upload-avatar,
  784. .upload-background-image,
  785. button.shorten i,
  786. .reload-stream,
  787. .topbar .global-nav:before,
  788. .stream-item.notification.repeat .dogear,
  789. .stream-item.notification.like .dogear,
  790. .ostatus-link,
  791. .close-edit-profile-window {
  792. background-image: url("<?php print QvitterPlugin::settings("sprite"); ?>");
  793. background-size: 500px 1329px;
  794. }
  795. @media (max-width: 910px) {
  796. #search-query,
  797. .menu-container a,
  798. .menu-container a.current,
  799. .stream-selection.friends-timeline:after,
  800. .stream-selection.notifications:after,
  801. .stream-selection.my-timeline:after,
  802. .stream-selection.public-timeline:after {
  803. background-image: url("<?php print QvitterPlugin::settings("sprite"); ?>");
  804. background-size: 500px 1329px;
  805. }
  806. }
  807. </style>
  808. </div>
  809. </body>
  810. </html>
  811. <?php
  812. }
  813. }