diff options
author | friendica <info@friendica.com> | 2014-04-04 15:24:45 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-04-04 15:25:18 -0700 |
commit | f832e5958594a942060766993625893f22beb59e (patch) | |
tree | 3b955d2c642f6a7bc9f8aea358f03a6494b055e1 /mod | |
parent | 3f1a78fa690e2220b46823527f3abf0a0d51cd8e (diff) | |
download | volse-hubzilla-f832e5958594a942060766993625893f22beb59e.tar.gz volse-hubzilla-f832e5958594a942060766993625893f22beb59e.tar.bz2 volse-hubzilla-f832e5958594a942060766993625893f22beb59e.zip |
doc updates, plus back-end work for rpost to let you post to a different channel than your current logged-in channel. Need the same for rbmark back-end. Then we "just" need a selector widget on the editor forms.
Diffstat (limited to 'mod')
-rw-r--r-- | mod/item.php | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/mod/item.php b/mod/item.php index 226d05d7e..c1feb5c96 100644 --- a/mod/item.php +++ b/mod/item.php @@ -225,12 +225,26 @@ function item_post(&$a) { $channel = $a->get_channel(); } else { - $r = q("SELECT channel.*, account.* FROM channel left join account on channel.channel_account_id = account.account_id - where channel.channel_id = %d LIMIT 1", - intval($profile_uid) - ); - if(count($r)) - $channel = $r[0]; + $dest_channel = ((array_key_exists('dest_channel',$_REQUEST) && intval($_REQUEST['dest_channel'])) ? intval($_REQUEST['dest_channel']) : 0); + + if(local_user() && $dest_channel) { + // posting as another channel which you control + $account = $a->get_account(); + $r = q("select * from channel left join account on channel_account_id = account_id where account_d = %d and channel_id = %d limit 1", + intval($account['account_id']), + intval($dest_channel) + ); + if($r) + $channel = $r[0]; + } + else { + // posting as yourself but not necessarily to a channel you control + $r = q("select * from channel left join account on channel_account_id = account_id where channel_id = %d LIMIT 1", + intval($profile_uid) + ); + if(count($r)) + $channel = $r[0]; + } } if(! $channel) { |