Hello,
Is it possible to add access levels to the posts of the wire?
e.g. I publish a string I only want my friends to see ...
Thanks
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
it should work in the wire and the dashboard (modified one) they have been tested there. For other pages, feel free to test :) and let us know.
so, yes, dropDown1 is for the wire. you can find out what dropdown to target by checking the sourcecode in your browser, and targeting the dropdown you desire. It will work.
I'm trying to achieve the same thing in 1.8. I've managed to get the access chooser (access plus)
and it's set as the default site access but non-friends' wire posts can still be viewd in the river.
This is my code from mod/thewire/views/default/forms/thewire/add.php:
<?php
elgg_load_js('elgg.thewire');
$post = elgg_extract('post', $vars);
$access_id = elgg_extract('access_id', $vars, ACCESS_FRIENDS);
$text = elgg_echo('post');
if ($post) {
$text = elgg_echo('thewire:reply');
}
if ($post) {
echo elgg_view('input/hidden', array(
'name' => 'parent_guid',
'value' => $post->guid,
));
}
echo elgg_view('input/plaintext', array(
'name' => 'body',
'class' => 'mtm',
'id' => 'thewire-textarea',
));
?>
<div id="thewire-characters-remaining">
<span>140</span> <?php echo elgg_echo('thewire:charleft'); ?>
</div>
<div class="elgg-foot mts">
<?php
?>
<div>
<label><?php echo elgg_echo('access'); ?></label><br />
<?php echo elgg_view('input/access', array('name' => 'access_id', 'value' => $access_id)); ?>
</div>
<div>
<?php
echo elgg_view('input/submit', array(
'value' => $text,
'id' => 'thewire-submit-button',
));
?>
</div>
any pointers as to where i'm going wrong would be appreciated
thanks
I am currently stuck trying to get the access level to stay the same when you make a reply. That is quite tricky! I made the core files of my site open-source. I'll send the solution to fraksken so he can update the plugin once we figure out the answer. You can help https://github.com/planetzuda/PZ_Core/tree/PZ_Core/Documents/GitHub/pz_core
$access_id = get_entity($parent_guid) -> access_id;
Inorder to respect the access Id, the best method is to override the wire add action > Check for a parent > If parent is present, get the access ID of parent > Assign this access ID to the reply. You can get the parent's access ID just like Dhrup mentioned, See https://gist.github.com/3435461
it's only 1 line code !;-oO, just add "post->access_id = get_entity($parent_guid) -> access_id... " like dhrup mentioned - after line #269 & done - no tricks & no nuffink ;-)
Dhrup, I tried two lines of code very similar to yours, but I probably made a mistake. Here is my line.
$post_owner = get_entity((int) get_input('parent_guid'));
echo $post->access_id = $post_owner;
Dhrup: it didn't work. I added that to the reply.php which is less than 269 lines. I know that you and I are very close, so I am going to the start.php next to see what is on line 269.
Why didn't you use dhrups code?
- Previous
- 1
- 2
- 3
- 4
- 5
- 6
- Next
You must log in to post replies.