Changeset 4 for www/share/playlist.php
- Timestamp:
- Jan 14, 2008, 9:48:39 PM (17 years ago)
- Location:
- www
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
www
-
Property svn:ignore
set to
config.php
php_script_error.log
-
Property svn:ignore
set to
-
www/share/playlist.php
r1 r4 1 <? 2 include('../ is/db.php');1 <?php 2 include('../global.php'); 3 3 // Omezení na online/offline uµivatele 4 DB_Init('localhost','root','','is');5 4 6 DB_Query('SELECT id FROM hosts WHERE online=1 AND block=0 AND user>0');5 $DbResult = $Database->query('SELECT id FROM hosts WHERE online=1 AND block=0 AND user>0'); 7 6 $Vyber = ''; 8 7 $Podminka = ''; 9 while($Row = DB_Row()) $Vyber .= $Row['id'].','; 10 $Podminka .= ' AND (host IN ('.substr($Vyber,0,-1).'))'; 8 while($Row = $DbResult->fetch_array()) 9 $Vyber .= $Row['id'].','; 10 $Podminka .= ' AND (host IN ('.substr($Vyber,0,-1).'))'; 11 11 //echo($Podminka.'<br>'); 12 12 13 DB_Init('localhost', 'root', '','share');13 $Database->select_db('share'); 14 14 15 15 // Maximální vnoøení … … 19 19 function PlnaCesta($Row) 20 20 { 21 global $MaxNesting; 21 global $MaxNesting, $Database; 22 22 23 // Vyhledání cesty 23 24 $Otec = $Row['parent']; 24 25 $Cesta = ''; //$Row['name']; 25 DB_Save();26 26 $i = 0; 27 27 while(($Otec>1)&&($i<$MaxNesting)) 28 28 { 29 DB_Query("SELECT id,name,parent FROM items WHERE id=$Otec");30 $Row = DB_Row();29 $DbResult = $Database->query("SELECT id,name,parent FROM items WHERE id=$Otec"); 30 $Row = $DbResult->fetch_array(); 31 31 $Cesta = $Row['name'].'\\'.$Cesta; 32 32 $Otec = $Row['parent']; 33 33 $i++; 34 34 } 35 DB_Load();36 35 if($i >= $MaxNesting) $Cesta = '?'.'\\'.$Cesta; 37 36 return('\\\\'.$Cesta); 38 37 } 39 38 39 function mime_content_type($FileName) 40 { 41 //$FileInfo = new finfo(FILEINFO_MIME); 42 //return($FileInfo->file($FileName)); 43 return(''); 44 } 45 40 46 $Name = 'playlist.m3u'; 41 Header('Content-type: '+mime_content_type($Name));47 Header('Content-type: audio/x-mpegurl'); 42 48 Header('Content-Disposition: attachment; filename='.$Name); 43 49 echo("#EXTM3U\n"); 44 50 $Parent = '0'; 45 51 $Dir = ''; 46 DB_Select('items', '*', 'ext="mp3"'.$Podminka); //.' LIMIT 0,1000');47 while($Row = DB_Row())52 $DbResult = $Database->select('items', '*', 'ext="mp3"'.$Podminka); //.' LIMIT 0,1000'); 53 while($Row = $DbResult->fetch_array()) 48 54 { 49 DB_Save();50 55 if($Parent != $Row['parent']) $Dir = PlnaCesta($Row); //echo('d'.PlnaCesta($Row)."\n"); 51 56 $Parent = $Row['parent']; 52 57 echo($Dir.$Row['name'].'.'.$Row['ext']."\n"); 53 DB_Load();54 58 } 55 59
Note:
See TracChangeset
for help on using the changeset viewer.