예제 #1
0
            exit;
        }
        // show other galleries if needed
        $prev_next = $_GET['prev_next'] == 'true' ? true : false;
        $prev_gallery = $next_gallery = null;
        // Get previous and next galleries if required
        if ($prev_next) {
            reset($galleries);
            while (current($galleries)) {
                if (key($galleries) == $gid) {
                    break;
                }
                next($galleries);
            }
            // one step back
            $prev_gallery = prev($galleries);
            // two step forward... Could be easier ? How ?
            next($galleries);
            $next_gallery = next($galleries);
        }
        $rss = flagMediaRss::get_gallery_mrss($gallery, $prev_gallery, $next_gallery);
    } else {
        header('content-type:text/plain;charset=utf-8');
        echo sprintf(__("Invalid MediaRSS command (%s).", "flag"), $mode);
        exit;
    }
}
// Output header for media RSS
header("content-type:text/xml;charset=utf-8");
echo "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>\n";
echo $rss;
예제 #2
0
파일: media-rss.php 프로젝트: recca004/JAS
 /**
  * Get the XML <rss> node
  */
 function get_mrss_root_node($title, $description, $link, $prev_link, $next_link, $images)
 {
     if ($prev_link != '' || $next_link != '') {
         $out = "<rss version='2.0' xmlns:media='http://search.yahoo.com/mrss' xmlns:atom='http://www.w3.org/2005/Atom'>\n";
     } else {
         $out = "<rss version='2.0' xmlns:media='http://search.yahoo.com/mrss'>\n";
     }
     $out .= "\t<channel>\n";
     $out .= flagMediaRss::get_generator_mrss_node();
     $out .= flagMediaRss::get_title_mrss_node($title);
     $out .= flagMediaRss::get_description_mrss_node($description);
     $out .= flagMediaRss::get_link_mrss_node($link);
     if ($prev_link != '') {
         $out .= flagMediaRss::get_previous_link_mrss_node($prev_link);
     }
     if ($next_link != '') {
         $out .= flagMediaRss::get_next_link_mrss_node($next_link);
     }
     foreach ($images as $image) {
         $out .= flagMediaRss::get_image_mrss_node($image);
     }
     $out .= "\t</channel>\n";
     $out .= "</rss>\n";
     return $out;
 }