[SPT/CWIS] Datamodel, MySQL query and Custom RSS feed

Kucera, Rich Kucerar at hhmi.org
Tue Jul 1 16:06:48 CDT 2008



Do an internal search engine query instead of SQL.  Piece it together with
the info you see placed in the URL when you do Advanced Search.





From: spt-cwis-users-bounces at scout.wisc.edu
[mailto:spt-cwis-users-bounces at scout.wisc.edu] On Behalf Of Jhonatan Tirado
Sent: Tuesday, July 01, 2008 5:02 PM
To: SPT / CWIS Users Discussion List
Subject: [SPT/CWIS] Datamodel, MySQL query and Custom RSS feed



I have the following code to generate a RSS feed dinamically, so I can use it
on Drupal CMS.
For example, this link
http://peru.campusvirtualsp.org/repositorio/rsstest.php would generate a RSS
feed so I can use on Drupal.
You can see the query I'm using ("SELECT ResourceId, Title, Url FROM
However I want to filter results by type (which is a ControlledName). 
How my query sholud be?
Maybe something like: SELECT ResourceId, Title, Url FROM Resources where
The problem is I still don't understand the database model and its
I was looking in order to find the table where Resources and ControlledNames
or MetadataFields get related but nothing.
Any help would be really apreciated.


PHP CODE: File rsstest.php
$rss_titulo = 'CVSP Peru RSS';
$rss_url = 'http://peru.campusvirtualsp.org/repositorio/SPT--FullRecord.php';
$rss_descripcion = 'Noticias de Campus Virtual de Salud Publica';
$rss_email = 'admin at email.com';

$db_server = 'server';
$db_user = 'user';
$db_pass = 'password';

$conexion = mysql_connect($db_server,$db_user,$db_pass);
mysql_select_db("database", $conexion);

$sql = "SELECT ResourceId, Title, Url FROM Resources";
$result = mysql_query($sql, $conexion);
$item = mysql_fetch_assoc($result);

header('Content-type: text/xml; charset="iso-8859-1"', true);

echo '<?xml version="1.0" encoding="iso-8859-1"?>';
echo '<rss
      do {
           echo "<item>";
           echo "<title>".$item['Title']."</title>";
           echo "<description>".$item['Title']."</description>";
           echo "</item>";
      } while ($item = mysql_fetch_assoc($result));
      echo "</channel>";
      echo "</rss>";   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://scout.wisc.edu/pipermail/spt-cwis-users/attachments/20080701/502e8e48/attachment-0002.html 

More information about the SPT-CWIS-Users mailing list