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 getUnifiedResultsHTML($show_sidebar = true) { global $wgUser, $wgStylePath, $wgRequest, $wgContLang; global $mvDefaultClipRange; $sk = $wgUser->getSkin(); $o = ''; $o .= '<h5 class="search_results_header">' . wfMsg('mv_results_for', $this->getFilterDesc()) . '</h5>'; $o .= '<div id="resultsArea"> <ul id="metaResults">'; if (count($this->results) == 0) { $o .= '<h2><span class="mw-headline">' . wfMsg('mv_search_no_results') . '</span></h2>'; // close $o .= '</ul></div>'; return $o; } // num of results if ($this->numResultsFound) { $re = $this->limit + $this->offset > $this->numResultsFound ? $this->numResultsFound : $this->limit + $this->offset; $rs = $this->offset == 0 ? 1 : $this->offset; $o .= '<li class="results">' . wfMsg('mv_results_found', $rs, $re, number_format($this->numResultsFound)) . '</li>'; } // check order $prevnext = ''; // pagging if ($this->numResultsFound > $this->limit) { $prevnext = mvViewPrevNext($this->offset, $this->limit, SpecialPage::getTitleFor('MediaSearch'), $this->get_httpd_filters_query(), $this->num < $this->limit); $o .= '<li class="prevnext">' . $prevnext . '</li>'; } $br = '<br />'; $enddash = ''; $sTitle = Title::MakeTitle(NS_SPECIAL, 'MvExportSearch'); // force host for script (should be a better way to do this) if (!isset($_SERVER['HTTP_HOST'])) { $_SERVER['HTTP_HOST'] = 'metavid.org'; } // make miro link: $o .= '<li class="subscribe"><a href="http://subscribe.getMiro.com/?url1=' . 'http%3A%2F%2F' . $_SERVER['HTTP_HOST'] . urlencode($sTitle->getFullUrl($this->get_httpd_filters_query())) . '" ' . 'title="Subscribe with Miro"><img src="' . $wgStylePath . '/mvpcf/images/button_subscribe.png" alt="Miro Video Player" border="0" /></a></li>'; // make rss link: $o .= '<li class="rss">'; $o .= $sk->makeKnownLinkObj($sTitle, 'RSS', $this->get_httpd_filters_query()); $o .= '</li>'; $o .= '<br />'; foreach (array('relevant', 'recent', 'viewed') as $type) { if ($this->order == $type) { $o .= $enddash . '<li class="relevant">' . wfMsg('mv_most_' . $type) . '</li>'; } else { $q_req = $this->get_httpd_filters_query(); if ($wgRequest->getVal('limit') != '' || $wgRequest->getVal('order') != '') { $q_req .= '&' . http_build_query(array('limit' => $this->limit, 'offset' => $this->offset)); } $q_req .= '&order=' . $type; $o .= $enddash . '<li class="relevant">' . $sk->makeKnownLinkObj(SpecialPage::getTitleFor('MediaSearch'), wfMsg('mv_most_' . $type), $q_req) . '</li>'; } $br = ''; $enddash = ' - '; } $o .= '</ul>'; // output results: // collect categories and people for sidebarbucket $sideBarLinkBucket = array('person' => array(), 'category' => array(), 'bill' => array()); $o .= ' <ul id="results">'; //setup the MV_index: $mvIndex = new MV_Index(); foreach ($this->results as $inx => &$mvd) { $mvTitle = new MV_Title($mvd->wiki_title); //get parent meta if requested: global $mvGetParentMeta; $pmeta_out = ''; if ($mvGetParentMeta && strtolower($mvTitle->getMvdTypeKey()) == 'ht_en') { $pmvd = $mvIndex->getParentAnnotativeLayers($mvTitle); if ($pmvd->wiki_title) { $pMvTitle = new MV_Title($pmvd->wiki_title); $pAnnoStreamLink = Title::MakeTitle(MV_NS_STREAM, $pMvTitle->getNearStreamName(0)); $clip_desc_txt = 'Segment'; if ($pmvd->Speech_by) { $personTitle = Title::newFromText($pmvd->Speech_by); $clip_desc_txt = 'Speech By ' . $personTitle->getText(); } $pmeta_out .= 'This ' . $sk->makeKnownLinkObj($pAnnoStreamLink, seconds2Description($mvTitle->getSegmentDuration(), true, true)) . ' clip is part of a larger ' . $sk->makeKnownLinkObj($pAnnoStreamLink, seconds2Description($pMvTitle->getSegmentDuration(), true, true)) . ' Speech'; if ($pmvd->category) { $pmeta_out .= '<br />Covering: '; $coma = ''; foreach ($pmvd->category as $cat_titlekey) { $cTitle = $cTitle = Title::MakeTitle(NS_CATEGORY, $cat_titlekey); $pmeta_out .= $coma . $sk->makeKnownLinkObj($cTitle, $cTitle->getText()); $coma = ', '; assoc_array_increment($sideBarLinkBucket, 'category', $cat_titlekey); } } if ($pmvd->Bill) { $pmeta_out .= '<br />Bill: '; $bTitle = Title::newFromText($pmvd->Bill); $pmeta_out .= $sk->makeKnownLinkObj($bTitle, $bTitle->getText()); assoc_array_increment($sideBarLinkBucket, 'bill', $pmvd->Bill); } } } $mvd_cnt_links = ''; if (isset($mvd->spoken_by)) { $ptitle = Title::MakeTitle(NS_MAIN, $mvd->spoken_by); $mvd_cnt_links .= wfMsg('mv_search_spoken_by') . ': ' . $sk->makeKnownLinkObj($ptitle); $mvd_cnt_links .= '<br />'; assoc_array_increment($sideBarLinkBucket, 'person', $mvd->spoken_by); } $mvd_cat_links = $mvd_bill_links = ''; $coma = ''; if (isset($mvd->categories)) { foreach ($mvd->categories as $cat_id => $na) { $cTitle = Title::MakeTitle(NS_CATEGORY, $cat_id); if ($mvd_cat_links == '') { $mvd_cat_links .= wfMsg('mv_search_categories') . ': '; } $mvd_cat_links .= $coma . $sk->makeKnownLinkObj($cTitle, $cTitle->getText()); $coma = ', '; assoc_array_increment($sideBarLinkBucket, 'category', $cat_id); } } $coma = ''; if (isset($mvd->bills)) { foreach ($mvd->bills as $bill_id => $na) { $bTitle = Title::newFromText($bill_id); if ($mvd_bill_links == '') { $mvd_bill_links .= wfMsg('mv_search_bills') . ': '; } $mvd_bill_links .= $coma . $sk->makeKnownLinkObj($bTitle, $bTitle->getText()); $coma = ', '; assoc_array_increment($sideBarLinkBucket, 'bill', $bill_id); } } // link directly to the current range: //if the clip length is < $mvDefaultClipLength get range: global $mvDefaultClipLength; if ($mvTitle->getSegmentDuration() < $mvDefaultClipLength) { $mvStreamTitle = Title::MakeTitle(MV_NS_STREAM, $mvTitle->getNearStreamName($mvDefaultClipRange)); } else { $mvStreamTitle = Title::MakeTitle(MV_NS_STREAM, $mvTitle->getNearStreamName(0)); } // $mvTitle->getStreamName() .'/'.$mvTitle->getStartTime() .'/'. $mvTitle->getEndTime() ); $o .= '<li class="result"> <span class="vid_img" id="mvimg_' . htmlspecialchars($mvd->id) . '"> ' . $sk->makeKnownLinkObj($mvStreamTitle, '<img alt="image for ' . htmlspecialchars($mvTitle->getStreamNameText()) . ' ' . $mvTitle->getTimeDesc() . '" src="' . $mvTitle->getStreamImageURL('small', $req_time = null, $foce_server = '', $direct_link = false) . '"/>') . ' </span> <div class="result_description"> <h4>' . $sk->makeKnownLinkObj($mvStreamTitle, $mvTitle->getStreamNameText() . ' :: ' . $mvTitle->getTimeDesc()) . '</h4> <p>Matching Phrase:' . $this->termHighlight($mvd->text, implode('|', $this->getTerms()), 1, 100) . ' </p> <span class="by">' . $mvd_cnt_links . '</span> <span class="by">' . $mvd_cat_links . '</span> <span class="by">' . $mvd_bill_links . '</span> </div> <div class="result_meta"> <span class="views">Views: ' . htmlspecialchars($mvd->view_count) . '</span> <span class="duration">' . wfMsg('mv_duration_label') . ':' . htmlspecialchars($mvTitle->getSegmentDurationNTP($short_time = true)) . '</span> <span class="playinline"><a href="javascript:mv_pl(\'' . htmlspecialchars($mvd->id) . '\')">' . wfMsg('mv_play_inline') . '</a></span> </div>'; if ($pmeta_out != '') { $o .= '<div class="parent_meta">' . $pmeta_out . '</div>'; } $o .= '</li>'; } $o .= '</ul>'; // add in prev-next at bottom too: if ($this->numResultsFound > $this->limit) { $o .= '<li class="prevnext">' . $prevnext . '</li>'; } $o .= '</div>'; if (!$show_sidebar) { return $o; } /*search sidebar*/ $perSectionCount = 3; $o .= '<div id="searchSideBar"> <div id="searchSideBarTop"> </div> <div class="suggestionsBox" id="searchSideBarInner">'; // look for people matches max of 3 $first_block = ' first_block'; $matches = 0; $person_out_ary = array(); $person_out = MV_SpecialMediaSearch::auto_complete_person($this->unified_term_search, 3, 'person_html', $matches, $person_out_ary); if ($person_out != '' || count($sideBarLinkBucket['person']) != 0) { // for now don't include({$matches}) $o .= "<div class=\"block{$first_block}\">\n\t\t\t\t\t\t\t\t<h6>" . wfMsg('mv_people_results') . "</h6>\n\t\t\t\t\t\t\t</div>"; $o .= '<div class="block wide_block">'; $o .= $person_out; if (isset($sideBarLinkBucket['person'])) { $pAry =& $sideBarLinkBucket['person']; arsort($pAry); $i = 0; foreach ($pAry as $person_name => $count) { if (in_array($person_name, $person_out_ary)) { continue; } if ($i == $perSectionCount) { break; } $o .= MV_SpecialMediaSearch::format_ac_line($person_name, '', '', MV_SpecialMediaSearch::getPersonImageURL($person_name), $format = 'person_html'); $i++; } } $o .= '</div>'; $first_block = ''; } // get categories $category_out = MV_SpecialMediaSearch::auto_complete_search_categories($this->unified_term_search, 3, 'block_html', $matches); if ($category_out != '' || count($sideBarLinkBucket['category']) != 0) { $o .= '<div class="block' . htmlspecialchars($first_block) . '\\"> <h6>' . wfMsg('mv_category_results') . '</h6> </div>'; $o .= '<div class="block wide_block">' . $category_out; if (isset($sideBarLinkBucket['category'])) { $cAry =& $sideBarLinkBucket['category']; arsort($cAry); $i = 0; $catNStxt = $wgContLang->getNsText(NS_CATEGORY); foreach ($cAry as $cat_name => $count) { if ($i == $perSectionCount) { break; } $o .= MV_SpecialMediaSearch::format_ac_line($cat_name, '', $catNStxt . ':', 'no_image', $format = 'block_html'); $i++; } } $o .= '</div>'; $first_block = ''; } // get bills: $bill_out = MV_SpecialMediaSearch::auto_complete_category('Bill', $this->unified_term_search, 3, 'block_html', $matches); if ($bill_out != '' || count($sideBarLinkBucket['bill']) != 0) { global $wgContLang; $o .= '<div class=\\"block ' . htmlspecialchars($first_block) . '"> <h6>' . wfMsg('mv_bill_results') . '</h6> </div>'; $o .= '<div class="block wide_block">' . $bill_out; if ($sideBarLinkBucket['bill']) { $bAry =& $sideBarLinkBucket['bill']; arsort($bAry); $i = 0; foreach ($bAry as $bill_name => $count) { if ($i == $perSectionCount) { break; } $o .= MV_SpecialMediaSearch::format_ac_line($bill_name, '', '', 'no_image', $format = 'block_html'); $i++; } } $o .= '</div>'; $first_block = ''; } // intrest out is just simple title matching (for now) $intrest_out = MV_SpecialMediaSearch::auto_complete_category('Interest_Group', $this->unified_term_search, 3, 'block_html', $matches); if ($intrest_out != '') { $o .= "<div class=\"block{$first_block}\">\n\t\t\t\t\t\t\t\t<h6>" . wfMsg('mv_intrest_group_results') . "</h6>\n\t\t\t\t\t\t\t</div>"; $o .= '<div class="block wide_block">' . $intrest_out . '</div>'; $first_block = ''; } $o .= '</div><!--searchSideBarInner--> </div>'; $o .= '<div style="clear:both;"></div>'; return $o; }
function getItemOutput($row, $opt = array()) { global $wgUser; $sk = $wgUser->getSkin(); //set defaults: $person_ht = $bill_ht = $category_ht = $o = ''; if (!isset($row->start_time)) { $row->start_time = 0; } if (!isset($row->end_time)) { $row->end_time = 60 * 20; } $mvd_out_html = ''; $mvd_rows = MV_Index::getMVDInRange($row->stream_id, $row->start_time, $row->end_time, $mvd_type = 'anno_en', $getText = true, $smw_properties = array('Speech_by', 'Bill', 'category'), $options = array('limit' => 1)); if (count($mvd_rows) != 0) { reset($mvd_rows); $mvd_row = current($mvd_rows); if (isset($opt['use_mvd_time']) && $opt['use_mvd_time']) { $row->start_time = $mvd_row->start_time; $row->end_time = $mvd_row->end_time; } // print_r($mvd_rows); // print "type of: " . gettype($mvd_row); if (isset($mvd_row->Speech_by)) { if (trim($mvd_row->Speech_by) != '') { $ptitle = Title::MakeTitle(NS_MAIN, $mvd_row->Speech_by); $mvd_out_html .= '<span class="keywords">' . $sk->makeKnownLinkObj($ptitle, $ptitle->getText()) . '</span><br />'; } } if (isset($mvd_row->Bill)) { if (trim($mvd_row->Bill) != '') { $btitle = Title::MakeTitle(NS_MAIN, $mvd_row->Bill); $mvd_out_html .= '<span class="keywords">Bill: ' . $sk->makeKnownLinkObj($btitle) . ' </span><br />'; } } global $wgContLang; $mvdNStxt = $wgContLang->getNsText(MV_NS_MVD); //grab categories if no bill or speech if ($this->params['display_cat'] || $mvd_out_html == '') { $dbr = wfGetDB(DB_READ); $cl_res = $dbr->select('categorylinks', 'cl_to', array('cl_sortkey' => $mvdNStxt . ':' . str_replace('_', ' ', $mvd_row->wiki_title)), 'getTopClips::Categories', 'LIMIT 0, 5'); if ($dbr->numRows($cl_res) != 0) { $mvd_out_html .= '<span class="keywords">Categories: '; $coma = ''; while ($cl_row = $dbr->fetchObject($cl_res)) { $cTitle = Title::MakeTitle(NS_CATEGORY, $cl_row->cl_to); $mvd_out_html .= $coma . $sk->makeKnownLinkObj($cTitle, $cTitle->getText()); $coma = ', '; } $mvd_out_html .= '</span><br />'; } } } else { //we have not meta //if( isset($opt['remove_no_meta']) && $opt['remove_no_meta']) //return false; } // first make link and stream title: $mvStream = MV_Stream::newStreamByID($row->stream_id); if (!$mvStream->doesStreamExist()) { return false; } //limit our output range to < 20 min if ($row->end_time - $row->start_time > 20 * 60) { $row->end_time = $row->start_time + 20 * 60; } $nt = $mvStream->getStreamName() . '/' . seconds2npt($row->start_time) . '/' . seconds2npt($row->end_time); $mvTitle = new MV_Title($nt, MV_NS_STREAM); $mvStreamTitle = Title::MakeTitle(MV_NS_STREAM, $mvTitle->getNearStreamName($extra_range = '0')); // output the image: $o .= $sk->makeKnownLinkObj($mvStreamTitle, '<img alt="image for ' . $mvTitle->getStreamNameText() . ' ' . $mvTitle->getTimeDesc() . '" src="' . $mvTitle->getStreamImageURL('small') . '"/>', 'tl=1'); $title_span = ''; if (isset($mvStream->date_start_time)) { $parts = split('_', $mvStream->getStreamName()); if (count($parts) >= 3) { $title_span = ucfirst($parts[0] . ' '); } else { $title_span = $mvStream->getStreamName(); } $title_span .= date('F jS, Y', $mvStream->date_start_time); } else { $title_span = $mvTitle->getStreamNameText() . $mvTitle->getTimeDesc(); } $o .= '<span class="title">' . $sk->makeKnownLinkObj($mvStreamTitle, $title_span, 'tl=1') . '</span>'; //add mvd_annotative output: $o .= $mvd_out_html; return $o; }
function getResultsHTML() { global $mvgIP, $wgOut, $mvgScriptPath, $mvgContLang, $wgUser, $wgParser; $sk =& $wgUser->getSkin(); $o = ''; if ($this->outputContainer) { $o .= '<div id="mv_search_results_container">'; } //for each stream range: if (count($this->results) == 0) { $o .= '<h2><span class="mw-headline">' . wfMsg('mv_search_no_results') . '</span></h2>'; if ($this->outputContainer) { $o .= '</div>'; } return $o; } else { if ($this->outputInlineHeader) { $o .= '<h2> <span class="mw-headline">' . wfMsg('mv_media_matches') . '</span> </h2>'; $title = Title::MakeTitle(NS_SPECIAL, 'MediaSearch'); $o .= $sk->makeKnownLinkObj($title, wfMsg('mv_advaced_search'), $this->get_httpd_filters_query()); } } //media pagging: $prevnext = mvViewPrevNext($this->offset, $this->limit, SpecialPage::getTitleFor('MediaSearch'), $this->get_httpd_filters_query(), $this->num < $this->limit); $o .= "<br /><span id=\"mv_search_pagging\">{$prevnext}</span>\n"; //add the rss link: $sTitle = Title::MakeTitle(NS_SPECIAL, 'MvExportSearch'); $o .= '<span style="float:right;">'; $o .= $sk->makeKnownLinkObj($sTitle, '<img border="0" src="' . $mvgScriptPath . '/skins/images/feed-icon-28x28.png">', $this->get_httpd_filters_query()); $o .= '</span>'; //add the results bar: $o .= $this->getResultsBar(); //print_r($this->results); foreach ($this->results as $stream_id => &$stream_set) { $matches = 0; $stream_out = $mvTitle = ''; foreach ($stream_set as &$srange) { $cat_html = $mvd_out = ''; $range_match = 0; foreach ($srange['rows'] as $inx => &$mvd) { $matches++; $mvTitle = new MV_Title($mvd->wiki_title); //retrieve only the first article: //$title = Title::MakeTitle(MV_NS_MVD, $mvd->wiki_title); //$article = new Article($title); $bgcolor = MV_Overlay::getMvdBgColor($mvd); //output indent if not the first and count more than one if (count($srange['rows']) != 1 && $inx != 0) { $mvd_out .= ' '; } //'<img src="'. $mvgScriptPath . '/skins/images/film.png">' //$mvd_out .= '<div class="mv_rtdesc" title="' . wfMsg('mv_expand_play') . '" '. // '> '; $mvd_out .= '<img style="float:left;width:84px;cursor:pointer;border:solid #' . $bgcolor . '" ' . ' onclick="mv_ex(\'' . $mvd->id . '\')" width="80" height="60" src="' . $mvTitle->getStreamImageURL('icon') . '">'; $mvd_out .= '</div>'; $mvd_out .= '<b>' . $mvTitle->getTimeDesc() . '</b> '; $mvd_cnt_links = ''; if (isset($mvd->spoken_by)) { $ptitle = Title::MakeTitle(NS_MAIN, $mvd->spoken_by); $mvd_cnt_links .= wfMsg('mv_search_spoken_by') . ': ' . $sk->makeKnownLinkObj($ptitle); $mvd_cnt_links .= '<br>'; } if ($this->outputSeqLinks == true) { $mvd_cnt_links .= ' <a href="javascript:mv_add_to_seq({mvclip:\'' . $mvTitle->getStreamName() . '/' . $mvTitle->getTimeRequest() . '\',' . 'src:\'' . $mvTitle->getWebStreamURL() . '\',' . 'img_url:\'' . $mvTitle->getStreamImageURL() . '\'})">' . '<img style="cursor:pointer;" ' . 'title="' . wfMsg('mv_seq_add_end') . '" ' . 'src="' . $mvgScriptPath . '/skins/mv_embed/images/application_side_expand.png">' . wfMsg('mv_seq_add_end') . '</a>'; } $mvd_cnt_links .= '<a title="' . wfMsg('mv_expand_play') . '" href="javascript:mv_ex(\'' . $mvd->id . '\')">' . '<img id="mv_img_ex_' . $mvd->id . '" src="' . $mvgScriptPath . '/skins/images/closed.png">' . '<span id="mv_watch_clip_' . $mvd->id . '">' . wfMsg('mv_watch_clip') . '</span>' . '<span style="display:none;" id="mv_close_clip_' . $mvd->id . '">' . wfMsg('mv_close_clip') . '</span>' . '</a>' . ' '; //output control links: //make stream title link: $mvStreamTitle = Title::MakeTitle(MV_NS_STREAM, $mvTitle->getNearStreamName()); //$mvTitle->getStreamName() .'/'.$mvTitle->getStartTime() .'/'. $mvTitle->getEndTime() ); $mvd_cnt_links .= $sk->makeKnownLinkObj($mvStreamTitle, '<img border="1" src="' . $mvgScriptPath . '/skins/images/run_mv_stream.png"> ' . wfMsg('mv_improve_transcript'), '', '', '', '', ' title="' . wfMsg('mv_view_in_stream_interface') . '" '); $mvd_cnt_links .= '<br>'; //$title = MakeTitle::() //don't inclue link to wiki page (too confusing) //$mvd_out .=' '; $mvdTitle = Title::MakeTitle(MV_NS_MVD, $mvd->wiki_title); //$mvd_out .= $sk->makeKnownLinkObj($mvdTitle, '<img border="0" src="' . $mvgScriptPath . '/skins/images/run_mediawiki.png">', '', '', '', '', ' title="' . wfMsg('mv_view_wiki_page') . '" '); $mvd_out .= '<span id="mvr_desc_' . $mvd->id . '">'; if (!isset($mvd->toplq)) { $mvd->toplq = false; } //output short desc send partial regEx: if (!$mvd->toplq) { $mvd_out .= $this->termHighlight($mvd->text, implode('|', $this->getTerms())); } else { if ($mvdTitle->exists() && !isset($mvd->text)) { //grab the article text: $curRevision = Revision::newFromTitle($mvdTitle); $wikiText = $curRevision->getText(); } else { $wikiText =& $mvd->text; } //@@todo parse category info if present $cat_html = ''; //run via parser to add in Category info: $parserOptions = ParserOptions::newFromUser($wgUser); $parserOptions->setEditSection(false); $parserOptions->setTidy(true); $title = Title::MakeTitle(MV_NS_MVD, $mvd->wiki_title); $parserOutput = $wgParser->parse($wikiText, $title, $parserOptions); $cats = $parserOutput->getCategories(); foreach ($cats as $catkey => $title_str) { $catTitle = Title::MakeTitle(NS_CATEGORY, $catkey); $cat_html .= ' ' . $sk->makeKnownLinkObj($catTitle); } //add category pre-text: //if ($cat_html != '') //$mvd_out.= wfMsg('Categories') . ':' . $cat_html; $mvd_out .= $cat_html; $mvd_out .= count($srange['rows']) - 1 == 1 ? wfMsg('mv_match_text_one') : wfMsg('mv_match_text', count($srange['rows']) - 1); //$wgOut->addCategoryLinks( $parserOutput->getCategories() ); //$cat_html = $sk->getCategories(); //empty out the categories //$wgOut->mCategoryLinks = array(); } $mvd_out .= '</span>'; $mvd_out .= '<br>' . $mvd_cnt_links; $mvd_out .= '<div style="display:block;clear:both;padding-top:4px;padding-bottom:4px;"/>'; $mvd_out .= '<div id="mvr_' . $mvd->id . '" style="display:none;background:#' . $bgcolor . ';" ></div>'; } $stream_out .= $mvd_out; /*if(count($srange['rows'])!=1){ $stream_out .= ' ' . $cat_html . ' In range:' . seconds2ntp($srange['s']) . ' to ' . seconds2ntp($srange['e']) . wfMsg('mv_match_text', count($srange['rows'])).'<br />' . "\n"; $stream_out .= $mvd_out; }else{ $stream_out .= $mvd_out; }*/ } $nsary = $mvgContLang->getNamespaces(); //output stream name and mach count /*$o.='<br /><img class="mv_stream_play_button" name="'.$nsary[MV_NS_STREAM].':' . $mvTitle->getStreamName() . '" align="left" src="'.$mvgScriptPath.'/skins/mv_embed/images/vid_play_sm.png">'; */ $o .= '<h3>' . $mvTitle->getStreamNameText(); $o .= $matches == 1 ? wfMsg('mv_match_text_one') : wfMsg('mv_match_text', $matches); $o .= '</h3>'; $o .= '<div id="mv_stream_' . $stream_id . '">' . $stream_out . '</div>'; } if ($this->outputContainer) { $o .= '</div>'; } return $o; }