private function discourse($volume, $discourse) { $this->Discourse =& ClassRegistry::init('Discourse'); $volume = str_pad((int) $volume, 2, "0", STR_PAD_LEFT); $discourse = str_pad($discourse, 2, "0", STR_PAD_LEFT); App::import('Core', array('Xml', 'HttpSocket')); $this->Http =& new HttpSocket(); $url = "http://scriptures.byu.edu/gettalk.php?vol={$volume}&disc={$discourse}"; $html = $this->Http->get($url); if (strpos($html, 'file_get_contents') !== false) { return false; } $dom = new DOMDocument(); @$dom->loadHTML($html); $xpath = new DOMXPath($dom); $start_page = (int) $xpath->evaluate('//a[@name][1]')->item(0)->getAttribute('name'); $column_anchors = $xpath->evaluate('//a[@name]'); $end_page = (int) $column_anchors->item($column_anchors->length - 1)->getAttribute('name'); $title = clean_string(find_content($xpath, '//div[@class="title"]')); $subtitle = find_content($xpath, '//div[@class="subtitle"]'); $reported_by = clean_string(find_content($xpath, '//div[@class="reportedBy"]')); $page_header = clean_string(find_content($xpath, '//div[@class="pageHeader"]')); $speaker = clean_string(find_content($xpath, '//div[@class="speaker"]')); $date = prepare_date(find_content($xpath, '//div[@class="date"]')); $content = find_content($xpath, '//div[@class="discourseBody"]'); $this->Discourse->create(); $this->Discourse->save(array('volume' => $volume, 'start_page' => $start_page, 'end_page' => $end_page, 'title' => $title, 'subtitle' => $subtitle, 'reported_by' => $reported_by, 'page_header' => $page_header, 'speaker' => $speaker, 'date' => $date, 'subtitle' => $subtitle, 'content' => $content)); return true; }
$item = array(); while ($board = array_shift($boards)) { if ($board->node_type() == XML_TEXT_NODE) { continue; } $brdname = find_content($board, "board"); $brdnum = bbs_getboard($brdname, $brdarr); if ($brdnum == 0) { continue; } $brdname = urlencode($brdarr["NAME"]); $gid = find_content($board, "groupid"); $item["title"] = htmlspecialchars("[" . $brdarr["DESC"] . "] " . find_content($board, "title")); $item["link"] = SiteURL . "bbstcon.php?board=" . $brdname . "&gid=" . $gid; $item["author"] = find_content($board, "author"); $item["pubDate"] = gmt_date_format(find_content($board, "time")); $item["guid"] = $item["link"]; $articles = array(); $num = bbs_get_records_from_id($brdname, $gid, $dir_modes["NORMAL"], $articles); if ($num <= 0) { continue; } $article = $articles[1]; if (!$article) { continue; } $contentfile = bbs_get_board_filename($brdname, $article["FILENAME"]); $content = bbs2_readfile_text($contentfile, DESC_CHAR_PER_RSS_ITEM, 0); if (is_string($content)) { $item["description"] = "<![CDATA[" . $content . "]]>"; } else {
<title>Fachakademie für Sozialpädagogik Mühldorf</title> <link rel="icon" href="res/favicon.ico"> <script src="js/jquery-1.11.1.min.js"></script> <script src="js/fotorama.js"></script> <script src="js/date-de-DE.min.js"></script> <script src="js/main.js"></script> <link rel="stylesheet" href="css/fotorama.css"> <link rel="stylesheet" href="css/main-resp.css"> </head> <body> <?php require "php/main.php"; $content_name = find_content(); ?> <div id="all-content"> <header> <div id="logo"> <a href="http://www.diakonie-traunstein.de"> <img src="res/logo-corr.png" alt="Logo der Diakonie Traunstein"> </a> </div> <p>Fachakademie für Sozialpädagogik Mühldorf<br> des Diakonischen Werks Traunstein e.V.</p> </header> <div class="clear"></div> <div id="menu"><span id="menu__icon"><a href="#">≡</a></span></div> <div id="mask"></div> <nav>
$brdarr = array(); page_header($xmltitle); ?> <script type="text/javascript"><!-- var ta = new tabWriter(1,'main wide','<?php echo $xmltitle; ?> ', [['#','2%','center'],[' ','2%',0],['讨论区名称','24%',0],['类别','10%','center'],['中文描述','47%',0],['版主','15%','center']]); <?php $i = 0; while ($board = array_shift($boards)) { if ($board->node_type() == XML_TEXT_NODE) { continue; } $ename = find_content($board, $nodename); $brdnum = bbs_getboard($ename, $brdarr); if ($brdnum == 0) { continue; } if (++$i > 100) { break; } $brd_encode = urlencode($brdarr["NAME"]); $col1 = "putImageCode('newgroup.gif','')"; $col2 = '<a href="bbsdoc.php?board=' . $brd_encode . '">' . $brdarr["NAME"] . '</a>'; $col3 = $brdarr["CLASS"]; $col4 = '<a href="bbsdoc.php?board=' . $brd_encode . '">' . htmlspecialchars($brdarr["DESC"], ENT_QUOTES) . '</a>'; $bms = explode(" ", trim($brdarr["BM"])); if (strlen($bms[0]) == 0 || $bms[0][0] <= chr(32)) { $col5 = "诚征版主中";
function gen_blessing_list_html() { # load xml doc $hotsubject_file = BBS_HOME . "/xml/bless.xml"; $doc = domxml_open_file($hotsubject_file); if (!$doc) { return; } $root = $doc->document_element(); $boards = $root->child_nodes(); ?> <a name="todaybless"></a> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="helpert"> <tr> <td class="helpert_left"></td> <td class="helpert_middle">今日祝福</td> <td class="helpert_right"></td> <td> </td> </tr> </table> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="helper"> <tr> <td class="MainContentText"> <ul style="margin: 5px 0px 0px 15px; padding: 0px;"> <?php # shift through the array while ($board = array_shift($boards)) { if ($board->node_type() == XML_TEXT_NODE) { continue; } $hot_title = find_content($board, "title"); $hot_board = find_content($board, "board"); $hot_groupid = find_content($board, "groupid"); ?> <li class="default"><a href="bbstcon.php?board=<?php echo $hot_board; ?> &gid=<?php echo $hot_groupid; ?> "><?php echo htmlspecialchars($hot_title); ?> </a></li> <?php } ?> </ul></td></tr> </table> <?php }