ok so i'm trying to pull annotations, or comments, from message boards and i've copied the code from the blog river php file which looks like this
$contents = strip_tags($object->description)
the variable $object gets defined with this line of code
$object = get_entity($vars['item']->object_guid);
getting that specific's item's object guid. so i tried to look at the coding of the message board content's code which looks like this
elgg_view("output/longtext",array("value" => parse_urls($vars['annotation']->value)))
so then i tried to put those together and it looks like this when it's done
<?php
$performed_by = get_entity($vars['item']->subject_guid); // $statement->getSubject();
$performed_on = get_entity($vars['item']->object_guid);
$url = "<a href=\"{$performed_by->getURL()}\">{$performed_by->name}</a>";
$contents = strip_tags($performed_by['annotation']->value); //strip tags from the contents to stop large images etc blowing out the river view
$string = sprintf(elgg_echo("messageboard:river:added"),$url) . " <a href=\"{$performed_on->getURL()}\">" . $performed_on->name . "'s</a> " . elgg_echo("messageboard:river:messageboard");
$string .= "<div class=\"river_content_display\">";
if(strlen($contents) > 200) {
$string .= substr($contents, 0, strpos($contents, ' ', 200)) . "...";
}else{
$string .= $contents;
}
$string .= "</div>";
?>
echo $string;
?>
the code above doesn't work, i've tried many ways so i turn to you elgg community. how do you display a comment that someone made to a specific person on the river? idk what i'm doing wrong, maybe i'm pulling the wrong variables or pulling the wrong entity. what am i doing wrong?
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.
- Kevin Jardine@kevin
Kevin Jardine - 0 likes
- Cim@manacim
Cim - 0 likes
- DhrupDeScoop@Dhrup2000
DhrupDeScoop - 0 likes
- thewire_save_post ( $body, $access_id, $parent, $method );
- Cim@manacim
Cim - 0 likes
- DhrupDeScoop@Dhrup2000
DhrupDeScoop - 0 likes
- Cim@manacim
Cim - 0 likes
- Cim@manacim
Cim - 0 likes
- DhrupDeScoop@Dhrup2000
DhrupDeScoop - 0 likes
You must log in to post replies.It might help if you gave more detail than "the code above doesn't work".
What does it do and what do you expect it to do instead?
well to put it simple, say i comment a friend. i'd like for my comment to show up on the river just like how when you post a blog, you'll see 200 characters worth on the river. understand what i'm trying to say now kevin? if not, i'll explain it in further details :)
@Cim -- a mi pequeño amigo este código es la llamada a la API para el puesto de alambre, este código es igual que en mod / thewire / acciones / add.php ==>
$body --> es el verdadero "alambre" de texto ;-)
wait what? i don't understand or speak spanish LOL
LOLZ ;-)
Google translate mi a amigo !
urgh! lol, making me do extra unecessary work lol but thanks for the info. i'll see what i can do for now
ugh this is driving me crazy, i need help again!
send $body to the wire(river).. easy -->
thewire_save_post ( $body, get_default_access(), 0, 'site' );