Page 1 of 1

I have a Problem with OSTUBE

Posted: Mon Aug 06, 2007 1:07 am
by xeo
Hi all i have a problem with the, OSTube in the data class.php

I can upload .FLV Movies it's no problem, but when i'm uploading a mpeg Movie, i have this error:

See the Browser Error:

Code: Select all

Warning: Missing argument 1 for __construct() in /home/xeo/public_html/ostube/uploader/simpleuploader/class.php on line 8
Here is my class.php File

Code: Select all

<?php

class simpleuploader extends uploader {
	var $prio = 1;

	// PHP 5.x Class-Definition

	function __construct(&$parent) {
	
		$this->parent = &$parent;
		$this->enabled = $this->check_conditions();
	
	}
	
	// PHP 4.x Class Definition
	
	function phpuploader(&$parent) {
	
		$this->__construct($parent);
	
	}

	// check-up
	
	function check_conditions() {
			
		return true;
	
	}
	
	//
	//
	//
	
	function head() {
		global $config, $main;
	
		require_once 'SimpleUpload.class.php';

		$this->upload = new SimpleUpload();	
	
	}

}

?>
Can some one help me? i hope :?

Posted: Mon Aug 06, 2007 2:41 am
by aileenguan
hey,man. where is your uploader class??

Posted: Mon Aug 06, 2007 2:43 am
by xeo
Here: SimpleUpload.class.php

Code: Select all

<?php

class SimpleUpload {
	var $name = 'upload';
	var $targetIframeName = false;
	var $progressId = false;
	var $submitName = false;
	var $uploadId = false;
	var $maxFileSize = 8388608;



	var $formExtra = '';

	var $input = '<input id="[name]" name="[submit_name]" size="30" type="file">';

	var $hidden = '<input type=hidden name=UPLOAD_IDENTIFIER value="[id]">';

	function SimpleUpload() {
		
		
	}

	function setMaxFileSize($bytes) {
	
		$this->maxFileSize = $bytes;
	
	}
	
	function enableDebug() {
		$this->formIframe = "Form Submision Iframe Target<br><iframe id='[frame_name]' name='[frame_name]' src='' style='width:500px;height:150px;border:1'></iframe><br>";
	}
	
	function render() {

		if ($this->submitName == false) {
			$this->submitName = $this->name;
		}
		if ($this->progressId == false) {
			$this->progressId = "progress_$this->name";
		}
	
		$ret = str_replace(array('[name]','[submit_name]'),array($this->name,$this->submitName),$this->input);
		return $ret;

	}

	function renderFormExtra() {

	}

	function renderHidden() {
	
		return $this->renderHiddenFields();

	}

	function renderHiddenFields() {

		return str_replace('[id]',$this->getUploadId(),$this->hidden);

	}

	function renderProgressBar() {
	}

	function getUploadId() {
		if ($this->uploadId == false) {
			$this->uploadId = rand() . '.' . time();
		}
		return $this->uploadId;
	}
}
?>