Index: trunk/extensions/MetavidWiki/maintenance/metavid_gov_templates.php |
— | — | @@ -172,7 +172,7 @@ |
173 | 173 | $template_body .= "{{ #if: {{{" . $name . "|}}}| [[$name:={{{" . $name . "}}}| ]] |}}"; |
174 | 174 | } |
175 | 175 | //$template_body.='<span style="width:40%;float:left;">'; |
176 | | - $template_body.='<span style="float:right">{{navimg|xsize=50|ysize=50|image=Crystal_Clear_mimetype_video_search.png|link=Special:MediaSearch/person/{{PAGENAME}} }}</span>'; |
| 176 | + $template_body.='<span style="float:right">{{navimg|xsize=50|ysize=50|image=Crystal_Clear_mimetype_video_search.png|link=Special:MediaSearch/person/{{PAGENAME}} }}</span>'; |
177 | 177 | //ask for speeches media~ |
178 | 178 | $template_body.="\n".'{{#ask: [[Speech_by::{{PAGENAME}}]] |
179 | 179 | |?Category | ?Bill |
Index: trunk/extensions/MetavidWiki/includes/specials/MV_SpecialExport.php |
— | — | @@ -24,11 +24,13 @@ |
25 | 25 | function doExportCat($par = null){$MvSpecialExport = new MV_SpecialExport('category',$par);} |
26 | 26 | function doExportSeq($par = null){$MvSpecialExport = new MV_SpecialExport('sequence',$par);} |
27 | 27 | function doExportSearch($par = null){$MvSpecialExport = new MV_SpecialExport('search',$par);} |
| 28 | +function doExportAsk($par =null){$MvSpecialExport = new MV_SpecialExport('ask',$par);} |
28 | 29 | |
29 | 30 | SpecialPage::addPage( new SpecialPage('MvVideoFeed','',true,'doExportCat',false) ); |
30 | 31 | SpecialPage::addPage( new SpecialPage('MvExportStream','',true,'doExportStream',false) ); |
31 | 32 | SpecialPage::addPage( new SpecialPage('MvExportSequence','',true,'doExportSeq',false) ); |
32 | 33 | SpecialPage::addPage( new SpecialPage('MvExportSearch','',true,'doExportSearch',false) ); |
| 34 | +SpecialPage::addPage( new SpecialPage('MvExportAsk','',true,'doExportAsk',false) ); |
33 | 35 | |
34 | 36 | //extend supported feed types: |
35 | 37 | $wgFeedClasses['cmml']='CmmlFeed'; |
— | — | @@ -83,10 +85,12 @@ |
84 | 86 | $this->seq_title = $this->par; |
85 | 87 | $this->get_sequence_xspf(); |
86 | 88 | break; |
| 89 | + case 'ask': |
| 90 | + $this->get_ask_feed(); |
| 91 | + break; |
87 | 92 | } |
88 | | - //@@todo cleaner exit? |
89 | 93 | if($error_page==''){ |
90 | | - exit(); |
| 94 | + $wgOut->disable(); |
91 | 95 | }else{ |
92 | 96 | $wgOut->addHTML($error_page); |
93 | 97 | } |
— | — | @@ -268,6 +272,38 @@ |
269 | 273 | } |
270 | 274 | if($encap)print '</cmml_set>'; |
271 | 275 | } |
| 276 | + //this is dependent on semantic wiki ASK functionality |
| 277 | + function get_ask_feed(){ |
| 278 | + global $wgSitename, $wgTitle; |
| 279 | + //check for semantic wiki: |
| 280 | + if(!defined('SMW_VERSION')){ |
| 281 | + return new WikiError( "Export Ask is dependent on semantic media wiki" ); |
| 282 | + } |
| 283 | + //bootstrap off of SMWAskPage: |
| 284 | + $SMWAskPage = new SMWAskPage(); |
| 285 | + $SMWAskPage->extractQueryParameters($this->par); |
| 286 | + |
| 287 | + //print 'query string: ' . $SMWAskPage->m_querystring . "\n<br>"; |
| 288 | + //print 'm_params: ' . print_r($SMWAskPage->m_params) . "\n<br>"; |
| 289 | + //print 'print outs: ' .print_r($SMWAskPage->m_printouts) . "\n<br>"; |
| 290 | + //set up the feed: |
| 291 | + $this->feed = new mvRSSFeed( |
| 292 | + $wgSitename . ' - ' .wfMsg('mediasearch'). ' : '. strip_tags($SMWAskPage->m_querystring), //title |
| 293 | + strip_tags($SMWAskPage->m_querystring), //description |
| 294 | + $wgTitle->getFullUrl() //link |
| 295 | + ); |
| 296 | + $this->feed->outHeader(); |
| 297 | + |
| 298 | + $queryobj = SMWQueryProcessor::createQuery($SMWAskPage->m_querystring, $SMWAskPage->m_params, false, '', $SMWAskPage->m_printouts); |
| 299 | + $res = smwfGetStore()->getQueryResult($queryobj); |
| 300 | + $row = $res->getNext(); |
| 301 | + while ( $row !== false ) { |
| 302 | + $wikititle = $row[0]->getNextObject(); |
| 303 | + $this->feed->outPutItem($wikititle->getTitle()); |
| 304 | + $row = $res->getNext(); |
| 305 | + } |
| 306 | + $this->feed->outFooter(); |
| 307 | + } |
272 | 308 | // @@todo integrate cache query (similar to SpecialRecentChanges::rcOutputFeed )) |
273 | 309 | function get_category_feed(){ |
274 | 310 | global $wgSitename, $wgRequest, $wgOut, $wgCategoryPagingLimit; |
— | — | @@ -398,9 +434,11 @@ |
399 | 435 | global $wgOut; |
400 | 436 | $mvTitle = new MV_Title($wikiTitle); |
401 | 437 | $mStreamTitle = Title::makeTitle(MV_NS_STREAM, ucfirst($mvTitle->getStreamName()) . '/'.$mvTitle->getTimeRequest()); |
| 438 | + |
| 439 | + //only output media RSS item if its valid media: |
| 440 | + if(!$mvTitle->validRequestTitle())return ; |
402 | 441 | |
403 | | - //@@todo this should be done cleaner/cached |
404 | | - //@@todo we need absolute links |
| 442 | + //@@todo this should be cached |
405 | 443 | $thumb_ref = $mvTitle->getStreamImageURL('320x240'); |
406 | 444 | if($desc_html==''){ |
407 | 445 | $article = new Article($wikiTitle); |
— | — | @@ -424,7 +462,7 @@ |
425 | 463 | $time_desc = ($mvTitle->getTimeDesc())?$mvTitle->getTimeDesc():''; |
426 | 464 | ?> |
427 | 465 | <item> |
428 | | - <link><?=mvRSSFeed::xmlEncode($wikiTitle->getFullUrl())?></link> |
| 466 | + <link><?=mvRSSFeed::xmlEncode($mStreamTitle->getFullUrl())?></link> |
429 | 467 | <title><?=mvRSSFeed::xmlEncode( |
430 | 468 | $mvTitle->getStreamNameText() . ' ' . $time_desc)?></title> |
431 | 469 | <description><?=$desc_xml?></description> |
Index: trunk/extensions/MetavidWiki/skins/mv_allpages.js |
— | — | @@ -5,7 +5,7 @@ |
6 | 6 | var base_roe_url = wgServer + wgScript + '?title=Special:MvExportStream&feed_format=roe&stream_name='; |
7 | 7 | var gMvd={}; |
8 | 8 | function mv_setup_allpage(){ |
9 | | - js_log("mv embed done loading now setup all page"); |
| 9 | + js_log("mv embed done loading now setup 'all page'"); |
10 | 10 | //make sure we have jQuery and any base requried libs: |
11 | 11 | mvJsLoader.doLoad(mvEmbed.lib_jquery, function(){ |
12 | 12 | _global['$j'] = jQuery.noConflict(); |
— | — | @@ -19,8 +19,44 @@ |
20 | 20 | mv_setup_search_ac(); |
21 | 21 | mv_do_mvd_link_rewrite(); |
22 | 22 | mv_setup_allpage_flag=true; |
| 23 | + mv_page_specific_rewrites(); |
23 | 24 | } |
24 | 25 | }); |
| 26 | + }); |
| 27 | +} |
| 28 | +function mv_page_specific_rewrites(){ |
| 29 | + var mvAskTitle = 'Special:MvExportAsk'; |
| 30 | + var rssImg = '<img border="0" src="'+wgScriptPath+'/extensions/MetavidWiki/skins/images/feed-icon-28x28.png"/>'; |
| 31 | + var msg_video_rss = 'video rss'; |
| 32 | + //add in rss-media feed link if on Special:Ask page |
| 33 | + if(wgPageName=='Special:Ask'){ |
| 34 | + js_log("url : " + document.location); |
| 35 | + var sURL = parseUri(document.location); |
| 36 | + var podLink=wgArticlePath.replace('$1', mvAskTitle); |
| 37 | + if(sURL.queryKey['title']){ |
| 38 | + //pass along all url params (update the title) |
| 39 | + podLink+='?'; |
| 40 | + for(i in sURL.queryKey){ |
| 41 | + if(i !='title')podLink+=i+'='+sURL.queryKey[i]; |
| 42 | + } |
| 43 | + }else{ |
| 44 | + // /title/askparam format |
| 45 | + var pInx =sURL.relative.indexOf(wgPageName); |
| 46 | + if(pInx!==false){ |
| 47 | + podLink+= sURL.relative.substring(pInx+wgPageName.length); |
| 48 | + } |
| 49 | + } |
| 50 | + //@@todo add to javascript msg system |
| 51 | + $j('#bodyContent').before('<span style="float: right;"><a title="'+ |
| 52 | + msg_video_rss+'" href="'+podLink+'">'+ rssImg + '</a></span>'); |
| 53 | + } |
| 54 | + //if we have an inline query add a search link |
| 55 | + $j('.smwtable').each(function(){ |
| 56 | + var pLink = $j('#'+this.id+' .smwfooter a').attr('href').replace('Special:Ask',mvAskTitle ); |
| 57 | + var colspan = $j('.smwfooter .sortbottom').attr('colspan'); |
| 58 | + var pHTML = '<a title="'+msg_video_rss+'" href="'+pLink+'">'+rssImg+'</a>'; |
| 59 | + js_log("plink: "+pLink + ' colspan:'+ colspan + ' ph:'+pHTML); |
| 60 | + $j('#'+this.id+' tbody').prepend('<tr><td colspan="'+colspan+'">'+pHTML+'</td></tr>'); |
25 | 61 | }); |
26 | 62 | } |
27 | 63 | function mv_do_mvd_link_rewrite(){ |