/[LeafOK_CVS]/fenglin/bbs/themes/xml/view_article_xml.view.php
ViewVC logotype

Contents of /fenglin/bbs/themes/xml/view_article_xml.view.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations)
Tue Apr 29 11:55:32 2025 UTC (10 months, 2 weeks ago) by sysadm
Branch: MAIN
Changes since 1.9: +0 -1 lines
Remove redundant PHP closing tag

1 <?php
2 // Prevent load standalone
3 if (!isset($result_set))
4 {
5 exit();
6 }
7
8 require_once "../lib/lml.inc.php";
9 require_once "../lib/str_process.inc.php";
10 require_once "./user_level.inc.php";
11
12 $xsl_file = get_theme_file('xsl/1');
13
14 $title = htmlspecialchars($result_set["data"]["title"], ENT_HTML401, 'UTF-8');
15
16 header('Content-Type: text/xml; charset=UTF-8');
17
18 echo <<<HTML
19 <?xml version="1.0" encoding="UTF-8" ?>
20 <?xml-stylesheet type='text/xsl' href='{$xsl_file}' version='1.0'?>
21 <Topic>
22 <Subject>
23 <SectionId>{$result_set["data"]["sid"]}</SectionId>
24 <SectionTitle>{$result_set["data"]["section_title"]}</SectionTitle>
25 <TopicId>{$result_set["data"]["id"]}</TopicId>
26 <TopicTitle>{$title}</TopicTitle>
27 </Subject>
28 <Articles>
29 HTML;
30
31 foreach ($result_set["data"]["articles"] as $article)
32 {
33 $username = htmlspecialchars($article["username"], ENT_HTML401, 'UTF-8');
34 $nickname = htmlspecialchars($article["nickname"], ENT_HTML401, 'UTF-8');
35 $level = user_level($article["exp"]);
36 $content = LML($article["content"], true, false, 130);
37
38 $transship_info = "";
39 if ($article["transship"])
40 {
41 $transship_info = <<<HTML
42 [转载]
43 HTML;
44 }
45
46 echo <<< HTML
47 <Article>
48 <PostUserId>{$article["uid"]}</PostUserId>
49 <PostUserName>{$username}</PostUserName>
50 <PostUserNickName>{$nickname}</PostUserNickName>
51 <rank>{$level}</rank>
52 <credit>{$article["exp"]}</credit>
53 <photo>{$article["photo_path"]}</photo>
54 <ArticleId>{$article["aid"]}</ArticleId>
55 <ArticleTitle>{$title}{$transship_info}</ArticleTitle>
56 <ExpressionIcon>{$article["icon"]}</ExpressionIcon>
57 <PostDateTime>{$article["sub_dt"]->format("Y-m-d H:i:s (\U\T\C P)")}</PostDateTime>
58 <PostIP>{$article["sub_ip"]}</PostIP>
59 <Content><![CDATA[{$content}]]></Content>
60 <Length>{$article["length"]}</Length>
61 <Visible>{$article["visible"]}</Visible>
62 </Article>
63
64 HTML;
65 }
66
67 echo <<<HTML
68 </Articles>
69 </Topic>
70 HTML;

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1