/** * iZAP Videos plugin by iionly * (based on version 3.71b of the original izap_videos plugin for Elgg 1.7) * Contact: iionly@gmx.de * https://github.com/iionly * * Original developer of the iZAP Videos plugin: * @package Elgg videotizer, by iZAP Web Solutions * @license GNU Public License version 2 * @Contact iZAP Team "<*****@*****.**>" * @Founder Tarun Jangra "<*****@*****.**>" * @link http://www.izap.in/ * */ $queueStatus = izapIsQueueRunning_izap_videos() ? elgg_echo('izap_videos:running') : elgg_echo('izap_videos:notRunning'); $queue_object = new izapQueue(); $queuedVideos = $queue_object->get(); ?> <div> <h3> <?php echo elgg_echo('izap_videos:queueStatus') . $queueStatus . ' (' . izap_count_queue() . ')'; ?> </h3> <?php if (count($queuedVideos)) { ?> <table class="izap_table"> <tbody> <?php
/** * Deletes a video, override for the parent delete * * @return boolean */ public function delete() { // in case of an uploaded video make sure it's also deleted from queue and trash // with related media if it still remained there if ($this->videotype == 'uploaded') { $queue_object = new izapQueue(); $queue_object->delete_from_trash($this->guid, true); $queue_object->delete($this->guid, true); } $imagesrc = $this->imagesrc; $filesrc = $this->videofile; $ofilesrc = $this->orignalfile; //delete entity from elgg db and corresponding files if exist $this->setFilename($imagesrc); $image_file = $this->getFilenameOnFilestore(); file_exists($image_file) && @unlink($image_file); $this->setFilename($filesrc); $video_file = $this->getFilenameOnFilestore(); file_exists($video_file) && @unlink($video_file); $this->setFilename($ofilesrc); $orignal_file = $this->getFilenameOnFilestore(); file_exists($orignal_file) && @unlink($orignal_file); return parent::delete(); }
<?php /** * iZAP Videos plugin by iionly * (based on version 3.71b of the original izap_videos plugin for Elgg 1.7) * Contact: iionly@gmx.de * https://github.com/iionly * * Original developer of the iZAP Videos plugin: * @package Elgg videotizer, by iZAP Web Solutions * @license GNU Public License version 2 * @Contact iZAP Team "<*****@*****.**>" * @Founder Tarun Jangra "<*****@*****.**>" * @link http://www.izap.in/ * */ $guid = get_input('guid'); $queue_object = new izapQueue(); if ($queue_object->restore($guid)) { system_message(elgg_echo('izap_videos:adminSettings:restore_video')); izapTrigger_izap_videos(); } forward(REFERER);
<?php global $IZAPSETTINGS; // tabs array $activated_options = izapGetVideoOptions_izap_videos(); $tab = get_input('tab', 'settings'); if (!in_array('ONSERVER', $activated_options)) { echo elgg_view('navigation/tabs', array('tabs' => array(array('text' => elgg_echo('settings'), 'href' => '/admin/administer_utilities/izap_videos', 'selected' => $tab == 'settings'), array('text' => elgg_echo('izap_videos:adminSettings:tabs_api_keys'), 'href' => '/admin/administer_utilities/izap_videos?tab=api_keys', 'selected' => $tab == 'api_keys'), array('text' => elgg_echo('izap_videos:adminSettings:tabs_server_analysis'), 'href' => '/admin/administer_utilities/izap_videos?tab=server_analysis', 'selected' => $tab == 'server_analysis')))); } else { $queue_object_status = new izapQueue(); $count_queue = $queue_object_status->count(); $count_trash = $queue_object_status->count_trash(); echo elgg_view('navigation/tabs', array('tabs' => array(array('text' => elgg_echo('izap_videos:adminSettings:tabs_settings'), 'href' => '/admin/administer_utilities/izap_videos', 'selected' => $tab == 'settings'), array('text' => elgg_echo('izap_videos:adminSettings:tabs_api_keys'), 'href' => '/admin/administer_utilities/izap_videos?tab=api_keys', 'selected' => $tab == 'api_keys'), array('text' => elgg_echo('izap_videos:adminSettings:tabs_queue_status', array($count_queue)), 'href' => '/admin/administer_utilities/izap_videos?tab=queue_status', 'selected' => $tab == 'queue_status'), array('text' => elgg_echo('izap_videos:adminSettings:tabs_recycle_bin', array($count_trash)), 'href' => '/admin/administer_utilities/izap_videos?tab=recycle_bin', 'selected' => $tab == 'recycle_bin'), array('text' => elgg_echo('izap_videos:adminSettings:tabs_server_analysis'), 'href' => '/admin/administer_utilities/izap_videos?tab=server_analysis', 'selected' => $tab == 'server_analysis')))); } switch ($tab) { case 'api_keys': echo elgg_view('admin/administer_utilities/izap_videos/api_keys'); break; case 'queue_status': echo elgg_view('admin/administer_utilities/izap_videos/queue_status'); break; case 'recycle_bin': echo elgg_view('admin/administer_utilities/izap_videos/recycle_bin'); break; case 'server_analysis': echo elgg_view('admin/administer_utilities/izap_videos/server_analysis'); break; default: case 'settings': echo elgg_view('admin/administer_utilities/izap_videos/settings'); break;
* * @package Elgg videotizer, by iZAP Web Solutions. * @license GNU Public License version 3 * @Contact iZAP Team "<*****@*****.**>" * @Founder Tarun Jangra "<*****@*****.**>" * @link http://www.izap.in/ * */ admin_gatekeeper(); $posted_array = get_input('izap'); if (is_array($posted_array)) { foreach ($posted_array as $key => $value) { if (is_integer($key)) { $guid = $key; break; } } } $queue_object = new izapQueue(); $video_to_be_deleted = $queue_object->get_from_trash($guid); //Send posted comment to user who uploaded this video. if ($posted_array['send_message_' . $guid] == 'yes') { notify_user($video_to_be_deleted[0]['owner_id'], $CONFIG->site_guid, elgg_echo('izap_videos:notifySub:video_deleted'), $posted_array['user_message_' . $guid]); } // delete data from trash if (get_entity($guid)->delete()) { system_message(elgg_echo('izap_videos:adminSettings:deleted_from_trash')); izapTrigger_izap_videos(); } forward($_SERVER['HTTP_REFERER']); exit;
<?php /** * iZAP izap_videos * * @package Elgg videotizer, by iZAP Web Solutions. * @license GNU Public License version 3 * @Contact iZAP Team "<*****@*****.**>" * @Founder Tarun Jangra "<*****@*****.**>" * @link http://www.izap.in/ * */ admin_gatekeeper(); $queue_object = new izapQueue(); foreach ($queue_object->get(get_input('guid')) as $key => $prods) { get_entity($prods['guid'])->delete(); } system_message(elgg_echo('izap_videos:adminSettings:reset_queue')); forward($_SERVER['HTTP_REFERER']); exit;
/** * Check file existance and send for conversion * * @param string $file * @param integer $videoId * @param string $videoTitle * @param string $videoUrl * @param integer $ownerGuid * @param integer $accessId * * @return mixed string if video converted successfully, array if video not converted successfully * * @version 5.0 */ function izap_convert_video_izap_videos($file, $videoId, $videoTitle, $videoUrl, $ownerGuid, $accessId = 2) { if (file_exists($file)) { $queue_object = new izapQueue(); $video = new izapConvert($file); $videofile = $video->izap_video_convert(); //if file converted successfully then change flag from pending to processed if (!is_array($videofile)) { $queue_object->change_conversion_flag($videoId); return $videofile; } else { $err_message = $videofile['message']; } } else { $err_message = elgg_echo('izap_videos:file not found'); } if (isset($err_message)) { $return = array('error' => true, 'message' => $err_message); } return $return; }
/** * this fucntion actually converts the video * @param string $file file loacation * @param int $videoId video guid * @param int $ownerGuid video owner guid * @param int $accessId access id * @return boolean */ function izapConvertVideo_izap_videos($file, $videoId, $videoTitle, $videoUrl, $ownerGuid, $accessId = 2) { global $CONFIG; $return = FALSE; // works only if we have the input file if (file_exists($file)) { // now convert video // // Need to set flag for the file going in the conversion. $queue_object = new izapQueue(); $queue_object->change_conversion_flag($videoId); $video = new izapConvert($file); $videofile = $video->izap_video_convert(); // check if every this is ok if (!is_array($videofile)) { // if every thing is ok then get back values to save $file_values = $video->getValues(); $izap_videofile = 'izap_videos/uploaded/' . $file_values['filename']; $izap_origfile = 'izap_videos/uploaded/' . $file_values['origname']; $izap_videos = new IzapVideos($videoId); $izap_videos->setFilename($izap_videofile); $izap_videos->open("write"); $izap_videos->write($file_values['filecontent']); //check if you do not want to keep original file if (get_plugin_setting('izapKeepOriginal', GLOBAL_IZAP_VIDEOS_PLUGIN) == 'YES') { $izap_videos->setFilename($izap_origfile); $izap_videos->open("write"); $izap_videos->write($file_values['origcontent']); } $izap_videos->converted = 'yes'; $izap_videos->videofile = $izap_videofile; $izap_videos->orignalfile = $izap_origfile; notify_user($ownerGuid, $CONFIG->site_guid, elgg_echo('izap_videos:notifySub:videoConverted'), sprintf(elgg_echo('izap_videos:notifyMsg:videoConverted'), $izap_videos->getUrl())); return true; } else { $errorReason = $videofile['message']; } } else { $errorReason = elgg_echo('izap_videos:fileNotFound'); } $adminGuid = izapGetSiteAdmin_izap_videos(TRUE); // notify admin notify_user($adminGuid, $CONFIG->site_guid, elgg_echo('izap_videos:notifySub:videoNotConverted'), sprintf(elgg_echo('izap_videos:notifyAdminMsg:videoNotConverted'), $errorReason)); if (!empty($errorReason)) { $return = array('error' => TRUE, 'reason' => $errorReason); } return $return; }
/** * This function actually converts the video * @param string $file file loacation * @param int $videoId video guid * @param int $ownerGuid video owner guid * @param int $accessId access id * @return boolean */ function izapConvertVideo_izap_videos($file, $videoId, $videoTitle, $videoUrl, $ownerGuid, $accessId = 2) { $return = false; // Works only if we have the input file if (file_exists($file)) { // Need to set flag for the file going in the conversion $queue_object = new izapQueue(); $queue_object->change_conversion_flag($videoId); $video = new izapConvert($file); $videofile = $video->izap_video_convert(); // Check if everything is ok if (!is_array($videofile)) { // If everything is ok then get back values to save $file_values = $video->getValues(); $izap_videofile = 'izap_videos/uploaded/' . $file_values['filename']; $izap_origfile = 'izap_videos/uploaded/' . $file_values['origname']; $izap_videos = get_entity($videoId); $izap_videos->setFilename($izap_videofile); $izap_videos->open("write"); $izap_videos->write($file_values['filecontent']); // Check if we have to keep original file if (izapAdminSettings_izap_videos('izapKeepOriginal') == 'YES') { $izap_videos->setFilename($izap_origfile); $izap_videos->open("write"); $izap_videos->write($file_values['origcontent']); } $izap_videos->converted = 'yes'; $izap_videos->videofile = $izap_videofile; $izap_videos->orignalfile = $izap_origfile; notify_user($ownerGuid, elgg_get_site_entity()->getGUID(), elgg_echo('izap_videos:notifySub:videoConverted'), elgg_echo('izap_videos:notifyMsg:videoConverted', array($videoUrl))); return true; } else { $errorReason = $videofile['message']; } } else { $errorReason = elgg_echo('izap_videos:fileNotFound'); } $adminGuid = izapGetSiteAdmin_izap_videos(true); // notify admin notify_user($adminGuid, elgg_get_site_entity()->getGUID(), elgg_echo('izap_videos:notifySub:videoNotConverted'), elgg_echo('izap_videos:notifyAdminMsg:videoNotConverted', array($errorReason))); if (!empty($errorReason)) { $return = array('error' => true, 'reason' => $errorReason); } return $return; }
/** * Counts the queued videos * @return integer */ function izap_count_queue() { $queue_object = new izapQueue(); return $queue_object->count(); }
<ul> <?php foreach ($options as $option) { ?> <li class="<?php echo $option == $selectedTab ? 'selected' : ''; ?> "> <a href="?option=<?php echo $option; ?> "> <?php echo elgg_echo('izap_videos:adminSettings:tabs_' . $option); if (preg_match("/queue_status|recycle_bin/", $option)) { $queue_object = new izapQueue(); echo $option == 'queue_status' ? ' (' . $queue_object->count() . ')' : ''; echo $option == 'recycle_bin' ? ' (' . $queue_object->count_trash() . ')' : ''; } ?> </a> </li> <?php } ?> </ul> </div> <?php if ($selectedTab == 'settings') { ?>
/** * deletes a video, override for the parent delete * * @return boolean */ public function delete() { global $CONFIG; if ($this->videotype == 'uploaded' && $this->converted == 'no') { // delete entity from queue and trash with related media $queue_object = new izapQueue(); $queue_object->delete_from_trash($this->guid, true); $queue_object->delete($this->guid, true); } $imagesrc = $this->imagesrc; $filesrc = $this->videofile; $ofilesrc = $this->orignalfile; $orignal_thumb = $this->orignal_thumb; //delete entity from elgg db and corresponding files if exist $this->setFilename($imagesrc); $image_file = $this->getFilenameOnFilestore(); file_exists($image_file) && @unlink($image_file); $this->setFilename($filesrc); $video_file = $this->getFilenameOnFilestore(); file_exists($video_file) && @unlink($video_file); $this->setFilename($ofilesrc); $orignal_file = $this->getFilenameOnFilestore(); file_exists($orignal_file) && @unlink($orignal_file); $this->setFilename($orignal_thumb); $orignal_thumb_file = $this->getFilenameOnFilestore(); file_exists($orignal_thumb_file) && @unlink($orignal_thumb_file); return delete_entity($this->guid, TRUE); }
* This file is part of izap-videos plugin for Elgg. * * izap-videos for Elgg is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * izap-videos for Elgg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with izap-videos for Elgg. If not, see <http://www.gnu.org/licenses/>. */ $queue = new izapQueue(); ?> <div class="elgg-module elgg-module-inline"> <div class="elgg-body"> <table class="elgg-table-alt"> <tbody> <tr class="even"> <td> <?php echo elgg_echo('admin:statistics:izap-videos-queue'); ?> </td> <td> <?php echo $queue->check_process() > 0 ? elgg_echo('izap_videos:running') : elgg_echo('izap_videos:notRunning'); ?>
/** * iZAP Videos plugin by iionly * (based on version 3.71b of the original izap_videos plugin for Elgg 1.7) * Contact: iionly@gmx.de * https://github.com/iionly * * Original developer of the iZAP Videos plugin: * @package Elgg videotizer, by iZAP Web Solutions * @license GNU Public License version 2 * @Contact iZAP Team "<*****@*****.**>" * @Founder Tarun Jangra "<*****@*****.**>" * @link http://www.izap.in/ * */ $queueStatus = izapIsQueueRunning_izap_videos() ? elgg_echo('izap_videos:running') : elgg_echo('izap_videos:notRunning'); $buggy_videos_object = new izapQueue(); $buggy_videos = $buggy_videos_object->get_from_trash(); $main_url = elgg_get_site_url() . 'admin/administer_utilities/izap_videos?tab=recycle_bin'; ?> <form method="post" action="<?php echo elgg_add_action_tokens_to_url(elgg_get_site_url() . 'action/izap_videos/admin/recycle_delete'); ?> "> <div> <h3 align="center"> <?php echo elgg_echo('izap_videos:error_videos'); ?> </h3> <?php
* it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * (at your option) any later version. * * izap-videos for Elgg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with izap-videos for Elgg. If not, see <http://www.gnu.org/licenses/>. */ require_once dirname(dirname(dirname(__FILE__))) . "/engine/start.php"; $guid = (int) get_input('file_guid', 0); $entity = get_entity($guid); $izapqueue_obj = new izapQueue(); $get_converted_video = $izapqueue_obj->get_converted_video($guid); if (!elgg_instanceof($entity, 'object', 'izap_video')) { exit; } if ($get_converted_video) { $get_video_name = end(explode('/', $get_converted_video[0]['main_file'])); $izapvideo_obj = new IzapVideo(); $set_video_name = $izapvideo_obj->getTmpPath($get_video_name); $set_video_name = preg_replace('/\\.[^.\\s]{3,4}$/', '', $set_video_name) . '_c.flv'; $elggfile_obj = new ElggFile(); $elggfile_obj->owner_guid = $entity->owner_guid; $elggfile_obj->setFilename($set_video_name); if (file_exists($elggfile_obj->getFilenameOnFilestore())) { // echo $elggfile_obj->getFilenameOnFilestore(); exit; $contents = $elggfile_obj->grabFile();
* iZAP izap_videos * * @package Elgg videotizer, by iZAP Web Solutions. * @license GNU Public License version 3 * @Contact iZAP Team "<*****@*****.**>" * @Founder Tarun Jangra "<*****@*****.**>" * @link http://www.izap.in/ * */ if ($vars['video']->canEdit()) { $DeleteEdit .= elgg_view("output/confirmlink", array('href' => $vars['url'] . "action/izapDelete?video_id=" . $vars['video']->getGUID(), 'text' => elgg_echo('delete'), 'confirm' => elgg_echo('izap_videos:remove'))); $DeleteEdit .= ' '; if ($vars['video']->converted == 'yes') { $DeleteEdit .= '<a href="' . $vars['url'] . 'pg/videos/edit/' . get_entity($vars['video']->container_guid)->username . '/' . $vars['video']->getGUID() . '">' . elgg_echo('izap_videos:edit') . '</a>'; } else { $queue_object = new izapQueue(); $trash_guid_array = $queue_object->get_from_trash($vars['video']->guid); if ($trash_guid_array) { $DeleteEdit .= elgg_echo("izap_videos:form:izapTrashedVideoMsg"); } else { $DeleteEdit .= elgg_echo("izap_videos:form:izapEditMsg"); } } } $DeleteEdit .= ' '; $description = elgg_view('output/longtext', array('value' => $vars['video']->description)); $container_entity = get_entity($vars['video']->container_guid); ?> <div class="contentWrapper"> <div class="generic_comment">