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

Jhonatan Tirado jhonatantiradotiradodeep at gmail.com
Wed Jul 2 12:34:05 CDT 2008


Thanks a lot!
I will try and let you know what happens.

Jhonatan

Edward Almasy escribió:
> On Jul 1, 2008, at 4:12 PM, Jhonatan Tirado wrote:
>   
>> Thanks for your answer,
>> But, How do I do and internal search engine query?
>> The URL for Advanced Search is this:
>> http://peru.campusvirtualsp.org/repositorio/SPT--Advanced.php
>>     
>
> I think what Rich is talking about is the URL that you get when you do  
> an Advanced Search.  For example:
>      http://amser.org/SPT--AdvancedSearch.php?Q=Y&F4=bbc&RP=5&SR=0&ST=Advanced
> The "F4" parameter indicates that I was searching for "bbc" in the Url  
> field (which has a field ID of 4).
>
> To use the internal OSMASE search engine to do a search, it would be  
> something like this:
>
> require_once("include/SPT--SearchEngine.php");
> $Engine = new SPTSearchEngine();
> $SearchParameters = array("Type" => "=Course");
> $Scores = $Engine->FieldedSearch($SearchParameters);
>
> $Scores would then contain an array with the IDs of the resources  
> found by the search as the indexes, and the relevance score for each  
> resource as the values.  The code to turn that into RSS would be  
> something like:
>
> require_once("Axis--RSS.php");
> $RSS = new RSS();
> foreach ($Scores as $Id => $Score)
> {
>      $Resource = new Resource($Id);
>      $RSS->AddItem(strip_tags($Resource->Get("Title")),
>          "http://". 
> $_SERVER["SERVER_NAME"].dirname($_SERVER["REQUEST_URI"])
>              ."/SPT--FullRecord.php?ResourceId=".$Resource->Id(),
>          strip_tags($Resource->Get("Description")),
>          $Resource->Get("Date of Record Release"));
> }
> $RSS->PrintRSS();
>
> (Caveat:  I wrote this all very quickly by hand, so there may be a  
> typo or two.  A better example of using the RSS object can be found in  
> SPT--RSS.php.)
>
> Ed
>
>
> ---
>     Edward Almasy                             ealmasy at scout.wisc.edu
>     Co-Director                                 1210 W Dayton Street
>     Internet Scout                                  Madison WI 53706
>     Computer Sciences Department                608-262-6606 (voice)
>     University of Wisconsin - Madison             608-265-9296 (fax)
>
>
> _______________________________________________
> SPT-CWIS-Users mailing list
> SPT-CWIS-Users at scout.wisc.edu
> http://www.scout.wisc.edu/mailman/listinfo/spt-cwis-users
>
>   




More information about the SPT-CWIS-Users mailing list