function Display($arr) { $res = "<ul>"; foreach ($arr as $k => $v) { $res .= "<li>"; $res .= "<a href=\"?view_mode=node_edit&id=" . $v['ID'] . "\">" . $v['NID'] . " : " . $v['TITLE'] . "</a>"; if ($v['children']) { $res .= Display($v['children']); } $res .= "</li>"; } $res .= "</ul>"; return $res; }
function mainpage($mydata) { Display(); $this->data['title'] = 'Monitoring website'; foreach ($mydata as $key => $variable) { $this->data[$key] = $variable; } /*here's the menu class we looked at in Chapter 3*/ $fred = new menu(); $this->load->library('session'); $mysess = $this->session->userdata('session_id'); if (isset($this->status) && $this->status > 0) { $this->data['menu'] = $fred->show_menu($this->status); } $this->load->view('header.tpl.php', $this->data); }
} else { $html = GetHtmlResponse($cc, "http://weeb.tv/channels/live"); preg_match('/<ul class="channels">(.*?)<\\/ul>/is', $html, $html); $html = $html[1]; preg_match_all('/<fieldset[^>]+>(.*?)<\\/fieldset>/is', $html, $fieldSets); foreach ($fieldSets[1] as $fieldSet) { preg_match('/12px.*?<a href="([^"]+)"[^>]+>(.*?)<\\/a>/i', $fieldSet, $channelVars); $ChannelList[$channelVars[2]] = $channelVars[1]; } uksort($ChannelList, 'strnatcasecmp'); $FirstRun = true; $KeepRunning = true; while ($KeepRunning) { if ($FirstRun) { $FirstRun = false; } else { ShowHeader(); } Display($ChannelList, $ChannelFormat, 3); printf("Enter Channel Number : "); $channel = trim(fgets(STDIN)); if (is_numeric($channel) && $channel >= 1 && $channel <= count($ChannelList)) { $url = $ChannelList[KeyName($ChannelList, $channel - 1)]; $filename = KeyName($ChannelList, $channel - 1); ShowChannel($url, $filename); } else { $KeepRunning = false; } } } Close("Finished");
<?php include '2.php'; include '3.php'; Display();