What is the best to insert IF statement after
[code=php]while ($r = mysql_fetch_array($w)) {
like? I would like in order that
[code=php]<comments>’.$site_adres.”news.php?id=”.$r[‘url’].'</comments>
was showed only if
[code=php]$r[“comm”] = ‘1’
Script:
[code=php]<?php header(“Content-type: application/rss+xml”); header(“Accept-Encoding: iso-8859-2″); echo ‘<?xml version=”1.0″ encoding=”iso-8859-2″ ?>’;
?>
<rss version=”2.0”>
<channel>
<title>Aktualności LO im. Jose Marti w Warszawie</title>
<link>http://josemarti.waw.pl</link>
<description>Szkolne aktualności</description>
<language>pl</language>
<managingEditor>[email protected] (Kamil Szmit)</managingEditor>
<webMaster>[email protected] (Kamil Szmit)</webMaster>
<copyright>Wszelkie prawa zastrzeżone. All rights reserved</copyright>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<?php require_once(‘mwc.php’); $w = mysql_query(“SELECT data.*, cat.ID AS cat_ID, cat.title AS cat_title, user.ID, user.name, user.email FROM $GLOBALS[news_data_tbl] data, $GLOBALS[news_cat_tbl] cat, $GLOBALS[users_tbl] user WHERE data.stat=’1′ AND data.ID2 = cat.ID AND data.user_id = user.ID ORDER BY data.date DESC”); while ($r = mysql_fetch_array($w)) {echo ‘ <item>
<title>’.$r[‘title’].'</title>
<link>’.$site_adres.”news.php?id=”.$r[‘url’].'</link>
<pubDate>’.date(“r”, $r[“date”]).'</pubDate>
<description><![CDATA[‘.str_replace(array(“../”, ‘href=”plan’, ‘href=”galery’), array($site_adres, ‘href=”‘.$site_adres.”plan”, ‘href=”‘.$site_adres.”galery”), $r[“text”]).’]]></description>
<author>’.$r[“email”].’ (‘.$r[“name”].’)</author>
<category>’.$r[“cat_title”].'</category>
<guid isPermaLink=”true”>’.$site_adres.”news.php?id=”.$r[‘url’].'</guid>
<comments>’.$site_adres.”news.php?id=”.$r[‘url’].'</comments>
</item>
‘;} ?>
</channel>
</rss>