Return to Snippet

Revision: 46723
at May 24, 2011 01:45 by djc


Updated Code
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
  <meta http-equiv="Content-type" content="text/html; charset=iso-8859-2">
  <meta name="Description" content=" [wstaw tu opis strony] ">
  <meta name="Keywords" content=" [wstaw tu slowa kluczowe] ">
  <meta name="Author" content=" [dane autora] ">
  <meta name="Generator" content="kED2">

  <title> [tytu� strony] </title>

  <link rel="stylesheet" href=" [nazwa_arkusza_stylow.css] " type="text/css">
</head>
<body>

<?php

$link = mysql_pconnect('localhost', 'root', '')
or die('Nie moŹna si� po-�czyŠ: ' . mysql_error());
mysql_select_db("protone");

$result2 = mysql_query('SELECT * FROM files ORDER BY ID ASC LIMIT 0,1');
		while ($row2 = mysql_fetch_array($result2))
		{
	
			$lensec = end(explode(".",$row2['FILE_LENGTH_SEC']));
			$lenmin = substr($row2['FILE_LENGTH_TXT'],0,5);
			$len=$lenmin.'.'.$lensec;
			
			
$id_pliku = $row2['ID'];
$artist_id= $row2['ARTIST_ID'];
$opis .= "Lit=\n";
$opis .= "ENG=\n";
$opis .= "CRD=\n";
$opis .= "Tyt=".stripslashes($row2['TITLE'])."\n";
$opis .= "Pta=\n";

$result3 = mysql_query('SELECT * FROM station_files WHERE ID = "'.$id_pliku.'" LIMIT 0,1');
		while ($row3 = mysql_fetch_array($result3))
			{
			//cue
			$startsec = end(explode(".",$row3['CUE_START_SEC']));
			$startsek = $row3['CUE_START_SEC'];
			$startmin = substr($row3['CUE_START_TXT'],0,5);
			$start=$startmin.'.'.$startsec;
			
			$introsec = end(explode(".",$row3['CUE_INTRO_SEC']));
			$intromin = substr($row3['CUE_INTRO_TXT'],0,5);
			$intro=$intromin.'.'.$introsec;
			
			$endsec = end(explode(".",$row3['CUE_END_SEC']));
			$endsek = $row3['CUE_END_SEC'];
			$endmin = substr($row3['CUE_END_TXT'],0,5);
			$end=$endmin.'.'.$endsec;
			
			$mixsec = end(explode(".",$row3['CUE_MIX_SEC']));

			$mixsek = $row3['CUE_MIX_SEC'];
			$mixmin = substr($row3['CUE_MIX_TXT'],0,5);
			$mix=$mixmin.'.'.$mixsec;
			
			
			$miks = ($endsek-$mixsek);
			echo $miks;
			
			$miks = ($endsek-$mixsek);

			$czlon=explode(".",$miks);
			$miksuj = "00:";
			if ($czlon[0]<10) $miksuj .= "0".$miks;
			else $miksuj .= $miks;
						}

			
$result3 = mysql_query('SELECT * FROM artists WHERE id = '.$artist_id.' LIMIT 0,1');
		while ($row3 = mysql_fetch_array($result3))
			{
			//artist
			$wykon=$row3['name'];
			}

			

$opis .= "Wyk=".stripslashes($wykon)."\n";


$opis .= "Sol=\n";
$opis .= "Kom=\n";
$opis .= "Aut=\n";
$opis .= "Pro=\n";
$opis .= "Wyd=\n";
$opis .= "Rok=\n";
$opis .= "Kod=\n";
$opis .= "Ktg=\n";
$opis .= "BPM=\n";
$opis .= "Zak=\n";
$opis .= "Tmc=\n";
$opis .= "Tmi=\n";
$opis .= "Tmo=\n";
$opis .= "Gen=\n";
$opis .= "Era=\n";
$opis .= "Typ=\n";
$opis .= "Nas=\n";
$opis .= "Nar=\n";
$opis .= "Jak=\n";
$opis .= "Klu=\n";
$opis .= "Fil=\n";
$opis .= "PTY=0\n";
$opis .= "PS1=\n";
$opis .= "PS2=\n";
$opis .= "PS3=\n";
$opis .= "PS4=\n";
$opis .= "PLK=".$id_pliku."\n";

$opis .= "Tot=".$len."\n";
$opis .= "Int=".$intro."\n";
$opis .= "Out=00:00.000\n";
$opis .= "Mix=".$miksuj."\n";
$opis .= "Mik=".$mix."\n";
$opis .= "NwP=".$start."\n";
$opis .= "NwK=".$end."\n";
$opis .= "FIn=00:00.000\n";
$opis .= "FOu=00:00.000\n";
$opis .= "LpP=-00:00.001\n";
$opis .= "LpK=-00:00.001\n";
$opis .= "FrP=-00:00.001\n";
$opis .= "FrK=-00:00.001\n";
$opis .= "Zaa=\n";




		}

$fp = fopen(''.$id_pliku.'.DAT', 'w');
fwrite($fp, $opis);
fclose($fp);

// ha!
?>


</body>
</html>

Revision: 46722
at May 24, 2011 01:45 by djc


Initial Code
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html>
<head>
  <meta http-equiv="Content-type" content="text/html; charset=iso-8859-2">
  <meta name="Description" content=" [wstaw tu opis strony] ">
  <meta name="Keywords" content=" [wstaw tu slowa kluczowe] ">
  <meta name="Author" content=" [dane autora] ">
  <meta name="Generator" content="kED2">

  <title> [tytuł strony] </title>

  <link rel="stylesheet" href=" [nazwa_arkusza_stylow.css] " type="text/css">
</head>
<body>

<?php

$link = mysql_pconnect('localhost', 'root', '')
or die('Nie moŹna siŕ po-ŚczyŠ: ' . mysql_error());
mysql_select_db("protone");

$result2 = mysql_query('SELECT * FROM files ORDER BY ID ASC LIMIT 0,1');
		while ($row2 = mysql_fetch_array($result2))
		{
	
			$lensec = end(explode(".",$row2['FILE_LENGTH_SEC']));
			$lenmin = substr($row2['FILE_LENGTH_TXT'],0,5);
			$len=$lenmin.'.'.$lensec;
			
			
$id_pliku = $row2['ID'];
$artist_id= $row2['ARTIST_ID'];
$opis .= "Lit=\n";
$opis .= "ENG=\n";
$opis .= "CRD=\n";
$opis .= "Tyt=".stripslashes($row2['TITLE'])."\n";
$opis .= "Pta=\n";

$result3 = mysql_query('SELECT * FROM station_files WHERE ID = "'.$id_pliku.'" LIMIT 0,1');
		while ($row3 = mysql_fetch_array($result3))
			{
			//cue
			$startsec = end(explode(".",$row3['CUE_START_SEC']));
			$startsek = $row3['CUE_START_SEC'];
			$startmin = substr($row3['CUE_START_TXT'],0,5);
			$start=$startmin.'.'.$startsec;
			
			$introsec = end(explode(".",$row3['CUE_INTRO_SEC']));
			$intromin = substr($row3['CUE_INTRO_TXT'],0,5);
			$intro=$intromin.'.'.$introsec;
			
			$endsec = end(explode(".",$row3['CUE_END_SEC']));
			$endsek = $row3['CUE_END_SEC'];
			$endmin = substr($row3['CUE_END_TXT'],0,5);
			$end=$endmin.'.'.$endsec;
			
			$mixsec = end(explode(".",$row3['CUE_MIX_SEC']));

			$mixsek = $row3['CUE_MIX_SEC'];
			$mixmin = substr($row3['CUE_MIX_TXT'],0,5);
			$mix=$mixmin.'.'.$mixsec;
			
			
			$miks = ($endsek-$mixsek);
			echo $miks;
			
			$miks = ($endsek-$mixsek);

			$czlon=explode(".",$miks);
			$miksuj = "00:";
			if ($czlon[0]<10) $miksuj .= "0".$miks;
			else $miksuj .= $miks;
						}

			
$result3 = mysql_query('SELECT * FROM artists WHERE id = '.$artist_id.' LIMIT 0,1');
		while ($row3 = mysql_fetch_array($result3))
			{
			//artist
			$wykon=$row3['name'];
			}

			

$opis .= "Wyk=".stripslashes($wykon)."\n";


$opis .= "Sol=\n";
$opis .= "Kom=\n";
$opis .= "Aut=\n";
$opis .= "Pro=\n";
$opis .= "Wyd=\n";
$opis .= "Rok=\n";
$opis .= "Kod=\n";
$opis .= "Ktg=\n";
$opis .= "BPM=\n";
$opis .= "Zak=\n";
$opis .= "Tmc=\n";
$opis .= "Tmi=\n";
$opis .= "Tmo=\n";
$opis .= "Gen=\n";
$opis .= "Era=\n";
$opis .= "Typ=\n";
$opis .= "Nas=\n";
$opis .= "Nar=\n";
$opis .= "Jak=\n";
$opis .= "Klu=\n";
$opis .= "Fil=\n";
$opis .= "PTY=0\n";
$opis .= "PS1=\n";
$opis .= "PS2=\n";
$opis .= "PS3=\n";
$opis .= "PS4=\n";
$opis .= "PLK=".$id_pliku."\n";

$opis .= "Tot=".$len."\n";
$opis .= "Int=".$intro."\n";
$opis .= "Out=00:00.000\n";
$opis .= "Mix=".$miksuj."\n";
$opis .= "Mik=".$mix."\n";
$opis .= "NwP=".$start."\n";
$opis .= "NwK=".$end."\n";
$opis .= "FIn=00:00.000\n";
$opis .= "FOu=00:00.000\n";
$opis .= "LpP=-00:00.001\n";
$opis .= "LpK=-00:00.001\n";
$opis .= "FrP=-00:00.001\n";
$opis .= "FrK=-00:00.001\n";
$opis .= "Zaa=\n";




		}

$fp = fopen(''.$id_pliku.'.DAT', 'w');
fwrite($fp, $opis);
fclose($fp);

// ha!
?>


</body>
</html>

Initial URL


Initial Description


Initial Title
Z Protone\'a do Dyny

Initial Tags


Initial Language
PHP