Ticket #8531: mythweb.patch

File mythweb.patch, 932 bytes (added by kees@…, 10 years ago)
  • mythweb/modules/status/handler.php

    old new  
    2424// Make sure the content is interpreted as UTF-8
    2525    header('Content-Type:  text/html; charset=UTF-8');
    2626
     27// Load encoder names
     28    $sh = $db->query('SELECT cardid, displayname FROM cardinput');
     29    while ($row = $sh->fetch_assoc())
     30        $Encoder_Name[$row['cardid']] = $row['displayname'];
     31    $sh->finish();
     32
    2733// Load the status page
    2834    if (function_exists('curl_exec')) {
    2935        $ch = curl_init("http://$masterhost:$statusport$xml_param");
     
    4854                  )
    4955              );
    5056
     57// Replace Encoder numbers with names
     58    foreach ($Encoder_Name as $num => $name) {
     59        $status = preg_replace("/ Encoder $num /", " $name ", $status);
     60    }
     61
    5162// Print the status page template
    5263    require_once tmpl_dir.'status.php';
    5364