Помощь по скриптам | Подскажите по DS
Короче проблема в файлах, а точнее в музыке.
Некоторые треки загружаешь и все нормально, открываешь и добавляешь в музыку.
Но большенство загружаешь трек, открываешь и тупо белый экран! (Это даже на чистых версиях социала).
Как исправить это?
Некоторые треки загружаешь и все нормально, открываешь и добавляешь в музыку.
Но большенство загружаешь трек, открываешь и тупо белый экран! (Это даже на чистых версиях социала).
Как исправить это?
DENZEL, код хотя бы покажите
ZnTor,
[code]<?php
require_once H."sys/inc/PEAR.php" ;
define('PEAR_MP3_ID_FNO', 1);
define('PEAR_MP3_ID_RE', 2);
define('PEAR_MP3_ID_TNF', 3);
define('PEAR_MP3_ID_NOMP3', 4);
class MP3_Id {
var $file = false;
var $id3v1 = false;
var $id3v11 = false;
var $id3v2 = false;
var $name = '';
var $artists = '';
var $album = '';
var $year = '';
var $comment = '';
var $track = 0;
var $genre = '';
var $genreno = 255;
var $studied = false;
var $mpeg_ver = 0;
var $layer = 0;
var $bitrate = 0;
var $crc = false;
var $frequency = 0;
var $encoding_type = 0;
var $samples_per_frame = 0;
var $samples = 0;
var $musicsize = -1;
var $frames = 0;
var $quality = 0;
var $padding = false;
var $private = false;
var $mode = '';
var $copyright = false;
var $original = false;
var $emphasis = '';
var $filesize = -1;
/**
* Byte at which the first mpeg header was found
* @var integer
*/
var $frameoffset = -1;
/**
* length of mp3 format hh:mm:ss
* @var string
*/
var $lengthh = false;
/**
* length of mp3 format mm:ss
* @var string
*/
var $length = false;
/**
* length of mp3 in seconds
* @var string
*/
var $lengths = false;
/**
* if any errors they will be here
* @var string
*/
var $error = false;
/**
* print debugging info?
* @var boolean
*/
var $debug = false;
/**
* print debugg
* @var string
*/
var $debugbeg = '<DIV STYLE="margin: 0.5 em; padding: 0.5 em; border-width: thin; border-color: black; border-style: solid">';
/**
* print debugg
* @var string
*/
var $debugend = '</DIV>';
/*
* creates a new id3 object
* and loads a tag from a file.
*
* @param string $study study the mpeg frame to get extra info like bitrate and frequency
* You should advoid studing alot of files as it will siginficantly
* slow this down.
* @access public
*/
function MP3_Id($study = false) {
if(defined('ID3_SHOW_DEBUG')) $this->debug = true;
$this->study=($study || defined('ID3_AUTO_STUDY'));
} // id3()
/**
* reads the given file and parse it
*
* @param string $file the name of the file to parse
* @return mixed PEAR_Error on error
* @access public
*/
function read( $file="") {
if ($this->debug) print($this->debugbeg . "id3('$file')<HR>\n");
if(!empty($file))$this->file = $file;
if ($this->debug) print($this->debugend);
return $this->_read_v1();
}
/**
* sets a field
*
* possible names of tags are:
* artists - Name of band or artist
* album - Name of the album
* year - publishing year of the album or song
* comment - song comment
* track - the number of the track
* genre - genre of the song
* genreno - Number of the genre
*
* @param mixed $name Name of the tag to set or hash with the key as fieldname
* @param mixed $value the value to set
*
* @access public
*/
function setTag($name, $value) {
if( is_array($name)) {
foreach( $name as $n => $v) {
$this -> $n = $v ;
}
} else {
$this -> $name = $value ;
}
}
/**
* get the value of a tag
*
* @param string $name the name of the field to get
* @param mixed $default returned if the field not exists
*
* @return mixed The value of the field
* @access public
* @see setTag
*/
function getTag($name, $default = 0) {
if(empty($this -> $name)) {
return $default ;
} else {
return $this -> $name ;
}
}
/**
* update the id3v1 tags on the file.
* Note: If/when ID3v2 is implemented this method will probably get another
* parameters.
*
* @param boolean $v1 if true update/create an id3v1 tag on the file. (defaults to true)
*
* @access public
*/
function write($v1 = true) {
if ($this->debug) print($this->debugbeg . "write()<HR>\n");
if ($v1) {
$this->_write_v1();
}
if ($this->debug) print($this->debugend);
} // write()
/**
* study() - does extra work to get the MPEG frame info.
*
* @access public
*/
function study() {
$this->studied = true;
$this->_readframe();
} // study()
/**
* copy($from) - set's the ID3 fields to the same as the fields in $from
*
* @param string $from fields to copy
* @access public
*/
function copy($from) {
if ($this->debug) print($this->debugbeg . "copy(\$from)<HR>\n");
$this->name = $from->name;
$this->artists = $from->artists;
$this->album = $from->album;
$this->year = $from->year;
$this->comment = $from->comment;
$this->track = $from->track;
$this->genre = $from->genre;
$this->genreno = $from->genreno;
if ($this->debug) print($this->debugend);
} // copy($from)
/**
* remove - removes the id3 tag(s) from a file.
*
* @param boolean $id3v1 true to remove the tag
* @param boolean $id3v2 true to remove the tag (Not yet implemented)
*
* @access public
*/
function remove($id3v1 = true, $id3v2 = true) {
if ($this->debug) print($this->debugbeg . "remove()<HR>\n");
if ($id3v1) {
$this->_remove_v1();
}
if ($id3v2) {
// TODO: write ID3v2 code
}
if ($this->debug) print($this->debugend);
} // remove
/**
* read a ID3 v1 or v1.1 tag from a file
*
* $file should be the path to the mp3 to look for a tag.
* When in doubt use the full path.
*
* @return mixed PEAR_Error if fails
* @access private
*/
function _read_v1() {
if ($this->debug) print($this->debugbeg . "_read_v1()<HR>\n");
$mqr = get_magic_quotes_runtime();
@set_magic_quotes_runtime(0);
if (! ($f = @fopen($this->file, 'rb')) ) {
return PEAR::raiseError( "Unable to open " . $this->file, PEAR_MP3_ID_FNO);
}
if (fseek($f, -128, SEEK_END) == -1) {
return PEAR::raiseError( 'Unable to see to end
________
посл. ред. 19.05.2019 в 00:30; всего 1 раз(а); by DENZEL
[code]<?php
require_once H."sys/inc/PEAR.php" ;
define('PEAR_MP3_ID_FNO', 1);
define('PEAR_MP3_ID_RE', 2);
define('PEAR_MP3_ID_TNF', 3);
define('PEAR_MP3_ID_NOMP3', 4);
class MP3_Id {
var $file = false;
var $id3v1 = false;
var $id3v11 = false;
var $id3v2 = false;
var $name = '';
var $artists = '';
var $album = '';
var $year = '';
var $comment = '';
var $track = 0;
var $genre = '';
var $genreno = 255;
var $studied = false;
var $mpeg_ver = 0;
var $layer = 0;
var $bitrate = 0;
var $crc = false;
var $frequency = 0;
var $encoding_type = 0;
var $samples_per_frame = 0;
var $samples = 0;
var $musicsize = -1;
var $frames = 0;
var $quality = 0;
var $padding = false;
var $private = false;
var $mode = '';
var $copyright = false;
var $original = false;
var $emphasis = '';
var $filesize = -1;
/**
* Byte at which the first mpeg header was found
* @var integer
*/
var $frameoffset = -1;
/**
* length of mp3 format hh:mm:ss
* @var string
*/
var $lengthh = false;
/**
* length of mp3 format mm:ss
* @var string
*/
var $length = false;
/**
* length of mp3 in seconds
* @var string
*/
var $lengths = false;
/**
* if any errors they will be here
* @var string
*/
var $error = false;
/**
* print debugging info?
* @var boolean
*/
var $debug = false;
/**
* print debugg
* @var string
*/
var $debugbeg = '<DIV STYLE="margin: 0.5 em; padding: 0.5 em; border-width: thin; border-color: black; border-style: solid">';
/**
* print debugg
* @var string
*/
var $debugend = '</DIV>';
/*
* creates a new id3 object
* and loads a tag from a file.
*
* @param string $study study the mpeg frame to get extra info like bitrate and frequency
* You should advoid studing alot of files as it will siginficantly
* slow this down.
* @access public
*/
function MP3_Id($study = false) {
if(defined('ID3_SHOW_DEBUG')) $this->debug = true;
$this->study=($study || defined('ID3_AUTO_STUDY'));
} // id3()
/**
* reads the given file and parse it
*
* @param string $file the name of the file to parse
* @return mixed PEAR_Error on error
* @access public
*/
function read( $file="") {
if ($this->debug) print($this->debugbeg . "id3('$file')<HR>\n");
if(!empty($file))$this->file = $file;
if ($this->debug) print($this->debugend);
return $this->_read_v1();
}
/**
* sets a field
*
* possible names of tags are:
* artists - Name of band or artist
* album - Name of the album
* year - publishing year of the album or song
* comment - song comment
* track - the number of the track
* genre - genre of the song
* genreno - Number of the genre
*
* @param mixed $name Name of the tag to set or hash with the key as fieldname
* @param mixed $value the value to set
*
* @access public
*/
function setTag($name, $value) {
if( is_array($name)) {
foreach( $name as $n => $v) {
$this -> $n = $v ;
}
} else {
$this -> $name = $value ;
}
}
/**
* get the value of a tag
*
* @param string $name the name of the field to get
* @param mixed $default returned if the field not exists
*
* @return mixed The value of the field
* @access public
* @see setTag
*/
function getTag($name, $default = 0) {
if(empty($this -> $name)) {
return $default ;
} else {
return $this -> $name ;
}
}
/**
* update the id3v1 tags on the file.
* Note: If/when ID3v2 is implemented this method will probably get another
* parameters.
*
* @param boolean $v1 if true update/create an id3v1 tag on the file. (defaults to true)
*
* @access public
*/
function write($v1 = true) {
if ($this->debug) print($this->debugbeg . "write()<HR>\n");
if ($v1) {
$this->_write_v1();
}
if ($this->debug) print($this->debugend);
} // write()
/**
* study() - does extra work to get the MPEG frame info.
*
* @access public
*/
function study() {
$this->studied = true;
$this->_readframe();
} // study()
/**
* copy($from) - set's the ID3 fields to the same as the fields in $from
*
* @param string $from fields to copy
* @access public
*/
function copy($from) {
if ($this->debug) print($this->debugbeg . "copy(\$from)<HR>\n");
$this->name = $from->name;
$this->artists = $from->artists;
$this->album = $from->album;
$this->year = $from->year;
$this->comment = $from->comment;
$this->track = $from->track;
$this->genre = $from->genre;
$this->genreno = $from->genreno;
if ($this->debug) print($this->debugend);
} // copy($from)
/**
* remove - removes the id3 tag(s) from a file.
*
* @param boolean $id3v1 true to remove the tag
* @param boolean $id3v2 true to remove the tag (Not yet implemented)
*
* @access public
*/
function remove($id3v1 = true, $id3v2 = true) {
if ($this->debug) print($this->debugbeg . "remove()<HR>\n");
if ($id3v1) {
$this->_remove_v1();
}
if ($id3v2) {
// TODO: write ID3v2 code
}
if ($this->debug) print($this->debugend);
} // remove
/**
* read a ID3 v1 or v1.1 tag from a file
*
* $file should be the path to the mp3 to look for a tag.
* When in doubt use the full path.
*
* @return mixed PEAR_Error if fails
* @access private
*/
function _read_v1() {
if ($this->debug) print($this->debugbeg . "_read_v1()<HR>\n");
$mqr = get_magic_quotes_runtime();
@set_magic_quotes_runtime(0);
if (! ($f = @fopen($this->file, 'rb')) ) {
return PEAR::raiseError( "Unable to open " . $this->file, PEAR_MP3_ID_FNO);
}
if (fseek($f, -128, SEEK_END) == -1) {
return PEAR::raiseError( 'Unable to see to end
________
посл. ред. 19.05.2019 в 00:30; всего 1 раз(а); by DENZEL
Не влазиет
DENZEL (19.05.2019 в 00:31)
Не влазиет
Не влазиет
скинь файлом,такой код так не бросается
Night_devil (19.05.2019 в 02:28)
Включи показ ошибок.
Включи показ ошибок.
Он включён
пробовал на другой хостинг ставить?
Там дело в ужасно устаревшем файле sys/inc/PEAR.php