makes thumbnails show again

This commit is contained in:
Hannes Mannerheim 2014-11-27 23:29:58 +01:00
parent 80a79de484
commit 8a72b24ea2
2 changed files with 21 additions and 6 deletions

View File

@ -113,7 +113,7 @@ class QvitterAction extends ApiAction
if(preg_match("/^[a-zA-Z0-9]+$/", $nickname) == 1) { if(preg_match("/^[a-zA-Z0-9]+$/", $nickname) == 1) {
$user = User::getKV('nickname', $nickname); $user = User::getKV('nickname', $nickname);
if(!isset($user->id)) { if(!isset($user->id)) {
error_log("QVITTER: Could not get user id for user with nickname: $nickname REQUEST_URI: ".$_SERVER['REQUEST_URI']); //error_log("QVITTER: Could not get user id for user with nickname: $nickname REQUEST_URI: ".$_SERVER['REQUEST_URI']);
} }
else { else {
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"; 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";
@ -154,12 +154,24 @@ class QvitterAction extends ApiAction
window.defaultAvatarStreamSize = <?php print json_encode(Avatar::defaultImage(AVATAR_STREAM_SIZE)) ?>; window.defaultAvatarStreamSize = <?php print json_encode(Avatar::defaultImage(AVATAR_STREAM_SIZE)) ?>;
window.textLimit = <?php print json_encode((int)common_config('site','textlimit')) ?>; window.textLimit = <?php print json_encode((int)common_config('site','textlimit')) ?>;
window.registrationsClosed = <?php print json_encode($registrationsclosed) ?>; window.registrationsClosed = <?php print json_encode($registrationsclosed) ?>;
window.thisSiteThinksItIsHttpButIsActuallyHttps = <?php
if(isset($_SERVER['HTTPS'])
&& $_SERVER['HTTPS'] != 'off'
&& substr($instanceurl,0,7) == 'http://') {
print 'true';
}
else {
print 'false';
}
?>;
window.siteTitle = <?php print json_encode($sitetitle) ?>; window.siteTitle = <?php print json_encode($sitetitle) ?>;
window.loggedIn = <?php window.loggedIn = <?php
$logged_in_user_json = json_encode($logged_in_user_obj); $logged_in_user_json = json_encode($logged_in_user_obj);
$logged_in_user_json = str_replace('http:\/\/quitter.se\/','https:\/\/quitter.se\/',$logged_in_user_json); $logged_in_user_json = str_replace('http:\/\/quitter.se\/','https:\/\/quitter.se\/',$logged_in_user_json);
print $logged_in_user_json; print $logged_in_user_json;
?>; ?>;
window.timeBetweenPolling = <?php print QvitterPlugin::settings("timebetweenpolling"); ?>; window.timeBetweenPolling = <?php print QvitterPlugin::settings("timebetweenpolling"); ?>;

View File

@ -2470,8 +2470,11 @@ function uploadImage(e, thisUploadButton) {
var queetBox = $('img.to-upload').parent().siblings('.queet-box-syntax'); var queetBox = $('img.to-upload').parent().siblings('.queet-box-syntax');
var caretPos = uploadButton.attr('data-caret-pos').split(','); var caretPos = uploadButton.attr('data-caret-pos').split(',');
// remove http and https (not needed, just design choice) // if this site is like quitter.se, we have to do this, otherwise
data.shorturl = data.shorturl.replace('http://','').replace('https://',''); // gnusocial will not recognize the link to the image as a local attachment
if(window.thisSiteThinksItIsHttpButIsActuallyHttps) {
data.shorturl = data.shorturl.replace('https://','http://');
}
$('img.to-upload').attr('data-shorturl', data.shorturl); $('img.to-upload').attr('data-shorturl', data.shorturl);
$('img.to-upload').addClass('uploaded'); $('img.to-upload').addClass('uploaded');