qvitter.php 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916
  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. if (is_null($disable_keyboard_shortcuts)) {
  383. $disable_keyboard_shortcuts = false;
  384. }
  385. } catch (Exception $e) {
  386. //
  387. }
  388. }
  389. print 'window.disableKeyboardShortcuts = '.var_export($disable_keyboard_shortcuts, true).';';
  390. ?>
  391. // available language files and their last update time
  392. window.availableLanguages = {<?php
  393. // scan all files in the locale directory and create a json object with their change date added
  394. $available_languages = array_diff(scandir(QVITTERDIR.'/locale'), array('..', '.'));
  395. foreach($available_languages as $lankey=>$lan) {
  396. $lancode = substr($lan,0,strpos($lan,'.'));
  397. // for the paranthesis containing language region to work with rtl in ltr enviroment and vice versa, we add a
  398. // special rtl or ltr html char after the paranthesis
  399. // this list is incomplete, but if any rtl language gets a regional translation, it will probably be arabic
  400. $rtl_or_ltr_special_char = '&lrm;';
  401. $base_lancode = substr($lancode,0,strpos($lancode,'_'));
  402. if($base_lancode == 'ar'
  403. || $base_lancode == 'fa'
  404. || $base_lancode == 'he') {
  405. $rtl_or_ltr_special_char = '&rlm;';
  406. }
  407. // also make an array with all language names, to use for generating menu
  408. $languagecodesandnames[$lancode]['english_name'] = Locale::getDisplayName($lancode, 'en');
  409. $languagecodesandnames[$lancode]['name'] = Locale::getDisplayName($lancode, $lancode);
  410. $languagecodesandnames[$lancode]['tooltip'] = $languagecodesandnames[$lancode]['name'].' – '.$languagecodesandnames[$lancode]['english_name'];
  411. if($languagecodesandnames[$lancode]['name'] == $languagecodesandnames[$lancode]['english_name']) {
  412. $languagecodesandnames[$lancode]['tooltip'] = $languagecodesandnames[$lancode]['english_name'];
  413. }
  414. // ahorita meme only on quitter.es
  415. if($lancode == 'es_ahorita') {
  416. if($siterootdomain == 'quitter.es') {
  417. $languagecodesandnames[$lancode]['name'] = 'español (ahorita)';
  418. }
  419. else {
  420. unset($available_languages[$lankey]);
  421. unset($languagecodesandnames[$lancode]);
  422. continue;
  423. }
  424. }
  425. print "\n".' "'.$lancode.'": "'.$lan.'?changed='.date('YmdHis',filemtime(QVITTERDIR.'/locale/'.$lan)).'",';
  426. }
  427. ?>
  428. };
  429. </script>
  430. <?php
  431. // event for other plugins to use to add head elements to qvitter
  432. Event::handle('QvitterEndShowHeadElements', array($this));
  433. ?>
  434. </head>
  435. <body class="<?php
  436. // rights as body classes
  437. if($logged_in_user) {
  438. if($logged_in_user_obj['rights']['silence']){
  439. print 'has-right-to-silence';
  440. }
  441. if($logged_in_user_obj['rights']['sandbox']){
  442. print ' has-right-to-sandbox';
  443. }
  444. }
  445. ?>" style="background-color:<?php print QvitterPlugin::settings("defaultbackgroundcolor"); ?>">
  446. <?php
  447. // add an accessibility toggle link to switch to standard UI, if we're logged in
  448. if($logged_in_user) {
  449. print '<a id="accessibility-toggle-link" href="#"></a>';
  450. }
  451. ?>
  452. <input id="upload-image-input" class="upload-image-input" type="file" name="upload-image-input">
  453. <div class="topbar">
  454. <a href="<?php
  455. // if we're logged in, the logo links to the home stream
  456. // if logged out it links to the site's public stream
  457. if($logged_in_user) {
  458. print $instanceurl.$logged_in_user_nickname.'/all';
  459. }
  460. else {
  461. print $instanceurl.'main/public';
  462. }
  463. ?>"><div id="logo"></div></a><?php
  464. // menu for logged in users
  465. if($logged_in_user) { ?>
  466. <a id="settingslink">
  467. <div class="dropdown-toggle">
  468. <div class="nav-session" style="background-image:url('<?php print htmlspecialchars($logged_in_user_obj['profile_image_url_profile_size']) ?>')"></div>
  469. </div>
  470. </a><?php
  471. }
  472. ?><div id="top-compose" class="hidden"></div>
  473. <ul class="quitter-settings dropdown-menu">
  474. <li class="dropdown-caret right">
  475. <span class="caret-outer"></span>
  476. <span class="caret-inner"></span>
  477. </li>
  478. <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>
  479. <li class="fullwidth dropdown-divider"></li>
  480. <li class="fullwidth"><a id="faq-link"></a></li>
  481. <li class="fullwidth"><a id="tou-link"></a></li>
  482. <?php
  483. if($disable_keyboard_shortcuts === true) {
  484. print '<li class="fullwidth"><a id="shortcuts-link" class="disabled" href="'.$instanceurl.'settings/qvitter"></a></li>';
  485. }
  486. else {
  487. print '<li class="fullwidth"><a id="shortcuts-link"></a></li>';
  488. }
  489. if (common_config('invite', 'enabled') && !common_config('site', 'closed')) { ?>
  490. <li class="fullwidth"><a id="invite-link" href="<?php print $instanceurl; ?>main/invite"></a></li>
  491. <?php } ?>
  492. <li class="fullwidth"><a id="classic-link"></a></li>
  493. <li class="fullwidth dropdown-divider"></li>
  494. <li class="fullwidth"><a id="logout"></a></li>
  495. <li class="fullwidth language dropdown-divider"></li>
  496. <?php
  497. // languages
  498. foreach($languagecodesandnames as $lancode=>$lan) {
  499. print '<li class="language"><a class="language-link" data-tooltip="'.$lan['tooltip'].'" data-lang-code="'.$lancode.'">'.$lan['name'].'</a></li>';
  500. }
  501. ?>
  502. <li class="fullwidth language dropdown-divider"></li>
  503. <li class="fullwidth"><a href="https://git.gnu.io/h2p/Qvitter/tree/master/locale" target="_blank" id="add-edit-language-link"></a></li>
  504. </ul>
  505. <div class="global-nav">
  506. <div class="global-nav-inner">
  507. <div class="container">
  508. <div id="search">
  509. <input type="text" spellcheck="false" autocomplete="off" name="q" placeholder="Sök" id="search-query" class="search-input">
  510. <span class="search-icon">
  511. <button class="icon nav-search" type="submit" tabindex="-1">
  512. <span> Sök </span>
  513. </button>
  514. </span>
  515. </div>
  516. <ul class="language-dropdown">
  517. <li class="dropdown">
  518. <a class="dropdown-toggle">
  519. <small></small>
  520. <span class="current-language"></span>
  521. <b class="caret"></b>
  522. </a>
  523. <ul class="dropdown-menu">
  524. <li class="dropdown-caret right">
  525. <span class="caret-outer"></span>
  526. <span class="caret-inner"></span>
  527. </li>
  528. <?php
  529. // languages
  530. foreach($languagecodesandnames as $lancode=>$lan) {
  531. print '<li><a class="language-link" data-tooltip="'.$lan['english_name'].'" data-lang-code="'.$lancode.'">'.$lan['name'].'</a></li>';
  532. }
  533. ?>
  534. </ul>
  535. </li>
  536. </ul>
  537. </div>
  538. </div>
  539. </div>
  540. </div>
  541. <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>
  542. <div id="page-container">
  543. <?php
  544. $site_notice = common_config('site', 'notice');
  545. if(!empty($site_notice)) {
  546. print '<div id="site-notice">'.common_config('site', 'notice').'</div>';
  547. }
  548. // welcome text, login and register container if logged out
  549. if($logged_in_user === null) { ?>
  550. <div class="front-welcome-text <?php if ($registrationsclosed) { print 'registrations-closed'; } ?>"></div>
  551. <div id="login-register-container">
  552. <div id="login-content">
  553. <form id="form_login" class="form_settings" action="<?php print common_local_url('qvitterlogin'); ?>" method="post">
  554. <div id="username-container">
  555. <input id="nickname" name="nickname" type="text" value="<?php print $logged_in_user_nickname ?>" tabindex="1" />
  556. </div>
  557. <table class="password-signin"><tbody><tr>
  558. <td class="flex-table-primary">
  559. <div class="placeholding-input">
  560. <input id="password" name="password" type="password" tabindex="2" value="" />
  561. </div>
  562. </td>
  563. <td class="flex-table-secondary">
  564. <button class="submit" type="submit" id="submit-login" tabindex="4"></button>
  565. </td>
  566. </tr></tbody></table>
  567. <div id="remember-forgot">
  568. <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>
  569. <input type="hidden" id="token" name="token" value="<?php print common_session_token(); ?>">
  570. <?php
  571. if (array_key_exists('OpenID', GNUsocial::getActiveModules())) {
  572. print '<a href="'.$instanceurl.'main/openid" id="openid-login" title="OpenID" donthijack>OpenID</a>';
  573. }
  574. ?>
  575. </div>
  576. </form>
  577. </div>
  578. <?php
  579. if($registrationsclosed === false && $client_ip_is_blocked === false) {
  580. ?><div class="front-signup">
  581. <h2></h2>
  582. <div class="signup-input-container"><input placeholder="" type="text" name="user[name]" autocomplete="off" class="text-input" id="signup-user-name"></div>
  583. <div class="signup-input-container"><input placeholder="" type="text" name="user[email]" autocomplete="off" id="signup-user-email"></div>
  584. <div class="signup-input-container"><input placeholder="" type="password" name="user[user_password]" class="text-input" id="signup-user-password"></div>
  585. <button id="signup-btn-step1" class="signup-btn" type="submit"></button>
  586. </div>
  587. <div id="other-servers-link"></div><?php }
  588. ?><div id="qvitter-notice-logged-out"><?php print common_config('site', 'qvitternoticeloggedout'); ?></div><?php
  589. // event for other plugins to add html to the logged in sidebar
  590. Event::handle('QvitterEndShowSidebarLoggedOut', array($this));
  591. ?></div><?php
  592. }
  593. // box containing the logged in users queet count and compose form
  594. if($logged_in_user) { ?>
  595. <div id="user-container" style="display:none;">
  596. <div id="user-header" style="background-image:url('<?php print htmlspecialchars($logged_in_user_obj['cover_photo']) ?>')">
  597. <div id="mini-logged-in-user-cog-wheel"></div>
  598. <div class="profile-header-inner-overlay"></div>
  599. <div id="user-avatar-container"><img id="user-avatar" src="<?php print htmlspecialchars($logged_in_user_obj['profile_image_url_profile_size']) ?>" /></div>
  600. <div id="user-name"><?php print htmlspecialchars($logged_in_user_obj['name']) ?></div>
  601. <div id="user-screen-name"><?php print htmlspecialchars($logged_in_user_obj['screen_name']) ?></div>
  602. </div>
  603. <ul id="user-body">
  604. <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>
  605. <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>
  606. <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>
  607. </ul>
  608. <div id="user-footer">
  609. <div id="user-footer-inner">
  610. <div id="queet-box" class="queet-box queet-box-syntax" data-start-text=""></div>
  611. <div class="syntax-middle"></div>
  612. <div class="syntax-two" contenteditable="true"></div>
  613. <div class="mentions-suggestions"></div>
  614. <div class="queet-toolbar">
  615. <div class="queet-box-extras">
  616. <button class="upload-image"></button>
  617. <button class="shorten disabled">URL</button>
  618. </div>
  619. <div class="queet-button">
  620. <span class="queet-counter"></span>
  621. <button></button>
  622. </div>
  623. </div>
  624. </div>
  625. </div>
  626. <div id="main-menu" class="menu-container"><?php
  627. if($logged_in_user) {
  628. ?><a href="<?php print $instanceurl.$logged_in_user->nickname ?>/all" class="stream-selection friends-timeline"><i class="chev-right"></i></a>
  629. <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>
  630. <a href="<?php print $instanceurl.$logged_in_user->nickname ?>" class="stream-selection my-timeline"><i class="chev-right"></i></a>
  631. <a href="<?php print $instanceurl.$logged_in_user->nickname ?>/favorites" class="stream-selection favorites"><i class="chev-right"></i></a>
  632. <a href="<?php print $instanceurl ?>main/public" class="stream-selection public-timeline"><i class="chev-right"></i></a>
  633. <a href="<?php print $instanceurl ?>main/all" class="stream-selection public-and-external-timeline"><i class="chev-right"></i></a>
  634. <?php
  635. }
  636. ?>
  637. </div>
  638. <div class="menu-container" id="bookmark-container"></div>
  639. <div id="find-someone"><input id="find-someone-input" placeholder="" data-tooltip=""/></div>
  640. <div class="menu-container" id="history-container"></div>
  641. <div id="clear-history"></div>
  642. <div id="qvitter-notice"><?php print common_config('site', 'qvitternotice'); ?></div><?php
  643. // event for other plugins to add html to the logged in sidebar
  644. Event::handle('QvitterEndShowSidebarLoggedIn', array($this));
  645. ?></div><?php
  646. } ?>
  647. <div id="feed">
  648. <div id="feed-header">
  649. <div id="feed-header-inner">
  650. <h2>
  651. <span id="stream-header"></span>
  652. </h2>
  653. <div class="reload-stream"></div>
  654. </div>
  655. <div id="feed-header-description"></div>
  656. </div>
  657. <div id="new-queets-bar-container" class="hidden"><div id="new-queets-bar"></div></div>
  658. <div id="feed-body"></div>
  659. </div>
  660. <div id="hidden-html"><?php
  661. // adds temporary support for microformats and linkbacks on the notice page
  662. if(substr($_SERVER['REQUEST_URI'],0,8) == '/notice/' && $this->arg('notice')) {
  663. echo '<ol class="notices xoxo">';
  664. if($notice instanceof Notice) {
  665. $widget = new NoticeListItem($notice, $this);
  666. $widget->show();
  667. $this->flush();
  668. }
  669. echo '</ol>';
  670. }
  671. Event::handle('QvitterHiddenHtml', array($this));
  672. ?></div>
  673. <div id="footer"><div id="footer-spinner-container"></div></div>
  674. </div>
  675. <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>
  676. <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>
  677. <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>
  678. <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>
  679. <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>
  680. <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>
  681. <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>
  682. <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>
  683. <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>
  684. <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>
  685. <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>
  686. <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>
  687. <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>
  688. <?php
  689. // event for other plugins to add scripts to qvitter
  690. Event::handle('QvitterEndShowScripts', array($this));
  691. // we might have custom javascript in the config file that we want to add
  692. if(QvitterPlugin::settings('js')) {
  693. print '<script type="text/javascript">'.QvitterPlugin::settings('js').'</script>';
  694. }
  695. ?>
  696. <div id="dynamic-styles">
  697. <style>
  698. a, a:visited, a:active,
  699. ul.stats li:hover a,
  700. ul.stats li:hover a strong,
  701. #user-body a:hover div strong,
  702. #user-body a:hover div div,
  703. .permalink-link:hover,
  704. .stream-item.expanded > .queet .stream-item-expand,
  705. .stream-item-footer .with-icn .requeet-text a b:hover,
  706. .queet-text span.attachment.more,
  707. .stream-item-header .created-at a:hover,
  708. .stream-item-header a.account-group:hover .name,
  709. .queet:hover .stream-item-expand,
  710. .show-full-conversation:hover,
  711. #new-queets-bar,
  712. .menu-container div,
  713. .cm-mention, .cm-tag, .cm-group, .cm-url, .cm-email,
  714. div.syntax-middle span,
  715. #user-body strong,
  716. ul.stats,
  717. .stream-item:not(.temp-post) ul.queet-actions li .icon:not(.is-mine):hover:before,
  718. .show-full-conversation,
  719. #user-body #user-queets:hover .label,
  720. #user-body #user-groups:hover .label,
  721. #user-body #user-following:hover .label,
  722. ul.stats a strong,
  723. .queet-box-extras button,
  724. #openid-login:hover:after,
  725. .post-to-group,
  726. .stream-item-header .addressees .reply-to .h-card.not-mentioned-inline {
  727. color:/*COLORSTART*/<?php print QvitterPlugin::settings("defaultlinkcolor"); ?>/*COLOREND*/;
  728. }
  729. #unseen-notifications,
  730. .stream-item.notification.not-seen > .queet::before,
  731. #top-compose,
  732. #logo,
  733. .queet-toolbar button,
  734. #user-header,
  735. .profile-header-inner,
  736. .topbar,
  737. .menu-container,
  738. .member-button.member,
  739. .external-follow-button.following,
  740. .qvitter-follow-button.following,
  741. .save-profile-button,
  742. .crop-and-save-button,
  743. .topbar .global-nav.show-logo:before,
  744. .topbar .global-nav.pulse-logo:before,
  745. .dropdown-menu li:not(.dropdown-caret) a:hover {
  746. background-color:/*BACKGROUNDCOLORSTART*/<?php print QvitterPlugin::settings("defaultlinkcolor"); ?>/*BACKGROUNDCOLOREND*/;
  747. }
  748. .queet-box-syntax[contenteditable="true"]:focus,
  749. .stream-item.selected-by-keyboard::before {
  750. border-color:/*BORDERCOLORSTART*/#999999/*BORDERCOLOREND*/;
  751. }
  752. #user-footer-inner,
  753. .inline-reply-queetbox,
  754. #popup-faq #faq-container p.indent,
  755. #find-someone {
  756. background-color:/*LIGHTERBACKGROUNDCOLORSTART*/rgb(205,230,239)/*LIGHTERBACKGROUNDCOLOREND*/;
  757. }
  758. #user-footer-inner,
  759. .queet-box,
  760. .queet-box-syntax[contenteditable="true"],
  761. .inline-reply-queetbox,
  762. span.inline-reply-caret,
  763. .stream-item.expanded .stream-item.first-visible-after-parent,
  764. #popup-faq #faq-container p.indent,
  765. .post-to-group,
  766. .quoted-notice:hover,
  767. .oembed-item:hover,
  768. .stream-item:hover:not(.expanded) .quoted-notice:hover,
  769. .stream-item:hover:not(.expanded) .oembed-item:hover,
  770. #find-someone input:focus {
  771. border-color:/*LIGHTERBORDERCOLORSTART*/rgb(155,206,224)/*LIGHTERBORDERCOLOREND*/;
  772. }
  773. span.inline-reply-caret .caret-inner {
  774. border-bottom-color:/*LIGHTERBORDERBOTTOMCOLORSTART*/rgb(205,230,239)/*LIGHTERBORDERBOTTOMCOLOREND*/;
  775. }
  776. .modal-close .icon,
  777. .chev-right,
  778. .close-right,
  779. button.icon.nav-search,
  780. .member-button .join-text i,
  781. .external-member-button .join-text i,
  782. .external-follow-button .follow-text i,
  783. .qvitter-follow-button .follow-text i,
  784. #logo,
  785. .upload-cover-photo,
  786. .upload-avatar,
  787. .upload-background-image,
  788. button.shorten i,
  789. .reload-stream,
  790. .topbar .global-nav:before,
  791. .stream-item.notification.repeat .dogear,
  792. .stream-item.notification.like .dogear,
  793. .ostatus-link,
  794. .close-edit-profile-window {
  795. background-image: url("<?php print QvitterPlugin::settings("sprite"); ?>");
  796. background-size: 500px 1329px;
  797. }
  798. @media (max-width: 910px) {
  799. #search-query,
  800. .menu-container a,
  801. .menu-container a.current,
  802. .stream-selection.friends-timeline:after,
  803. .stream-selection.notifications:after,
  804. .stream-selection.my-timeline:after,
  805. .stream-selection.public-timeline:after {
  806. background-image: url("<?php print QvitterPlugin::settings("sprite"); ?>");
  807. background-size: 500px 1329px;
  808. }
  809. }
  810. </style>
  811. </div>
  812. </body>
  813. </html>
  814. <?php
  815. }
  816. }