Page 1 of 1

PHP programmer help?

Posted: Tue Mar 06, 2007 7:13 pm
by carasmo
I hate to bring this up again, but I really, really, really need an rss feed from the catalog module. I'm not a programmer and my failed attempt is below.

I noticed that there's two tables the catalog gets its content from, pretty much. One is the content_props and prop_name is "notes" and that must match the type of "catalogitem" in the cms_content table. I'm not sure If I'm using the correct terms.

I found this on zenphoto.org forum and thought I'd mess around, but I didn't get anywhere. It might be helpful, though, as a starting point, or not.

Code: Select all

<?php header("Content-type: text/xml");  ?>

   	<rss version='2.0'>
    	<channel>
    		<title>Name of Site</title>
    		<description>A description of your site</description>
    		<language>en-us</language>
    		<link>http://www.linktosite.com</link>
	
	<?
	mysql_connect('localhost','dropsoul_xxx','xxx');
	mysql_select_db('dropsoul_xxx');
	$sql = "SELECT * FROM cms_content_props ORDER BY id CONTENT_ID LIMIT 0,10";
	$sql = "SELECT * FROM cms_content ORDER BY id CONTENT_ID LIMIT 0,10";
	$res = mysql_query($sql);
	
	$content_id=mysql_result($res,$i,"content_id");

while($row = mysql_fetch_array($res)){
if ($row['content_id']==3) {
    $prop_name='notes';
} elseif ($row['content_id']==2) {
    $type='catalogitem';
}	
		echo "
			<item> 
				<title> ".$row['content_name']."</title> 
				<link>http://www.dropsoul.com/testCMSMS/$hierarchy_path/</link> 
				
				<description>
				
				".$row['content']."
				
		
				</description> 
				
				<guid isPermaLink='true'>http://www.dropsoul.com/testCMSMS/$hierarchy_path/</guid>
			
			</item>
			";
	}
	?>
		</channel>
	</rss>