Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
304
Merge Requests
304
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
d3075189
Commit
d3075189
authored
Mar 25, 2001
by
Dries
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- see previous commit message
parent
107ac01a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
24 deletions
+24
-24
modules/headlineRSS10.module
modules/headlineRSS10.module
+24
-24
No files found.
modules/headlineRSS10.module
View file @
d3075189
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
// RSS 1.0 headline exporter (v0.1)
// RSS 1.0 headline exporter (v0.1)
//
//
// Kristjan Jansen -- kika@sloleht.ee
// Kristjan Jansen -- kika@sloleht.ee
$module
=
array
(
"export"
=>
"headlineRSS10_export"
);
$module
=
array
(
"export"
=>
"headlineRSS10_export"
);
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
include_once
"modules/backend.class"
;
include_once
"modules/backend.class"
;
function
headlineRSS10_export
(
$uri
)
{
function
headlineRSS10_export
(
$uri
)
{
global
$site_name
,
$site_url
,
$HTTP_REFERER
,
$HTTP_USER_AGENT
;
global
$site_name
,
$site_url
,
$
status
,
$
HTTP_REFERER
,
$HTTP_USER_AGENT
;
if
(
$uri
[
1
]
==
"headlinesRSS10.rdf"
)
{
if
(
$uri
[
1
]
==
"headlinesRSS10.rdf"
)
{
watchdog
(
"message"
,
"grabbed 'headlinesRSS10.rdf' - referring url:
$HTTP_REFERER
- user agent:
$HTTP_USER_AGENT
"
);
watchdog
(
"message"
,
"grabbed 'headlinesRSS10.rdf' - referring url:
$HTTP_REFERER
- user agent:
$HTTP_USER_AGENT
"
);
...
@@ -19,40 +19,40 @@ function headlineRSS10_export($uri) {
...
@@ -19,40 +19,40 @@ function headlineRSS10_export($uri) {
print
"<?xml version=
\"
1.0
\"
encoding=
\"
ISO-8859-1
\"
?>
\n
"
;
print
"<?xml version=
\"
1.0
\"
encoding=
\"
ISO-8859-1
\"
?>
\n
"
;
print
"<rdf:RDF
\n
"
;
print
"<rdf:RDF
\n
"
;
print
"xmlns:rdf=
\"
http://www.w3.org/1999/02/22-rdf-syntax-ns#
\"\n
"
;
print
"xmlns:rdf=
\"
http://www.w3.org/1999/02/22-rdf-syntax-ns#
\"\n
"
;
print
"xmlns=
\"
http://purl.org/rss/1.0/
\"
>
\n\n
"
;
print
"xmlns=
\"
http://purl.org/rss/1.0/
\"
>
\n\n
"
;
print
"<channel rdf:about=
\"
"
.
$site_url
.
"export/headlinesRSS10.rdf
\"
>
\n
"
;
print
"<channel rdf:about=
\"
"
.
$site_url
.
"export/headlinesRSS10.rdf
\"
>
\n
"
;
print
" <title>
$site_name
</title>
\n
"
;
print
" <title>
$site_name
</title>
\n
"
;
print
" <link>
$site_url
</link>
\n
"
;
print
" <link>
$site_url
</link>
\n
"
;
print
" <description>
$site_name
</description>
\n
"
;
print
" <description>
$site_name
</description>
\n
"
;
print
" <items>
\n
"
;
print
" <rdf:Seq>
\n
"
;
$result
=
db_query
(
"SELECT * FROM nodes WHERE type = 'story' AND status = '
$status[posted]
' ORDER BY timestamp DESC LIMIT 10"
);
print
" <items>
\n
"
;
while
(
$node
=
db_fetch_object
(
$result
))
{
print
" <rdf:Seq>
\n
"
;
print
" <rdf:li resource=
\"
"
.
$site_url
.
"node.php?id=
$node->nid
\"
/>
\n
"
;
$result
=
db_query
(
"SELECT * FROM stories WHERE status = 2 ORDER BY timestamp DESC LIMIT 10"
);
while
(
$story
=
db_fetch_object
(
$result
))
{
print
" <rdf:li resource=
\"
"
.
$site_url
.
"story.php?id=
$story->id
\"
/>
\n
"
;
}
}
print
"
</rdf:Seq>
\n
"
;
print
"
</rdf:Seq>
\n
"
;
print
"
</items>
\n
"
;
print
"
</items>
\n
"
;
print
"</channel>
\n\n
"
;
print
"</channel>
\n\n
"
;
$result
=
db_query
(
"SELECT * FROM stories WHERE status = 2 ORDER BY timestamp DESC LIMIT 10"
);
$result
=
db_query
(
"SELECT * FROM node WHERE type = 'story' AND status = '
$status[posted]
' ORDER BY timestamp DESC LIMIT 10"
);
while
(
$node
=
db_fetch_object
(
$result
))
{
print
"<item rdf:about=
\"
"
.
$site_url
.
"node.php?id=
$node->nid
\"
>
\n
"
;
print
" <title>"
.
check_export
(
$node
->
title
)
.
"</title>
\n
"
;
print
" <link>"
.
$site_url
.
"node.php?id=
$node->nid
</link>
\n
"
;
if
(
$node
->
abstract
)
print
" <description>"
.
check_output
(
$node
->
abstract
,
1
)
.
"</description>
\n
"
;
while
(
$story
=
db_fetch_object
(
$result
))
{
print
"<item rdf:about=
\"
"
.
$site_url
.
"story.php?id=
$story->id
\"
>
\n
"
;
print
" <title>"
.
check_export
(
$story
->
subject
)
.
"</title>
\n
"
;
print
" <link>"
.
$site_url
.
"story.php?id=
$story->id
</link>
\n
"
;
if
(
$story
->
abstract
)
print
" <description>"
.
check_output
(
$story
->
abstract
,
1
)
.
"</description>
\n
"
;
print
"</item>
\n
"
;
print
"</item>
\n
"
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment