PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
xeo
Forum Newbie
Posts: 3 Joined: Mon Aug 06, 2007 12:59 am
Post
by xeo » Mon Aug 06, 2007 1:07 am
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
aileenguan
Forum Newbie
Posts: 3 Joined: Sun Aug 05, 2007 10:52 pm
Location: P.R.C.
Post
by aileenguan » Mon Aug 06, 2007 2:41 am
hey,man. where is your uploader class??
xeo
Forum Newbie
Posts: 3 Joined: Mon Aug 06, 2007 12:59 am
Post
by xeo » Mon Aug 06, 2007 2:43 am
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;
}
}
?>