Skip to content
Snippets Groups Projects
milliways.php 654 B
Newer Older
<?php

exec("/usr/bin/mw -who", $wholist, $ret);
$people = array();
foreach ($wholist as $person) {
    $pid = strtok($person, " ");
    if ($pid == "" || $pid == "Name" || substr($pid,0,5)=="-----") continue;
    $people[] = array(
	"username" => trim(substr($person, 1, 16)),
	"idle"     => trim(substr($person, 18, 6)),
	"what"     => substr($person,25));
}

$smarty->assign("people",$people);
$output = $smarty->fetch($base."templates/milliways.tpl");
$smarty->assign("title", "Milliways");
$smarty->assign("body", file_get_contents($base."static/fragments/Milliways.txt"));
$smarty->assign("secondary", $output);
$smarty->assign("refresh", 120);
?>