Hi pulled this from 1.7.3
event_handler.php for the video plugin.
public function feedEntityAdd( OW_Event $e ) { $params = $e->getParams(); $data = $e->getData();
if ( $params['entityType'] != VIDEO_BOL_ClipService::ENTITY_TYPE ) { return; }
$videoService = VIDEO_BOL_ClipService::getInstance(); $clip = $videoService->findClipById($params['entityId']); $thumb = $videoService->getClipThumbUrl($clip->id, $clip->code, $clip->thumbUrl); if ( $thumb == "undefined" ) { $thumb = $videoService->getClipDefaultThumbUrl(); } $vars = array(); $format = "video"; if ( isset($data["content"]) && is_array($data["content"]) ) { $vars = empty($data["content"]["vars"]) ? array() : $data["content"]["vars"]; if ( !empty($data["content"]["format"]) ) { $format = $data["content"]["format"]; } }
$content = array( "format" => $format, "vars" => array_merge(array( "image" => $thumb, "title" => $title = UTIL_String::truncate(strip_tags($clip->title), 100, '...'), "description" => $description = UTIL_String::truncate(strip_tags($clip->description), 150, '...'), "url" => array("routeName" => "view_clip", "vars" => array('id' => $clip->id)), "embed" => $clip->code ), $vars) );
$data = array_merge($data, array( 'time' => (int) $clip->addDatetime, 'ownerId' => $clip->userId, 'content' => $content, 'view' => array( 'iconClass' => 'ow_ic_video' ) ));
$e->setData($data); }
I have been hacking away with Eclipse and until last week by PHP knowledge was nill so apols. I used to do a lot of dev work over a decade ago :) but horrid M$ stuff.
in the newsfeed plugin directory there is a format directory.
content.php
image_content.php
image_list.php
text.php
video.php
It would seem you can but would seem a bit arse-face? :) I thought maybe the formats would be dynamic and not hardcoded so you could create your own format.
Maybe there is some where to slot this in, haven't worked that one out yet.
Stuart
ps if you copy and past the code I think it might become readable :)
dumb forum (thought I better edit) the forum doesn't have much function for posting code or anything not you the people :)