foreach book as singleArhiv PR singleArhiv end_name_Temp explode singl

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
foreach ($book as $singleArhiv)
{
PR($singleArhiv);
$end_name_Temp=explode("/",$singleArhiv);
$final_name=explode(".",$end_name_Temp[count($end_name_Temp)-1]);
$pathToExist=$destanation."/".$final_name[0].".mp3";
echo "\n".$pathToExist."\n";
$flag=explode("_",$final_name[0]);
//PR($flag);
//exit();
if(!file_exists($pathToExist)&&$flag[0]&&$flag[1])
{
$fp=fopen($newDir."/".$final_name[0].".mp3","w");
CopyToTmp($singleArhiv,$tmp_dir);
Decompress($tmp_dir);
$pathToNewFile=wrapMp3($newDir,$tmp_dir);
$titleTmp=explode("_",$final_name[0]);
$title=$titleTmp[0];
@mysql_connect($host,$username,$pass) or die("Error connecting to database".mysql_error());
mysql_select_db($database_name);
$query="SELECT name FROM `content` WHERE id = ".$title;
$res=query($query);
$data=fetch_assoc($res);
mysql_close();
fclose($fp);
lame($pathToNewFile,$newDir,$bitrate,$final_name[0],$data['name']);
}
else echo "\n File exist! ".$pathToExist."\n";
}