diff --git a/actions/qvitter.php b/actions/qvitter.php index 5ea9ded..35dff5c 100644 --- a/actions/qvitter.php +++ b/actions/qvitter.php @@ -98,23 +98,33 @@ class QvitterAction extends ApiAction $siterootdomain = common_config('site','server'); $qvitterpath = Plugin::staticPath('Qvitter', ''); $apiroot = common_path('api/', StatusNet::isHTTPS()); - + $instanceurl = common_path('', StatusNet::isHTTPS()); + $favicon_path = QvitterPlugin::settings("favicon_path"); $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()); + $attachmentroot = $instanceurl.$attachmentconfig['path']; + } + $avatarconfig=common_config('avatar'); + if($avatarconfig['server']) { + if(StatusNet::isHTTPS() ){ + $avatarroot ='https://'.$avatarconfig['server'].$avatarconfig['path']; + } else { + $avatarroot ='http://'.$avatarconfig['server'].$avatarconfig['path']; + } + } else { + $avatarroot = $instanceurl.$avatarconfig['path']; } - $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); - } + + // 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 @@ -302,10 +312,8 @@ class QvitterAction extends ApiAction } } - ?>