\\\\_\ · · \\) \____) · · · · · · · · Qvitter is free software: you can redistribute it and / or modify it · · under the terms of the GNU Affero General Public License as published by · · the Free Software Foundation, either version three of the License or (at · · your option) any later version. · · · · Qvitter is distributed in hope that it will be useful but WITHOUT ANY · · WARRANTY; without even the implied warranty of MERCHANTABILTY or FITNESS · · FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for · · more details. · · · · You should have received a copy of the GNU Affero General Public License · · along with Qvitter. If not, see . · · · · Contact h@nnesmannerhe.im if you have any questions. · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · */ class QvitterAction extends ApiAction { function isReadOnly($args) { return true; } protected function prepare(array $args=array()) { parent::prepare($args); // redirect user/:id for local users to their nickname url if(substr($_SERVER['REQUEST_URI'],0,6) == '/user/') { $user_id = substr($_SERVER['REQUEST_URI'],6); try { $user = User::getKV('id', $user_id); if($user instanceof User) { $nickname = $user->nickname; common_redirect(common_local_url('showstream',array('nickname'=>$nickname)), 303); } } catch (Exception $e) { // } } $user = common_current_user(); return true; } protected function handle() { parent::handle(); $this->showQvitter(); } function showQvitter() { $logged_in_user_nickname = ''; $logged_in_user_obj = false; $logged_in_user = common_current_user(); if($logged_in_user) { $logged_in_user_nickname = $logged_in_user->nickname; $logged_in_user_obj = ApiAction::twitterUserArray($logged_in_user->getProfile()); } $registrationsclosed = false; if(common_config('site','closed') == 1 || common_config('site','inviteonly') == 1) { $registrationsclosed = true; } // check if the client's ip address is blocked for registration if(is_array(QvitterPlugin::settings("blocked_ips"))) { $client_ip_is_blocked = in_array($_SERVER['REMOTE_ADDR'], QvitterPlugin::settings("blocked_ips")); } $sitetitle = common_config('site','name'); $siterootdomain = common_config('site','server'); $qvitterpath = Plugin::staticPath('Qvitter', ''); $apiroot = common_path('api/', StatusNet::isHTTPS()); $attachmentconfig=common_config('attachments'); if(StatusNet::isHTTPS() && $attachmentconfig['sslserver']){ $attachmentroot ='https://'.$attachmentconfig['sslserver'].$attachmentconfig['path']; } elseif(!StatusNet::isHTTPS() && $attachmentconfig['server']) { $attachmentroot ='http://'.$attachmentconfig['server'].$attachmentconfig['path']; } else { $attachmentroot = common_path('attachment/', StatusNet::isHTTPS()); } $instanceurl = common_path('', StatusNet::isHTTPS()); $favicon_path = QvitterPlugin::settings("favicon_path"); // user's browser's language setting $user_browser_language = 'en'; // use english if we can't find the browser language if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $user_browser_language = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); } common_set_returnto(''); // forget this // if this is a profile we add a link header for LRDD Discovery (see WebfingerPlugin.php) if(substr_count($_SERVER['REQUEST_URI'], '/') == 1) { $nickname = substr($_SERVER['REQUEST_URI'],1); if(preg_match("/^[a-zA-Z0-9]+$/", $nickname) == 1) { $acct = 'acct:'. $nickname .'@'. common_config('site', 'server'); $url = common_local_url('webfinger') . '?resource='.$acct; foreach (array(Discovery::JRD_MIMETYPE, Discovery::XRD_MIMETYPE) as $type) { header('Link: <'.$url.'>; rel="'. Discovery::LRDD_REL.'"; type="'.$type.'"'); } } } ?> <?php print $sitetitle; ?> id)) { //error_log("QVITTER: Could not get user id for user with nickname: $nickname – REQUEST_URI: ".$_SERVER['REQUEST_URI']); } else { print ''."\n"; print ' '."\n"; print ' '."\n"; print ' '."\n"; print ' '."\n"; print ' '."\n"; // rel="me" for the IndieWeb audience // (no indieweb for users of older gnu social versions) if(method_exists('Profile','getHomepage')) { $user_homepage = $user->getProfile()->getHomepage(); $relMes = array( ['href' => $user->getProfile()->getHomepage(), 'text' => _('Homepage'), 'image' => null], ); Event::handle('OtherAccountProfiles', array($user->getProfile(), &$relMes)); foreach ($relMes as $relMe) { print ' '."\n"; } } // maybe openid if (array_key_exists('OpenID', StatusNet::getActivePlugins())) { print ' '."\n"; print ' '."\n"; print ' '."\n"; print ' '."\n"; } } } } elseif(substr($_SERVER['REQUEST_URI'],0,7) == '/group/') { $group_id_or_name = substr($_SERVER['REQUEST_URI'],7); if(stristr($group_id_or_name,'/id')) { $group_id_or_name = substr($group_id_or_name, 0, strpos($group_id_or_name,'/id')); $group = User_group::getKV('id', $group_id_or_name); if($group instanceof User_group) { $group_name = $group->nickname; $group_id = $group_id_or_name; } } else { $group = Local_group::getKV('nickname', $group_id_or_name); if($group instanceof Local_group) { $group_id = $group->group_id; $group_name = $group_id_or_name; } } if(preg_match("/^[a-zA-Z0-9]+$/", $group_id_or_name) == 1 && isset($group_name) && isset($group_id)) { ?> arg('notice') && array_key_exists('Oembed', StatusNet::getActivePlugins())) { $notice = Notice::getKV('id', $this->arg('notice')); if($notice instanceof Notice) { $profile = $notice->getProfile(); if ($notice->isLocal() && $profile instanceof Profile) { // maybe get thumbnail url $embed_thumbnail_url = false; $attachments = $notice->attachments(); if (!empty($attachments)) { foreach ($attachments as $attachment) { if(is_object($attachment)) { try { $thumb = $attachment->getThumbnail(); } catch (ServerException $e) { // } if(!empty($thumb) && method_exists('File_thumbnail','url')) { try { $embed_thumbnail_url = File_thumbnail::url($thumb->filename); break; // only first one } catch (ClientException $e) { // } } } } } try { $notice_url = $notice->getUrl(); print ''."\n"; print ''."\n"; } catch (Exception $e) { // } // single notice feeds try { $single_notice_json = common_local_url('ApiStatusesShow', array( 'id' => $notice->getID(),'format' => 'json')); $single_notice_atom = common_local_url('ApiStatusesShow', array( 'id' => $notice->getID(),'format' => 'atom')); print ''."\n"; print ''."\n"; } catch (Exception $e) { // } // twitter cards print ''."\n"; print ''."\n"; print ''."\n"; if($embed_thumbnail_url) { print ''."\n"; } // opengraph print ''."\n"; print ''."\n"; if($embed_thumbnail_url) { print ''."\n"; } } } } ?> "> '; } ?>
Please enable javascript to use this site.
'.common_config('site', 'notice').'
'; } // welcome text, login and register container if logged out if($logged_in_user === null) { ?>
· OpenID'; } ?>

arg('notice')) { echo '
    '; if($notice instanceof Notice) { $widget = new NoticeListItem($notice, $this); $widget->show(); $this->flush(); } echo '
'; } Event::handle('QvitterHiddenHtml', array($this)); ?>
'.QvitterPlugin::settings('js').''; } ?>