function outPutItem($wikiTitle, $desc_html = '') { global $wgOut, $wgUser; $sk = $wgUser->getSkin(); $mvTitle = new MV_Title($wikiTitle); $mStreamTitle = Title::makeTitle(MV_NS_STREAM, ucfirst($mvTitle->getStreamName()) . '/' . $mvTitle->getTimeRequest()); // only output media RSS item if its valid media: if (!$mvTitle->doesStreamExist()) { return; } // @@todo this should be cached $thumb_ref = $mvTitle->getFullStreamImageURL('320x240', null, '', true); if ($desc_html == '') { $article = new Article($wikiTitle); $wgOut->clearHTML(); $wgOut->addWikiText($article->getContent()); $desc_html = $wgOut->getHTML(); $wgOut->clearHTML(); } //get the parent meta if allowed: global $mvGetParentMeta; $pmvd = false; if ($mvGetParentMeta && strtolower($mvTitle->getMvdTypeKey()) == 'ht_en') { $pmvd = MV_Index::getParentAnnotativeLayers($mvTitle); if ($pmvd->wiki_title) { $pMvTitle = new MV_Title($pmvd->wiki_title); $pAnnoStreamTitle = Title::MakeTitle(MV_NS_STREAM, $pMvTitle->getNearStreamName(0)); } } $desc_xml = '<![CDATA[ <center class="mv_rss_view_only"> <a href="' . htmlspecialchars($mStreamTitle->getFullUrl()) . '"><img src="' . $thumb_ref . '" border="0" /></a> </center> <br />' . $desc_html . ']]>'; $stream_url = $mvTitle->getWebStreamURL(); $talkpage = $wikiTitle->getTalkPage(); $type_desc = $mvTitle->getMvdTypeKey() ? wfMsg($mvTitle->getMvdTypeKey()) : ''; $time_desc = $mvTitle->getTimeDesc() ? $mvTitle->getTimeDesc() : ''; ?> <item> <link> <?php echo mvRSSFeed::xmlEncode($mStreamTitle->getFullUrl()); ?> </link> <title><?php echo mvRSSFeed::xmlEncode($mvTitle->getStreamNameText() . ' ' . $time_desc); ?> </title> <description> <?php echo $desc_xml; ?> </description> <?php global $mvDefaultVideoQualityKey, $mvVidQualityMsgKeyType, $mvDefaultVideoHighQualityKey, $mvDefaultFlashQualityKey; //check a few different types in order of prefrence: if ($stream_url = $mvTitle->getWebStreamURL($mvDefaultVideoHighQualityKey)) { $mk = $mvDefaultVideoHighQualityKey; } elseif ($stream_url = $mvTitle->getWebStreamURL($mvDefaultVideoQualityKey)) { $mk = $mvDefaultVideoQualityKey; } elseif ($stream_url = $mvTitle->getWebStreamURL($mvDefaultFlashQualityKey)) { $mk = $mvDefaultFlashQualityKey; } if ($stream_url) { echo '<enclosure name="' . wfMsg($mk) . '" type="video/ogg" ' . 'url="' . mvRSSFeed::xmlEncode($stream_url) . '"/>'; } ?> <comments> <?php echo mvRSSFeed::xmlEncode($talkpage->getFullUrl()); ?> </comments> <?php $person = ''; if ($pmvd && $pmvd->Speech_by) { $personTitle = Title::newFromText($pmvd->Speech_by); ?> <media:person label="<?php echo $personTitle->getText(); ?> " url="<?php echo mvRSSFeed::xmlEncode($personTitle->getFullURL()); ?> " /> <?php } //handle any parent clip tag info: if ($pmvd) { ?> <media:parent_clip url="<?php echo mvRSSFeed::xmlEncode($pAnnoStreamTitle->getFullUrl()); ?> " /> <?php if ($pmvd->Bill) { $bTitle = Title::newFromText($pmvd->Bill); ?> <media:bill label="<?php echo $bTitle->getText(); ?> " url="<?php echo mvRSSFeed::xmlEncode($bTitle->getFullURL()); ?> " /> <?php } if ($pmvd->category) { foreach ($pmvd->category as $cat_titlekey) { $cTitle = $cTitle = Title::MakeTitle(NS_CATEGORY, $cat_titlekey); ?> <media:category label="<?php echo $cTitle->getText(); ?> " url="<?php echo mvRSSFeed::xmlEncode($cTitle->getFullUrl()); ?> " /> <?php } } } ?> <media:thumbnail url="<?php echo mvRSSFeed::xmlEncode($thumb_ref); ?> " /> <media:roe_embed url="<?php echo mvRSSFeed::xmlEncode($mvTitle->getROEURL()); ?> " /> <media:group> <?php global $mvDefaultFlashQualityKey, $mvVidQualityMsgKeyType, $mvDefaultFlashQualityKey; //add in media group: $vid_types = array($mvDefaultVideoQualityKey, 'mv_ogg_high_quality', $mvDefaultFlashQualityKey); foreach ($vid_types as $vid_key) { $stream_url = $mvTitle->getWebStreamURL($vid_key); if ($stream_url !== false && isset($mvVidQualityMsgKeyType[$vid_key])) { ?> <media:content blip:role="<?php echo mvRSSFeed::xmlEncode($vid_key); ?> " expression="full" type="<?php echo mvRSSFeed::xmlEncode($mvVidQualityMsgKeyType[$vid_key]); ?> " url="<?php echo htmlentities($stream_url); ?> "></media:content> <?php } } ?> </media:group> </item> <? }
function outPutItem($wikiTitle, $desc_html=''){ global $wgOut; $mvTitle = new MV_Title($wikiTitle); $mStreamTitle = Title::makeTitle(MV_NS_STREAM, ucfirst($mvTitle->getStreamName()) . '/'.$mvTitle->getTimeRequest()); //only output media RSS item if its valid media: if(!$mvTitle->doesStreamExist())return ; //@@todo this should be cached $thumb_ref = $mvTitle->getStreamImageURL('320x240'); if($desc_html==''){ $article = new Article($wikiTitle); $wgOut->clearHTML(); $wgOut->addWikiText($article->getContent() ); $desc_html = $wgOut->getHTML(); $wgOut->clearHTML(); } $desc_xml ='<![CDATA[ <center class="mv_rss_view_only"> <a href="'.$mStreamTitle->getFullUrl().'"><img src="'.$thumb_ref.'" border="0" /></a> </center> <br />'. $desc_html. ']]>'; $stream_url = $mvTitle->getWebStreamURL(); $talkpage = $wikiTitle->getTalkPage(); $type_desc = ($mvTitle->getMvdTypeKey())?wfMsg($mvTitle->getMvdTypeKey()):''; $time_desc = ($mvTitle->getTimeDesc())?$mvTitle->getTimeDesc():''; ?> <item> <link><?=mvRSSFeed::xmlEncode($mStreamTitle->getFullUrl())?></link> <title><?=mvRSSFeed::xmlEncode( $mvTitle->getStreamNameText() . ' ' . $time_desc)?></title> <description><?=$desc_xml?></description> <enclosure type="video/ogg" url="<?=mvRSSFeed::xmlEncode($stream_url)?>"/> <comments><?=mvRSSFeed::xmlEncode($talkpage->getFullUrl())?></comments> <media:thumbnail url="<?=mvRSSFeed::xmlEncode($thumb_ref)?>"/> <? /*todo add in alternate streams HQ, lowQ archive.org etc: <media:group> <media:content blip:role="Source" expression="full" fileSize="2702848" height="240" isDefault="true" type="video/msvideo" url="http://blip.tv/file/get/Conceptdude-EroticDanceOfANiceBabe266.avi" width="360"></media:content> <media:content blip:role="web" expression="full" fileSize="3080396" height="240" isDefault="false" type="video/x-flv" url="http://blip.tv/file/get/Conceptdude-EroticDanceOfANiceBabe266.flv" width="360"></media:content> </media:group> */ ?> </item> <? }