Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




_response_to_rss [ WordPress Function ]

_response_to_rss ( $resp )
Parameters:
  • (unknown_type) $resp
Returns:
  • (unknown)
Defined at:



Retrieve

Source


<?php
function _response_to_rss ($resp) {
    
$rss = new MagpieRSS$resp->results );

    
// if RSS parsed successfully
    
if ( $rss && (!isset($rss->ERROR) || !$rss->ERROR) ) {

        
// find Etag, and Last-Modified
        
foreach( (array) $resp->headers as $h) {
            
// 2003-03-02 - Nicola Asuni (www.tecnick.com) - fixed bug "Undefined offset: 1"
            
if (strpos($h": ")) {
                list(
$field$val) = explode(": "$h2);
            }
            else {
                
$field $h;
                
$val "";
            }

            if ( 
$field == 'etag' ) {
                
$rss->etag $val;
            }

            if ( 
$field == 'last-modified' ) {
                
$rss->last_modified $val;
            }
        }

        return 
$rss;
    } 
// else construct error message
    
else {
        
$errormsg "Failed to parse RSS file.";

        if (
$rss) {
            
$errormsg .= " (" $rss->ERROR ")";
        }
        
// error($errormsg);

        
return false;
    } 
// end if ($rss and !$rss->error)
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

Gebruikersdiscussies [ wordpress.org ]

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics