-
Achtube upload Fehler
Ich hab mir kürzlich die Komponente Achtube v.1.2 geholt und installiert.
Wenn ich im Frontend ein Video uploaden will kommt immer die Fehlermeldung das ich die Videobeschreibung eingeben musst...
-------------------------------------------------------------------------------------------
<?php
/**
* ACHTube - Video Broadcast Component for JOOMLA
* @version 1.1.2
* @package ACHTube
* @copyright (C) 2007 by Ahmet Cihat Holta
* @license http://www.achtube.com/ Copyrighted Software
**/
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.');
require_once( $mainframe->getPath( 'front_html' ) );
require_once( $mainframe->getPath( 'class' ) );
switch( $task ) {
case 'view':
view($id);
break;
case 'upload':
if ($my->id==""){
header("Location:index.php?option=com_login");
}
upload($file,$desc,$catid,$title);
break;
default:
if ($my->id==""){
header("Location:index.php?option=com_login");
}
upload($file,$catid,$title);
break;
}
function view($id){
global $database;
$viddet = new mosContent( $database );
$vid = $id;
if (!$viddet->load( $vid )) {
echo "Error: Cannot load user with id $vid\n";
}
$sql = 'SELECT * FROM #__achtube_config';
$database->setQuery( $sql );
$conf = NULL;
$database->loadObject( $conf );
HTML_achtube::liste($conf,$viddet);
}
function upload($file,$desc,$catid,$title){
global $mosConfig_absolute_path,$mosConfig_live_site,$dat abase,$my;
$query = "SELECT s.name as name, s.id as id from #__categories as s WHERE s.published = 1 AND s.access <= '$usertype' ORDER BY s.ordering";
$database->setQuery($query);
$cats = $database->loadObjectList();
$mycat[] = mosHTML::makeOption( -1, "Select Category");
foreach($cats as $obj){
$mycat[] = mosHTML::makeOption( $obj->id, $obj->name);
}
$lists['cats'] = mosHTML::selectList( $mycat, 'catid', 'class="inputbox" size="1" onchange="createNewSubmit()"', 'value', 'text');
HTML_achtube::upload($option, $rows[0], $lists);
if($_POST[submit]!=""){
global $database;
$vid = new stdClass;
if ($title==""){
$hata = "Bitte gib einen Videotitel an";
}
if ($desc==""){
$hata = "Bitte gib eine Videobeschreibung an";
}
if ($catid=="-1"){
$hata = "Bitte wähle eine Kategorie aus";
}
if ($file==""){
$hata = "Bitte wähle ein Video zum Uploaden aus";
}
if ($hata!=""){
mosRedirect("index.php?option=com_achtube&task=upl oad", $hata);
}
$vhost = $_FILES['file']['name'];
$vhos = strrpos($vhost,".");
$vex = strtolower(substr($vhost,$vhos+1,strlen($vhost)-$vhos));
$vsize = round($_FILES['file']['size']/(1024*1024));
if ($vex!="mpg" && $vex!="avi" && $vex!="mpeg" && $vex!="wmv" && $vex!="rm" && $vex!="dat"){
$hata = "Invalid video format";
}
if ($space > $row_acht['maxvideo']){
$hata = "Video size is too big. Upload limit is : ".$row_acht['maxvideo']." Mb.";
}
$vid->title = $title;
$vid->title_alias = $desc;
$vid->created_by = $my->id;
$vid->created_by_alias = $my->name;
$vid->catid = $catid;
$vid->state = "1";
$vid->sectionid = "1";
$vid->created = date( 'Y-m-d H:i:s' );
$vid->publish_up = date( 'Y-m-d H:i:s' );
$vid->metakey = $title." , ".$desc;
$vid->metadesc = $title." , ".$desc;
if (!$database->insertObject( '#__content', $vid, 'id' )) {
echo $database->stderr();
return false;
}
$videono = mysql_insert_id();
$videoname = $videono.".".$vex;
if(isset($_FILES['file']['tmp_name']) && is_uploaded_file($_FILES['file']['tmp_name'])){
global $database;
$database->setQuery( "SELECT * FROM #__achtube_config");
$database->loadObject($row);
if ($database -> getErrorNum()) {
echo $database -> stderr();
return false;
}
$videonhost = $mosConfig_absolute_path.$row->videodir."/".$videoname;
if(move_uploaded_file($_FILES['file']['tmp_name'], $videonhost)){
$flvmaker = $row->ffmpegdir;
if($row->htype=="1"){
$flvmaker = $mosConfig_absolute_path.$row->ffmpegdir;
}
exec ($flvmaker." -i ".$videonhost." -acodec ".$row->acodec." -ab ".$row->abit." -ar ".$row->arate." -b ".$row->vbit." -r ".$row->frate." -s ".$row->flvsize." ".$mosConfig_absolute_path.$row->flvdir."/".$videono.".flv");
exec ($flvmaker." -an -y -t 0:5:0.001 -i ".$mosConfig_absolute_path.$row->flvdir."/".$videono.".flv -f image2 ".$mosConfig_absolute_path.$row->jpgdir."/".$videono.".jpg");
$ssim = $mosConfig_absolute_path.$row->jpgdir."/".$videono.".jpg";
$simg = imagecreatefromjpeg($ssim);
$ddim = $mosConfig_absolute_path.$row->tmbdir."/".$videono.".jpg";
$dimg = imagecreatetruecolor($row->tmbl, $row->tmbw);
imagecopyresized($dimg, $simg, 0, 0, 0, 0, $row->tmbl, $row->tmbw, $row->flvl, $row->flvw);
imagejpeg($dimg, $ddim, $row->imgq);
//update
global $database;
$id = $videono;
$vid->ordering = $videono;
$vid->introtext = '<p><a href="'.$mosConfig_live_site.'/index.php?option=com_achtube&task=view&id= '.$videono.'&Itemid=1&"><img src="'.$mosConfig_live_site.$row->tmbdir.'/'.$videono.'.jpg" border="0" title="'.$title.'" /></a></p><p>'.$desc.'</p><hr />';
$vid->attribs = $vex;
if (!$database->updateObject( '#__content', $vid, 'id' )) {
echo $database->stderr();
return false;
}
global $database;
$vidf = new stdClass;
$vidf->content_id = $videono;
$vidf->ordering = $videono;
if (!$database->insertObject( '#__content_frontpage', $vidf, 'id' )) {
echo $database->stderr();
return false;
}
}
}
header("Location:index.php");
}
}
?>
-----------------------------------------------------------------------------------------
Könnt mir jemand sagen wo der Fehler drin ist damit die Fehlermeldung nich t immer kommt oder wie man es umschreiben könnte das die Videobeschreibung nicht Notwendig ist.
Würd mich freuen wenn mir es jemand so umschreiben könnte das die Meldung nicht immer kommt.
-
Berechtigungen
- Neue Themen erstellen: Nein
- Themen beantworten: Nein
- Anhänge hochladen: Nein
- Beiträge bearbeiten: Nein
Foren-Regeln
Lesezeichen