public function __construct(array $params) { parent::__construct(); $this->videoService = IVIDEO_BOL_Service::getInstance(); $listType = isset($params['type']) ? $params['type'] : ''; $count = isset($params['count']) ? $params['count'] : 5; $tag = isset($params['tag']) ? $params['tag'] : ''; $userId = isset($params['userId']) ? $params['userId'] : null; $category = isset($params['category']) ? $params['category'] : null; $page = isset($_GET['page']) && (int) $_GET['page'] ? (int) $_GET['page'] : 1; $videosPerPage = (int) OW::getConfig()->getValue('ivideo', 'resultsPerPage'); if ($userId) { $videos = $this->videoService->findUserVideosList($userId, $page, $videosPerPage); $records = $this->videoService->findUserVideosCount($userId); } else { if (strlen($tag)) { $videos = $this->videoService->findTaggedVideosList($tag, $page, $videosPerPage); $records = $this->videoService->findTaggedVideosCount($tag); } else { if (strlen($category)) { $videos = $this->videoService->findCategoryVideosList($category, $page, $videosPerPage); $records = $this->videoService->findCategoryVideosCount($category); } else { $videos = $this->videoService->findVideosList($listType, $page, $videosPerPage); $records = $this->videoService->findVideosCount($listType); } } } $this->assign('listType', $listType); if ($videos) { $this->assign('no_content', null); $this->assign('videos', $videos); $userIds = array(); foreach ($videos as $video) { if (!in_array($video['owner'], $userIds)) { array_push($userIds, $video['owner']); } } $names = BOL_UserService::getInstance()->getDisplayNamesForList($userIds); $this->assign('displayNames', $names); $usernames = BOL_UserService::getInstance()->getUserNamesForList($userIds); $this->assign('usernames', $usernames); $pages = (int) ceil($records / $videosPerPage); $paging = new BASE_CMP_Paging($page, $pages, 10); $this->assign('paging', $paging->render()); $this->assign('count', $count); } else { $this->assign('no_content', OW::getLanguage()->text('ivideo', 'no_video_found')); } $this->assign('getUserFilesUrl', OW::getPluginManager()->getPlugin('ivideo')->getUserFilesUrl()); $this->assign('videoPreviewWidth', OW::getConfig()->getValue('ivideo', 'videoPreviewWidth')); $this->assign('videoPreviewHeight', OW::getConfig()->getValue('ivideo', 'videoPreviewHeight')); $this->assign('posterImage', OW::getPluginManager()->getPlugin('ivideo')->getStaticUrl() . 'poster.jpg'); $this->assign('defaultThumb', OW::getPluginManager()->getPlugin('ivideo')->getStaticUrl() . 'video.png'); }
function ivideo_feed_video_like(OW_Event $event) { $params = $event->getParams(); if ($params['entityType'] != 'ivideo-comments') { return; } $service = IVIDEO_BOL_Service::getInstance(); $userId = $service->findVideoOwner($params['entityId']); $userName = BOL_UserService::getInstance()->getDisplayName($userId); $userUrl = BOL_UserService::getInstance()->getUserUrl($userId); $userEmbed = '<a href="' . $userUrl . '">' . $userName . '</a>'; OW::getEventManager()->trigger(new OW_Event('feed.activity', array('activityType' => 'like', 'activityId' => $params['userId'], 'entityId' => $params['entityId'], 'entityType' => $params['entityType'], 'userId' => $params['userId'], 'pluginKey' => 'ivideo'), array('string' => OW::getLanguage()->text('ivideo', 'feed_activity_video_string_like', array('user' => $userEmbed))))); }
<?php /** * This software is intended for use with Oxwall Free Community Software http://www.oxwall.org/ and is a proprietary licensed product. * For more information see License.txt in the plugin folder. * --- * Copyright (c) 2012, Purusothaman Ramanujam * All rights reserved. * Redistribution and use in source and binary forms, with or without modification, are not permitted provided. * This plugin should be bought from the developer by paying money to PayPal account (purushoth.r@gmail.com). * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ IVIDEO_BOL_Service::getInstance()->cleanupPluginContent();
public function process() { $values = $this->getValues(); $videoService = IVIDEO_BOL_Service::getInstance(); $language = OW::getLanguage(); if ($values['id']) { $video = $videoService->findVideoById($values['id']); if ($video) { $video->name = htmlspecialchars($values['name']); $description = UTIL_HtmlTag::stripJs($values['description']); $description = UTIL_HtmlTag::stripTags($description, array('frame', 'style'), array(), true); $video->description = $description; if ($videoService->updateVideo($video)) { BOL_TagService::getInstance()->updateEntityTags($video->id, 'ivideo-video', TagsField::getTags($values['tags'])); return array('result' => true, 'id' => $video->id); } } } else { return array('result' => false, 'id' => $video->id); } return false; }