X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fwall_upload.php;h=d35b703aa832f6d09c966c8cbc20606848616f0c;hb=5f1ef732e05c79584e6ea1cdb14360a7dd388a9d;hp=07d97d17a9e21fa15809a7f325d81c554409657d;hpb=fcf971fea9e65653e75360e2e68f1fb2131df93e;p=friendica.git diff --git a/mod/wall_upload.php b/mod/wall_upload.php index 07d97d17a9..d35b703aa8 100644 --- a/mod/wall_upload.php +++ b/mod/wall_upload.php @@ -1,9 +1,11 @@ argc > 1) { if(! x($_FILES,'media')) { $nick = $a->argv[1]; @@ -37,14 +39,25 @@ function wall_upload_post(&$a) { $can_post = true; else { if($community_page && remote_user()) { - $r = q("SELECT `uid` FROM `contact` WHERE `blocked` = 0 AND `pending` = 0 AND `id` = %d AND `uid` = %d LIMIT 1", - intval(remote_user()), - intval($page_owner_uid) - ); - if(count($r)) { - $can_post = true; - $visitor = remote_user(); - $default_cid = $visitor; + $cid = 0; + if(is_array($_SESSION['remote'])) { + foreach($_SESSION['remote'] as $v) { + if($v['uid'] == $page_owner_uid) { + $cid = $v['cid']; + break; + } + } + } + if($cid) { + + $r = q("SELECT `uid` FROM `contact` WHERE `blocked` = 0 AND `pending` = 0 AND `id` = %d AND `uid` = %d LIMIT 1", + intval($cid), + intval($page_owner_uid) + ); + if(count($r)) { + $can_post = true; + $visitor = $cid; + } } } } @@ -147,15 +160,9 @@ function wall_upload_post(&$a) { //if we get the signal then return the image url info in BBCODE, otherwise this outputs the info and bails (for the ajax image uploader on wall post) if ($_REQUEST['hush']!='yeah') { - - /*existing code*/ - if(local_user() && intval(get_pconfig(local_user(),'system','plaintext'))) - echo "\n\n" . '[url=' . $a->get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . $a->get_baseurl() . "/photo/{$hash}-{$smallest}.".$ph->getExt()."[/img][/url]\n\n"; - else - echo '

getExt()."\" alt=\"$basename\" />

"; - /*existing code*/ - - } else { + echo "\n\n" . '[url=' . $a->get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . $a->get_baseurl() . "/photo/{$hash}-{$smallest}.".$ph->getExt()."[/img][/url]\n\n"; + } + else { $m = '[url=' . $a->get_baseurl() . '/photos/' . $page_owner_nick . '/image/' . $hash . '][img]' . $a->get_baseurl() . "/photo/{$hash}-{$smallest}.".$ph->getExt()."[/img][/url]"; return($m); }