/** * system cleanup */ function ajax_WarpHdSync() { global $smartyvs; $db = & JFactory::getDBO(); $c = hwd_vs_Config::get_instance(); require_once(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_hwdvideoshare'.DS.'libraries'.DS.'warp'.DS.'infin-lib.php'); $accountKey = $c->warpAccountKey; $secretKey = $c->warpSecretKey; $query = 'SELECT * FROM #__hwdvidsvideos WHERE video_type = "warphd"'; $db->SetQuery($query); $rows = $db->loadObjectList(); for ($i=0, $n=count($rows); $i < $n; $i++) { $row = $rows[$i]; $infinVideo = new InfinovationVideo($accountKey, $secretKey); $videoInfo = $infinVideo->getVideoInfo($row->video_id); $duration = hwd_vs_tools::sec2hms($videoInfo->duration); $db->SetQuery("UPDATE #__hwdvidsvideos SET video_length = \"$duration\" WHERE id = $row->id"); if ( !$db->query() ) { echo "<script> alert('".$db->getErrorMsg()."'); window.history.go(-1); </script>\n"; exit(); } } echo "Synchronised ".count($rows)." WarpHD videos"; exit; }
* * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ defined( '_JEXEC' ) or die( 'Direct Access to this location is not allowed.' ); global $hwdvsItemid, $smartyvs; $c = hwd_vs_Config::get_instance(); require_once(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_hwdvideoshare'.DS.'libraries'.DS.'warp'.DS.'infin-lib.php'); $videoInfo = "title=".htmlspecialchars($title)."&description=".htmlspecialchars($description)."&category_id=".htmlspecialchars($category_id)."&tags=".htmlspecialchars($tags)."&public_private=".htmlspecialchars($public_private)."&allow_comments=".htmlspecialchars($allow_comments)."&allow_embedding=".htmlspecialchars($allow_embedding)."&allow_ratings=".htmlspecialchars($allow_ratings); $accountKey = $c->warpAccountKey; $secretKey = $c->warpSecretKey; $infinVideo = new InfinovationVideo($accountKey, $secretKey); $newVideoGuid = $infinVideo->getNewVideoGuid(); $uploadSignature = $infinVideo->generateUploadSignature($newVideoGuid); $postUrl = urlencode(JRoute::_("index.php?option=com_hwdvideoshare&Itemid=".$hwdvsItemid."&task=uploadconfirmwarp&videoGuid=$newVideoGuid&$videoInfo")); $flashvar = "AccountKey=$accountKey&VideoGuid=$newVideoGuid&Signature=$uploadSignature&PostURL=$postUrl&AllowWebcam=1&SizeLimit=0&RecordingLimit=0&MaxDuration=0"; $ul = '<script type="text/javascript" language="javascript" src="'.JURI::base().'/components/com_hwdvideoshare/assets/js/AC_OETags.js"></script> <script type="text/javascript" language="javascript"> <!-- var requiredMajorVersion = 9; var requiredMinorVersion = 0; var requiredRevision = 115; var hasProductInstall = DetectFlashVer(6, 0, 65); var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision); if ( hasProductInstall && !hasRequestedVersion ) { var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
/** * Outputs frontpage HTML * * @return Nothing */ function uploadConfirmWarp() { global $Itemid; $c = hwd_vs_Config::get_instance(); $db = & JFactory::getDBO(); $my = & JFactory::getUser(); $acl= & JFactory::getACL(); $video_id = JRequest::getVar( 'videoGuid', '' ); $title = hwd_vs_tools::generatePostTitle(); $description = hwd_vs_tools::generatePostDescription(); $tags = hwd_vs_tools::generatePostTags(); $category_id = JRequest::getInt("category_id", 0); $public_private = JRequest::getWord("public_private", ""); $allow_comments = JRequest::getInt("allow_comments", 0); $allow_embedding = JRequest::getInt("allow_embedding", 0); $allow_ratings = JRequest::getInt("allow_ratings", 0); $checkform = hwd_vs_tools::checkFormComplete($title, $description, $category_id, $tags, $public_private, $allow_comments, $allow_embedding, $allow_ratings); if (!$checkform) { return; } require_once(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_hwdvideoshare'.DS.'libraries'.DS.'warp'.DS.'infin-lib.php'); $accountKey = $c->warpAccountKey; $secretKey = $c->warpSecretKey; // update warp hd $infinVideo = new InfinovationVideo($accountKey, $secretKey); $infinVideo->updateVideo($video_id, $title, $description, $tags, $my->id, ""); $row = new hwdvids_video($db); $_POST['approved'] = "yes"; $_POST['video_type'] = "warphd"; $_POST['video_id'] = $video_id; $password = Jrequest::getVar( 'hwdvspassword', '' ); if (!empty($password)) { $_POST['password'] = $password; } $_POST['title'] = $title; $_POST['description'] = $description; $_POST['category_id'] = $category_id; $_POST['tags'] = $tags; $_POST['public_private'] = $public_private; $_POST['allow_comments'] = $allow_comments; $_POST['allow_embedding'] = $allow_embedding; $_POST['allow_ratings'] = $allow_ratings; $_POST['date_uploaded'] = date('Y-m-d H:i:s'); $_POST['user_id'] = $my->id; $_POST['published'] = "1"; if(empty($_POST['video_id'])) { hwd_vs_tools::infomessage(4, 0, _HWDVIDS_TITLE_UPLDFAIL, _HWDVIDS_ERROR_UPLDERR01, "exclamation.png", 0); return; } // bind it to the table if (!$row->bind($_POST)) { echo "<script type=\"text/javascript\">alert('".$row->getError()."');window.history.go(-1);</script>\n"; exit(); } // store it in the db if (!$row->store()) { echo "<script type=\"text/javascript\">alert('".$row->getError()."');window.history.go(-1);</script>\n"; exit(); } include_once(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_hwdvideoshare'.DS.'helpers'.DS.'events.php'); $params->title = $title; $params->id = $row->id; $params->category_id = $row->category_id; $params->type = $row->video_type; $params->user_id = $row->user_id; hwdvsEvent::onAfterVideoUpload($params); hwd_vs_html::uploadConfirm($title, $row); }