/** * Returns HTML containing all video details. * @param integer $cid Content ID of the video. * @return string JSON String */ function getVideoHtml($cid) { $v=new video($cid); $tagarray=$v->getTags(); $c=count($tagarray); $tags=""; for($i=0;$i<$c;$i++) $tags.="<li><a href='search.php?tag=".$tagarray[$i]."'>".$tagarray[$i]."</a></li>"; $video= "<span class='videoTitle'>".$v->getTitle()."</span> <!-- Begin VideoJS --> <div class='video-js-box'> <video cid='".$v->getContentId()."' poster='".$v->getPoster()."' class='video-js' controls preload height=325 width=550> <source src='".$v->getCompletePath()."' type='video/ogg; codecs=\"theora, vorbis\"' /> </video> </div> <!-- End VideoJS --> <!-- video bar --> <div class='videoBar'> <img src='pics/vidbar/watch.png' class='VideoBarButton' /><span class='videoBarElement' id='playCount'>Views:".$v->getViewCount()."</span> <span id='likes' defStatus='1' ></span> <img src='pics/vidbar/download.png' title='Download' class='VideoBarButton' style='float:right;' id='downloadButton' /> </div> <!-- /video bar --> <img src='pics/vidbar/tag.png' title='tags' style='margin-left:6px;'/> <ul class='tags'>".$tags."</ul> <div class='VideoDesc'>".$v->getDesc()."</div>"; $v->addViewCount(); return $video; }
/** * * @param * @return */ function getRelatedSeriesJson($sid) { $seriesvideos = content::getCompleteSeries($sid); $count = count($seriesvideos); $json = array(); for ($i = 0; $i < $count; $i++) { $obj = new video($seriesvideos[$i]); array_push($json, array('cid' => $obj->getContentId(), 'title' => $obj->getTitle(), 'viewcount' => $obj->getViewCount(), 'poster' => $obj->getPoster(), 'timestamp' => $obj->getTimestamp(), 'uid' => $obj->getUserId(), 'uname' => user::getFullNameS($obj->getUserId()))); } return json_encode($json); }
include '../functions/class.video.php'; session_start(); global $global_raw_videos_folder, $global_user_folder; if( isset($_POST['title']) && isset($_POST['desc']) && isset($_SESSION['uid']) && isset($_POST['file']) && isset($_POST['tags'])){ $v = new video($_POST['title'], $_POST['desc'], $_SESSION['uid'], "SP", "videos", $_POST['file']); if($v->getContentId()){ $v->addTags($_POST['tags']); $mvcommand = "mv ".$_SERVER["DOCUMENT_ROOT"]."/".$global_raw_videos_folder."/".$_POST['file'].".ogv" ." ".$_SERVER["DOCUMENT_ROOT"]."/"."videos"."/".$v->getContentId().$_POST['file'].".ogv"; $mv = shell_exec($mvcommand); echo "{ \"status\" : 1 ,\"cid\" : ".$v->getContentId()."}"; } else{ echo "{ \"status\" : 0 }"; } } else{ echo "{ \"status\" : 0 }"; }