1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
| <?php
$pDom = new DOMDocument("1.0", "utf-8");
$pRSS = $pDom->createElement('rss');
$pRSS->setAttribute('version', 0.91);
$pDom->appendChild($pRSS);
$pChannel = $pDom->createElement('channel');
$pRSS->appendChild($pChannel);
$pTitle = $pDom->createElement('title', 'IT-PLACE');
$pLink = $pDom->createElement('link', ' http://www.it-place.net');
$pDesc = $pDom->createElement('description', 'MyLinks от българският IT портал');
$pLang = $pDom->createElement('language', 'bg');
$pImage = $pDom->createElement('image');
$pChannel->appendChild($pTitle);
$pChannel->appendChild($pLink);
$pChannel->appendChild($pDesc);
$pChannel->appendChild($pLang);
$pChannel->appendChild($pImage);
$pURL = $pDom->createElement('url', ' http://it-place.net/it_images/no_picture.gif');
$pTitle = $pDom->createElement('title', 'it-place.net');
$pLink = $pDom->createElement('link', 'http://www.it-place.net ');
$pImage->appendChild($pURL);
$pImage->appendChild($pTitle);
$pImage->appendChild($pLink);
$aLatestThreads = array
(
array
(
'title' => "HP UMPC 2133 ще се появи на 7 Април",
'link' => 'http://it-place.net/linksystem/341/',
'description' => "Теми: mobile, hardware, новини, разни; Публикувано от bebolinka на 03.04.2008 13:52"
),
array
(
'title' => "Ecma Open XML стана ISO/IEC стандарт",
'link' => 'http://it-place.net/linksystem/346/',
'description' => "Теми: xml, новини; Публикувано от plamenSm на 03.04.2008 21:17"
)
);
foreach ($aLatestThreads as $aThread)
{
$pItem = $pDom->createElement('item');
$pTitle = $pDom->createElement('title', $aThread['title']);
$pLink = $pDom->createElement('link', $aThread['link']);
$pDesc = $pDom->createElement('description', $aThread['description']);
$pItem->appendChild($pTitle);
$pItem->appendChild($pLink);
$pItem->appendChild($pDesc);
$pChannel->appendChild($pItem);
}
header('Content-type: text/xml');
echo $pDom->saveXML();
?> |