summaryrefslogtreecommitdiff
path: root/moc-commands.php
blob: 4baddb2eaf1a573eb7bd63e56011e14d3ff36365 (plain)
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
<?php

function print_neutral_back_link() {
  print '<a href="/';
  attach_key('?');
  print '">back</a><br>' . "\n";
}

function print_lists() {
  $handle = popen("LC_ALL=C ls ~musix/.moc/Listen", "r");
  $i = 1;
  while (!feof($handle)) {
    $s = fgets($handle);
    if (substr($s,0,7) !== "_lokal_") {
      continue;
    }
    $lists[$i] = substr($s,7);
    $i++;
  }

  foreach ($lists as $i => $list) {
    print '<a href="/?what=playlist&list=' . $i;
    attach_key();
    print '">' . $list . "</a><br>\n";
  }
}