image toevoegen in een RSS item
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
............
mysql_connect($host,$username,$password);
mysql_select_db($db);
$query=mysql_query("SELECT * FROM liste ORDER BY ID DESC LIMIT 0,25");
while($row=mysql_fetch_assoc($query))
{
echo(" <item>\n");
echo(" <title>".$row['titel']."</title>\n");
echo(" <link>http://blabla=".$row['ID']."</link>\n");
echo(" <guid>http://blabla=".$row['ID']."</guid>\n");
echo(" <description>".$row['omschrijving']."</description>\n");
echo(" </item>\n");
}
echo("</channel>\n\n</rss>");
}
?>
............
mysql_connect($host,$username,$password);
mysql_select_db($db);
$query=mysql_query("SELECT * FROM liste ORDER BY ID DESC LIMIT 0,25");
while($row=mysql_fetch_assoc($query))
{
echo(" <item>\n");
echo(" <title>".$row['titel']."</title>\n");
echo(" <link>http://blabla=".$row['ID']."</link>\n");
echo(" <guid>http://blabla=".$row['ID']."</guid>\n");
echo(" <description>".$row['omschrijving']."</description>\n");
echo(" </item>\n");
}
echo("</channel>\n\n</rss>");
}
?>
Kan echt niemand mij hiermee op weg helpen ????
Hier alle opties
http://cyber.law.harvard.edu/rss/rss.html
Gewijzigd op 01/01/1970 01:00:00 door Ceasar Feijen
ik heb een rss feed gemaakt d.m.v. php (zie stukeje script boven). Zodra dat ik iets nieuws in mijn database zet komt het iautomatisch in mijn rss. wat ik zou wil is dat er afbeelding ook bij kunnen. het lukt mij dus niet om naast de tekst een image te plaatsen en dat wil doen d.m.v. php.
rss 2.0 kan alleen een image in een channel weergeven en niet in een item
http://cyber.law.harvard.edu/rss/rss.html#hrelementsOfLtitemgt
of http://validator.w3.org/feed/docs/rss2.html
Als je een link van een plaatje in je database hebt staan kun je die naar mijn gevoel gewoon echoeen
Gewijzigd op 01/01/1970 01:00:00 door Ceasar Feijen
http://images.apple.com/trailers/rss/newtrailers.rss
Het lukt mij ook handmatig met een xml pagina maar ik wil het met PHP doen zodat alees automatisch gaat.
Ik ben ook een hele tijd bezig om dit te zoeken maar ik weet ook dat het wel kan zie voorbeeld : Het lukt mij ook handmatig met een xml pagina maar ik wil het met PHP doen zodat alees automatisch gaat.
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?xml version="1.0" encoding="ISO-8859-1"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>Latest Movie Trailers</title>
<link>http://www.apple.com/trailers/</link>
<description>Recently added Movie Trailers.</description>
<language>en-US</language>
<lastBuildDate>Fri, 05 Sep 2008 17:36:44 PST</lastBuildDate>
<generator>Custom</generator>
<copyright>2008 Apple Inc.</copyright>
<item>
<title>Madagascar 2 - Trailer 2</title>
<link>http://www.apple.com/trailers/dreamworks/madagascar2/</link>
<description>In the highly-anticipated sequel to &#x201C;Madagascar,&#x201D; Alex, Marty, Melman, Gloria, King Julien, Maurice and the penguins and the chimps find themselves marooned on the distant shores of Madagascar. In the face of this obstacle, the New Yorkers have hatched a plan so crazy it just might work. With military precision, the penguins have repaired an old crashed plane&#x2014;sort of. Once aloft, this unlikely crew stays airborne just long enough to make it to the wildest place of all&#x2014;the vast plains of Africa, where the members of our zoo-raised crew encounter species of their own kind for the very first time. Africa seems like a great place&#x2026;but is it better than their Central Park home?</description>
<pubDate>Fri, 05 Sep 2008 00:00:00 PST</pubDate>
<content:encoded><![CDATA[<table><tr valign="top"><td width="67"><a href="http://www.apple.com/trailers/dreamworks/madagascar2/"><img src="http://images.apple.com/moviesxml/s/dreamworks/posters/madagascar2_m200808081754.jpg" width="65" height="97" border="0"></a></td><td> </td><td><a href="http://www.apple.com/trailers/dreamworks/madagascar2/"><span style="font-size: 16px; font-weight: 900; text-decoration: underline;">Madagascar 2 - Trailer 2</span></a><br /><span style="font-size: 12px;">In the highly-anticipated sequel to “Madagascar,” Alex, Marty, Melman, Gloria, King Julien, Maurice and the penguins and the chimps find themselves marooned on the distant shores of Madagascar. In the face of this obstacle, the New Yorkers have hatched a plan so crazy it just might work. With military precision, the penguins have repaired an old crashed plane—sort of. Once aloft, this unlikely crew stays airborne just long enough to make it to the wildest place of all—the vast plains of Africa, where the members of our zoo-raised crew encounter species of their own kind for the very first time. Africa seems like a great place…but is it better than their Central Park home?<br /><b>Directed by:</b> Eric Darnell, Tom McGrath<br /><b>Starring:</b> Ben Stiller, Chris Rock, David Schwimmer, Jada Pinkett Smith, Sacha Baron Cohen</span></td></tr></table>]]></content:encoded>
</item>
</channel>
</rss>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title>Latest Movie Trailers</title>
<link>http://www.apple.com/trailers/</link>
<description>Recently added Movie Trailers.</description>
<language>en-US</language>
<lastBuildDate>Fri, 05 Sep 2008 17:36:44 PST</lastBuildDate>
<generator>Custom</generator>
<copyright>2008 Apple Inc.</copyright>
<item>
<title>Madagascar 2 - Trailer 2</title>
<link>http://www.apple.com/trailers/dreamworks/madagascar2/</link>
<description>In the highly-anticipated sequel to &#x201C;Madagascar,&#x201D; Alex, Marty, Melman, Gloria, King Julien, Maurice and the penguins and the chimps find themselves marooned on the distant shores of Madagascar. In the face of this obstacle, the New Yorkers have hatched a plan so crazy it just might work. With military precision, the penguins have repaired an old crashed plane&#x2014;sort of. Once aloft, this unlikely crew stays airborne just long enough to make it to the wildest place of all&#x2014;the vast plains of Africa, where the members of our zoo-raised crew encounter species of their own kind for the very first time. Africa seems like a great place&#x2026;but is it better than their Central Park home?</description>
<pubDate>Fri, 05 Sep 2008 00:00:00 PST</pubDate>
<content:encoded><![CDATA[<table><tr valign="top"><td width="67"><a href="http://www.apple.com/trailers/dreamworks/madagascar2/"><img src="http://images.apple.com/moviesxml/s/dreamworks/posters/madagascar2_m200808081754.jpg" width="65" height="97" border="0"></a></td><td> </td><td><a href="http://www.apple.com/trailers/dreamworks/madagascar2/"><span style="font-size: 16px; font-weight: 900; text-decoration: underline;">Madagascar 2 - Trailer 2</span></a><br /><span style="font-size: 12px;">In the highly-anticipated sequel to “Madagascar,” Alex, Marty, Melman, Gloria, King Julien, Maurice and the penguins and the chimps find themselves marooned on the distant shores of Madagascar. In the face of this obstacle, the New Yorkers have hatched a plan so crazy it just might work. With military precision, the penguins have repaired an old crashed plane—sort of. Once aloft, this unlikely crew stays airborne just long enough to make it to the wildest place of all—the vast plains of Africa, where the members of our zoo-raised crew encounter species of their own kind for the very first time. Africa seems like a great place…but is it better than their Central Park home?<br /><b>Directed by:</b> Eric Darnell, Tom McGrath<br /><b>Starring:</b> Ben Stiller, Chris Rock, David Schwimmer, Jada Pinkett Smith, Sacha Baron Cohen</span></td></tr></table>]]></content:encoded>
</item>
</channel>
</rss>
Zit gewoon html in die rss...
Dus je bedoeld dat het niet kan met PHP... jammer....
chris schreef op 11.09.2008 19:52:
@ Karl.
Dus je bedoeld dat het niet kan met PHP... jammer....
Dus je bedoeld dat het niet kan met PHP... jammer....
Waar zeg ik dat dan?
Ik geef je alleen de code, dus hoe het er uitziet, zodat je dat zelf na kan bouwen...
Je kunt zoveel met php...
@karl hum, oke!! maar het maak niet uit wat ik doe het lukt gewoon niet. ik krijg de afbeelding niet te zien !
Anders, toon es een relevant stukje XML wat er nu gegenereerd wordt door je script..
Hier mijn script:
Code (php)
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
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
<?php
require("config.php");
if(array_key_exists('ID',$_GET))
{
mysql_connect($host,$username,$password);
mysql_select_db($db);
$query=mysql_query("SELECT * FROM liste WHERE ID=".$_GET['ID'].";");
if(mysql_num_rows($query)==0)
die("Film niet gevonden");
while($row=mysql_fetch_assoc($query))
{
echo("<table>\n");
echo("<tr>\n");
echo("\t<th>".$row['titel']."</th>\n");
echo("</tr>\n");
echo("<tr>\n");
echo("\t<td>".$row['omscrijving']."</td>\n");
echo("</tr>\n");
echo("<tr>\n");
echo("\t<td>".$row['cover']."</td>\n");
echo("</tr>\n");
echo("</table>\n");
}
mysql_close();
}
else
{
header("Content-Type: text/xml;");
echo("<?xml version=\"1.0\" encoding=\"US-ASCII\" ?>\n");
echo("<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\"
xmlns:content=\"http://purl.org/rss/1.0/modules/content\"
>\n\n");
echo("<channel>\n");
echo(" <title>".$channeltitle."</title>\n");
echo(" <link>http://".$_SERVER['HTTP_HOST']."/</link>\n");
echo(" <lastBuildDate>".$builddate."</lastBuildDate>\n");
echo(" <atom:link href=\"http://www...../rss.php\" rel=\"self\" type=\"application/rss+xml\" />\n");
mysql_connect($host,$username,$password);
mysql_select_db($db);
$query=mysql_query("SELECT * FROM liste ORDER BY ID DESC LIMIT 0,25");
while($row=mysql_fetch_assoc($query))
{
echo(" <item>\n");
echo(" <title>".$row['titel']."</title>\n");
echo(" <link>http://www..../selectie.php?filmid=".$row['ID']."</link>\n");
echo(" <guid>http://www..../selectie.php?filmid=".$row['ID']."</guid>\n");
echo(" <content:encoded><![CDATA[<table><tr><td><p><img src=\"http://..../1824.jpg\" width =\" 80\" heigh = \"120\"></td><td> </td><td>>".$row['omschrijving']."</</td></tr></table> ]]></content:encoded>\n");
echo(" </item>\n");
}
echo("</channel>\n\n</rss>");
}
?>
require("config.php");
if(array_key_exists('ID',$_GET))
{
mysql_connect($host,$username,$password);
mysql_select_db($db);
$query=mysql_query("SELECT * FROM liste WHERE ID=".$_GET['ID'].";");
if(mysql_num_rows($query)==0)
die("Film niet gevonden");
while($row=mysql_fetch_assoc($query))
{
echo("<table>\n");
echo("<tr>\n");
echo("\t<th>".$row['titel']."</th>\n");
echo("</tr>\n");
echo("<tr>\n");
echo("\t<td>".$row['omscrijving']."</td>\n");
echo("</tr>\n");
echo("<tr>\n");
echo("\t<td>".$row['cover']."</td>\n");
echo("</tr>\n");
echo("</table>\n");
}
mysql_close();
}
else
{
header("Content-Type: text/xml;");
echo("<?xml version=\"1.0\" encoding=\"US-ASCII\" ?>\n");
echo("<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\"
xmlns:content=\"http://purl.org/rss/1.0/modules/content\"
>\n\n");
echo("<channel>\n");
echo(" <title>".$channeltitle."</title>\n");
echo(" <link>http://".$_SERVER['HTTP_HOST']."/</link>\n");
echo(" <lastBuildDate>".$builddate."</lastBuildDate>\n");
echo(" <atom:link href=\"http://www...../rss.php\" rel=\"self\" type=\"application/rss+xml\" />\n");
mysql_connect($host,$username,$password);
mysql_select_db($db);
$query=mysql_query("SELECT * FROM liste ORDER BY ID DESC LIMIT 0,25");
while($row=mysql_fetch_assoc($query))
{
echo(" <item>\n");
echo(" <title>".$row['titel']."</title>\n");
echo(" <link>http://www..../selectie.php?filmid=".$row['ID']."</link>\n");
echo(" <guid>http://www..../selectie.php?filmid=".$row['ID']."</guid>\n");
echo(" <content:encoded><![CDATA[<table><tr><td><p><img src=\"http://..../1824.jpg\" width =\" 80\" heigh = \"120\"></td><td> </td><td>>".$row['omschrijving']."</</td></tr></table> ]]></content:encoded>\n");
echo(" </item>\n");
}
echo("</channel>\n\n</rss>");
}
?>
Ik krijg alleen de titel te zien en geen omschrijving en afbeelding !
huh code en/code
oke sorry :-(
Hierbij mijn script
Code (php)
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
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
<?php
require("config.php");
if(array_key_exists('ID',$_GET))
{
mysql_connect($host,$username,$password);
mysql_select_db($db);
$query=mysql_query("SELECT * FROM liste WHERE ID=".$_GET['ID'].";");
if(mysql_num_rows($query)==0)
die("Film niet gevonden");
while($row=mysql_fetch_assoc($query))
{
echo("<table>\n");
echo("<tr>\n");
echo("\t<th>".$row['titel']."</th>\n");
echo("</tr>\n");
echo("<tr>\n");
echo("\t<td>".$row['omscrijving']."</td>\n");
echo("</tr>\n");
echo("<tr>\n");
echo("\t<td>".$row['cover']."</td>\n");
echo("</tr>\n");
echo("</table>\n");
}
mysql_close();
}
else
{
header("Content-Type: text/xml;");
echo("<?xml version=\"1.0\" encoding=\"US-ASCII\" ?>\n");
echo("<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\"
xmlns:content=\"http://purl.org/rss/1.0/modules/content\"
>\n\n");
echo("<channel>\n");
echo(" <title>".$channeltitle."</title>\n");
echo(" <link>http://".$_SERVER['HTTP_HOST']."/</link>\n");
echo(" <lastBuildDate>".$builddate."</lastBuildDate>\n");
echo(" <atom:link href=\"http://www...../rss.php\" rel=\"self\" type=\"application/rss+xml\" />\n");
mysql_connect($host,$username,$password);
mysql_select_db($db);
$query=mysql_query("SELECT * FROM liste ORDER BY ID DESC LIMIT 0,25");
while($row=mysql_fetch_assoc($query))
{
echo(" <item>\n");
echo(" <title>".$row['titel']."</title>\n");
echo(" <link>http://www..../selectie.php?filmid=".$row['ID']."</link>\n");
echo(" <guid>http://www..../selectie.php?filmid=".$row['ID']."</guid>\n");
echo(" <content:encoded><![CDATA[<table><tr><td><p><img src=\"http://..../1824.jpg\" width =\" 80\" heigh = \"120\"></td><td> </td><td>>".$row['omschrijving']."</</td></tr></table> ]]></content:encoded>\n");
echo(" </item>\n");
}
echo("</channel>\n\n</rss>");
}
?>
require("config.php");
if(array_key_exists('ID',$_GET))
{
mysql_connect($host,$username,$password);
mysql_select_db($db);
$query=mysql_query("SELECT * FROM liste WHERE ID=".$_GET['ID'].";");
if(mysql_num_rows($query)==0)
die("Film niet gevonden");
while($row=mysql_fetch_assoc($query))
{
echo("<table>\n");
echo("<tr>\n");
echo("\t<th>".$row['titel']."</th>\n");
echo("</tr>\n");
echo("<tr>\n");
echo("\t<td>".$row['omscrijving']."</td>\n");
echo("</tr>\n");
echo("<tr>\n");
echo("\t<td>".$row['cover']."</td>\n");
echo("</tr>\n");
echo("</table>\n");
}
mysql_close();
}
else
{
header("Content-Type: text/xml;");
echo("<?xml version=\"1.0\" encoding=\"US-ASCII\" ?>\n");
echo("<rss version=\"2.0\" xmlns:atom=\"http://www.w3.org/2005/Atom\"
xmlns:content=\"http://purl.org/rss/1.0/modules/content\"
>\n\n");
echo("<channel>\n");
echo(" <title>".$channeltitle."</title>\n");
echo(" <link>http://".$_SERVER['HTTP_HOST']."/</link>\n");
echo(" <lastBuildDate>".$builddate."</lastBuildDate>\n");
echo(" <atom:link href=\"http://www...../rss.php\" rel=\"self\" type=\"application/rss+xml\" />\n");
mysql_connect($host,$username,$password);
mysql_select_db($db);
$query=mysql_query("SELECT * FROM liste ORDER BY ID DESC LIMIT 0,25");
while($row=mysql_fetch_assoc($query))
{
echo(" <item>\n");
echo(" <title>".$row['titel']."</title>\n");
echo(" <link>http://www..../selectie.php?filmid=".$row['ID']."</link>\n");
echo(" <guid>http://www..../selectie.php?filmid=".$row['ID']."</guid>\n");
echo(" <content:encoded><![CDATA[<table><tr><td><p><img src=\"http://..../1824.jpg\" width =\" 80\" heigh = \"120\"></td><td> </td><td>>".$row['omschrijving']."</</td></tr></table> ]]></content:encoded>\n");
echo(" </item>\n");
}
echo("</channel>\n\n</rss>");
}
?>
Gewijzigd op 01/01/1970 01:00:00 door chris dufour
iemand enige idee hoe dit moet ??? afbeelding bij een item toevoegen !!!