%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /data/www_bck/varak.net_bck/wow2.varak.net/xml/
Upload File :
Create Path :
Current File : //data/www_bck/varak.net_bck/wow2.varak.net/xml/tracks.php

<?php
  include("../lib.php");
  $spojeni = mysql_connect("localhost", "waritko", "blade666");
  mysql_select_db("waritko_horde", $spojeni);
  
  
  ob_start();
  echo "<?xml version='1.0' encoding='utf-8'?>\n";
  echo "<?xml-stylesheet type=\"text/xsl\" href=\"tracks.xsl\"?>\n";
  $tracks = q("select distinct track, artist, count(track) as cnt from recent where user='waritko' group by track order by cnt desc");
  echo "<trackstats>\n";
  foreach($tracks as $track)
  {
    $track[0] = str_replace("&", "&amp;", $track[0]);
    $track[1] = str_replace("&", "&amp;", $track[1]);
    echo "\t<track>\n\t\t<name>$track[0]</name>\n\t\t<artist>$track[1]</artist>\n\t\t<count>$track[2]</count>\n\t</track>\n";
  }
  echo "</trackstats>";
  file_put_contents("tracks.xml", ob_get_clean());
  
  ob_start();
  echo "<?xml version='1.0' encoding='utf-8'?>\n";
  echo "<?xml-stylesheet type=\"text/xsl\" href=\"artists.xsl\"?>\n";
  $tracks = q("select distinct artist, count(artist) as cnt from  recent where user='waritko' group by artist order by cnt desc");
  echo "<artiststats>\n";
  foreach($tracks as $track)
  {
  	$track[0] = str_replace("&", "&amp;", $track[0]);
  	$track[0] = str_replace("<", "&lt;", $track[0]);
	$track[0] = str_replace(">", "&gt;", $track[0]);
    echo "\t<artist>\n\t\t<name>$track[0]</name>\n\t\t<count>$track[1]</count>\n\t</artist>\n";
  }
  echo "</artiststats>";
  file_put_contents("artists.xml", ob_get_clean());
  
  mysql_close($spojeni);
  
?>

Zerion Mini Shell 1.0