本文整理汇总了PHP中Title::MakeTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP Title::MakeTitle方法的具体用法?PHP Title::MakeTitle怎么用?PHP Title::MakeTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Title
的用法示例。
在下文中一共展示了Title::MakeTitle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getExportUrl
function getExportUrl()
{
$exportTitle = Title::MakeTitle(NS_SPECIAL, 'MvExportSequence/' . $this->seqTitle->getDBkey());
$export_url = $exportTitle->getFullURL();
if ($this->oldid != '') {
$ss = strpos($export_url, '?') === false ? '?' : '&';
$export_url .= $ss . 'oldid=' . htmlspecialchars($this->oldid);
}
return $export_url;
}
示例2: feedItem
protected function feedItem($row)
{
$title = Title::MakeTitle(intval($row->page_namespace), $row->page_title);
if ($title) {
$date = $row->rev_timestamp;
$comments = $title->getTalkPage()->getFullURL();
$revision = Revision::newFromRow($row);
return new FeedItem($title->getPrefixedText(), $this->feedItemDesc($revision), $title->getFullURL(), $date, $this->feedItemAuthor($revision), $comments);
} else {
return null;
}
}
示例3: getHTML
function getHTML()
{
global $wgOut, $wgTitle, $wgRequest;
$article =& $this->mv_interface->article;
$title = Title::MakeTitle(NS_SPECIAL, 'MvExportSequence/' . $article->mTitle->getDBKey());
$title_url = $title->getFullURL();
$oldid = $wgRequest->getVal('oldid');
if (isset($oldid)) {
//@@ugly hack .. but really this whole sequencer needs a serious rewrite)
$ss = strpos($title_url, '?') === false ? '?' : '&';
$title_url .= $ss . 'oldid=' . $oldid;
}
//'<playlist id="mv_pl">'.
//@@todo look at mv_interface context to get what to display in tool box:
$wgOut->addHTML('' . '<div style="position:absolute;width:320px;height:270px;" id="mv_video_container">' . '<div style="display:none;" id="mv_pl_url">' . $title_url . '</div>' . '</div>' . "\n");
}
示例4: feedItem
protected function feedItem($row)
{
$title = Title::MakeTitle(intval($row->rc_namespace), $row->rc_title);
if ($title) {
$date = $row->rc_timestamp;
$comments = $title->getTalkPage()->getFullURL();
return new FeedItem($title->getPrefixedText(), $this->feedItemDesc($row), $title->getFullURL(), $date, $this->feedItemAuthor($row), $comments);
} else {
return NULL;
}
}
示例5: get_search_feed
function get_search_feed(){
global $wgSitename, $wgOut;
//set up search obj:
$sms = new MV_SpecialMediaSearch();
//setup filters:
$sms->setUpFilters();
//do the search:
$sms->doSearch();
//get the search page title:
$msTitle = Title::MakeTitle(NS_SPECIAL, 'MediaSearch');
$this->feed = new mvRSSFeed(
$wgSitename . ' - ' .wfMsg('mediasearch'). ' : '. strip_tags($sms->getFilterDesc()), //title
strip_tags($sms->getFilterDesc()), //description
$msTitle->getFullUrl().'?'.$sms->get_httpd_filters_query() //link
);
$this->feed->outHeader();
$MV_Overlay = new MV_Overlay();
//for each search result:
foreach ($sms->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++;
//get Stream title for mvd match:
$mvTitle = new MV_Title($mvd->wiki_title);
$stremTitle = Title::MakeTitle(MV_NS_STREAM, $mvTitle->getStreamName().'/'.$mvTitle->getTimeRequest() );
$this->feed->outPutItem($stremTitle, $MV_Overlay->getMVDhtml($mvd, $absolute_links=true));
}
}
}
$this->feed->outFooter();
}
示例6: getResultsHTML
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);
//.........这里部分代码省略.........
示例7: getTopSearches
function getTopSearches()
{
$dbr = wfGetDB(DB_READ);
$o = '';
$options = array();
/*$result = $dbr->select('mv_search_digest', '`query_key`, COUNT(1) as `hit_count`', "`time` >= '$start_time' ",
__METHOD__,
array('GROUP BY' => 'query_key', 'ORDER BY `hit_count` ASC',
'LIMIT 0,'.$this->params['num_results']) );*/
/*$sql="SELECT `mv_search_digest`.`query_key`, COUNT(1) as `hit_count`, `mv_query_key_lookup`.`filters`
FROM `mv_search_digest`
LEFT JOIN `mv_query_key_lookup` ON (`mv_search_digest`.`query_key` = `mv_query_key_lookup`.`query_key`)
WHERE `time` >= '{$this->getStartTime()}' GROUP BY `mv_search_digest`.`query_key`
LIMIT 0, {$this->params[num_results]}";*/
// $from_tables
$vars = array($dbr->tableName('mv_search_digest') . '.query_key', 'COUNT(1) as `hit_count`', $dbr->tableName('mv_query_key_lookup') . '.filters');
$from_tables = $dbr->tableName('mv_search_digest') . ' JOIN' . $dbr->tableName('mv_query_key_lookup') . ' ON ( ' . $dbr->tableName('mv_search_digest') . '.query_key = ' . $dbr->tableName('mv_query_key_lookup') . '.query_key ' . ' ) ';
$conds = '`time` >= ' . $dbr->addQuotes($this->getStartTime());
$options['GROUP BY'] = $dbr->tableName('mv_search_digest') . '.query_key';
$options['ORDER BY'] = '`hit_count` DESC';
$options['LIMIT'] = $this->params['num_results'];
$result = $dbr->select($from_tables, $vars, $conds, __METHOD__, $options);
if ($dbr->numRows($result) == 0) {
return '';
} else {
// @@todo probably should try to abstract out formating..
// but will need to wait until we have a few more test cases to do a productive abstraction
if ($this->params['format'] == 'ul_list') {
$class_attr = $this->params['class'] != '' ? ' class="' . htmlspecialchars($this->params['class']) . '"' : '';
$o .= '<ul' . $class_attr . '>';
}
$mvms = new MV_SpecialMediaSearch();
$sTitle = Title::MakeTitle(NS_SPECIAL, 'MediaSearch');
while ($row = $dbr->fetchObject($result)) {
$title_desc = htmlspecialchars($row->hit_count) . ' ' . wfMsg('mv_date_' . $this->params['time_range']);
$mvms->loadFiltersFromSerialized($row->filters);
$o .= '<li><a title="' . $title_desc . '" href="' . $sTitle->escapeLocalURL($mvms->get_httpd_filters_query() . '&tl=1') . '">' . $mvms->getFilterDesc($query_key = true) . '</li>';
}
if ($this->params['format'] == 'ul_list') {
$o .= '</ul>';
}
}
return $o;
}
示例8: imageLinks
function imageLinks()
{
global $wgUser, $wgOut;
$wgOut->addHTML('<h2 id="filelinks">' . wfMsg('imagelinks') . "</h2>\n");
$dbr =& wfGetDB(DB_SLAVE);
$page = $dbr->tableName('page');
$imagelinks = $dbr->tableName('imagelinks');
$sql = "SELECT page_namespace,page_title FROM {$imagelinks},{$page} WHERE il_to=" . $dbr->addQuotes($this->mTitle->getDBkey()) . " AND il_from=page_id";
$sql = $dbr->limitResult($sql, 500, 0);
$res = $dbr->query($sql, "ImagePage::imageLinks");
if (0 == $dbr->numRows($res)) {
$wgOut->addHtml('<p>' . wfMsg("nolinkstoimage") . "</p>\n");
return;
}
$wgOut->addHTML('<p>' . wfMsg('linkstoimage') . "</p>\n<ul>");
$sk = $wgUser->getSkin();
while ($s = $dbr->fetchObject($res)) {
$name = Title::MakeTitle($s->page_namespace, $s->page_title);
$link = $sk->makeKnownLinkObj($name, "");
$wgOut->addHTML("<li>{$link}</li>\n");
}
$wgOut->addHTML("</ul>\n");
}
示例9: toHTML
function toHTML()
{
global $wgLang, $mvDefaultAspectRatio;
$sk = $this->getSkin();
$attribs = Sanitizer::mergeAttributes(array('class' => 'gallery', 'cellspacing' => '0', 'cellpadding' => '0'), $this->mAttribs);
$s = Xml::openElement('table', $attribs);
if ($this->mCaption) {
$s .= "\n\t<caption>" . htmlspecialchars($this->mCaption) . "</caption>";
}
$params = array('width' => $this->mWidths, 'height' => $this->mHeights);
$i = 0;
$this->already_named_resource = array();
foreach ($this->mImages as $pair) {
$nt = $pair[0];
$text = $pair[1];
# Give extensions a chance to select the file revision for us
$time = false;
wfRunHooks('BeforeGalleryFindFile', array(&$this, &$nt, &$time));
$img = wfFindFile($nt, array('time' => $time));
if ($nt->getNamespace() == MV_NS_MVD || $nt->getNamespace() == MV_NS_STREAM || $nt->getNamespace() == MV_NS_SEQUENCE) {
// @@todo fix sequence embed
// $vpad = floor( ( 1.25*$this->mHeights - $thumb->height ) /2 ) - 2;
$mvTitle = new MV_Title($nt);
// remap MVD namespace links into the Stream view (so contextual metadata is present)
if ($nt->getNamespace() == MV_NS_MVD) {
$nt = Title::MakeTitle(MV_NS_STREAM, ucfirst($mvTitle->getStreamName()) . '/' . $mvTitle->getTimeRequest());
}
$vidH = round($this->mWidths * $mvDefaultAspectRatio);
$vidRes = $this->mWidths . 'x' . $vidH;
// print "img url: " . $mvTitle->getStreamImageURL();
$thumbhtml = "\n\t\t\t" . '<div class="thumb" style="padding: 4px 0; width: ' . htmlspecialchars($this->mWidths + 5) . 'px;">' . '<div style="margin-left: auto; margin-right: auto; width: ' . htmlspecialchars($this->mWidths) . 'px;">' . $sk->makeKnownLinkObj($nt, '<img title="' . htmlspecialchars($mvTitle->getStreamNameText()) . '"' . ' width="160" height="120" src="' . $mvTitle->getStreamImageURL('160x120') . '">') . '</div>' . '</div>' . '<span class="gallerytext" style="float:left">' . $sk->makeKnownLinkObj($nt, $mvTitle->getStreamNameText() . ' ' . $mvTitle->getTimeDesc()) . '</span>' . '</div>';
$nb = '';
$textlink = '';
} else {
if ($nt->getNamespace() != NS_IMAGE || !$img) {
# We're dealing with a non-image, spit out the name and be done with it.
$thumbhtml = "\n\t\t\t" . '<div style="height: ' . ($this->mHeights * 1.25 + 2) . 'px;">' . htmlspecialchars($nt->getText()) . '</div>';
} elseif ($this->mHideBadImages && wfIsBadImage($nt->getDBkey(), $this->getContextTitle())) {
# The image is blacklisted, just show it as a text link.
$thumbhtml = "\n\t\t\t" . '<div style="height: ' . ($this->mHeights * 1.25 + 2) . 'px;">' . $sk->makeKnownLinkObj($nt, htmlspecialchars($nt->getText())) . '</div>';
} elseif (!($thumb = $img->transform($params))) {
# Error generating thumbnail.
$thumbhtml = "\n\t\t\t" . '<div style="height: ' . ($this->mHeights * 1.25 + 2) . 'px;">' . htmlspecialchars($img->getLastError()) . '</div>';
} else {
$vpad = floor((1.25 * $this->mHeights - $thumb->height) / 2) - 2;
$thumbhtml = "\n\t\t\t" . '<div class="thumb" style="padding: ' . htmlspecialchars($vpad) . 'px 0; width: ' . htmlspecialchars($this->mWidths + 30) . 'px;">' . '<div style="margin-left: auto; margin-right: auto; width: ' . htmlspecialchars($this->mWidths) . 'px;">' . $thumb->toHtml(array('desc-link' => true)) . '</div></div>';
// Call parser transform hook
if ($this->mParser && $img->getHandler()) {
$img->getHandler()->parserTransformHook($this->mParser, $img);
}
}
if ($this->mShowBytes) {
if ($img) {
$nb = wfMsgExt('nbytes', array('parsemag', 'escape'), $wgLang->formatNum($img->getSize()));
} else {
$nb = wfMsgHtml('filemissing');
}
$nb = "{$nb}<br />\n";
} else {
$nb = '';
}
$textlink = $this->mShowFilename ? $sk->makeKnownLinkObj($nt, htmlspecialchars($wgLang->truncate($nt->getText(), 20))) . "<br />\n" : '';
}
# ATTENTION: The newline after <div class="gallerytext"> is needed to accommodate htmltidy which
# in version 4.8.6 generated crackpot html in its absence, see:
# http://bugzilla.wikimedia.org/show_bug.cgi?id=1765 -Ævar
if ($i % $this->mPerRow == 0) {
$s .= "\n\t<tr>";
}
$s .= "\n\t\t" . '<td><div class="gallerybox" style="width: ' . ($this->mWidths + 10) . 'px;">' . $thumbhtml . "\n\t\t\t" . '<div class="gallerytext">' . "\n" . $textlink . htmlspecialchars($text) . $nb . "\n\t\t\t</div>" . "\n\t\t</div></td>";
if ($i % $this->mPerRow == $this->mPerRow - 1) {
$s .= "\n\t</tr>";
}
++$i;
}
if ($i % $this->mPerRow != 0) {
$s .= "\n\t</tr>";
}
$s .= "\n</table>";
return $s;
}
示例10: wfNotifyTwitterOnNAB
function wfNotifyTwitterOnNAB($aid)
{
$t = Title::newfromID($aid);
if (!$t) {
// could have been deleted
return true;
}
$r = Revision::newFromTitle($t);
if (!$r) {
return true;
}
$text = $r->getText();
if (MyTwitter::hasBadTemplate($text)) {
return true;
}
// find new cats - like kittens!
$newcats = array();
preg_match_all("@\\[\\[Category:[^\\]]*\\]\\]@", $text, $matches);
$newcats = array();
if (sizeof($matches[0]) > 0) {
$newcats = $matches[0];
}
foreach ($newcats as $cat) {
// make it a title object
$cat = str_replace("[[Category:", "", $cat);
$cat = str_replace("]]", "", $cat);
$cat = Title::makeTitle(NS_CATEGORY, $cat);
wfNotifyTwitter($cat, $t);
}
$cat = Title::MakeTitle(NS_CATEGORY, "New Article Boost");
wfNotifyTwitter($cat, $t);
return true;
}
示例11: getMwTitle
function getMwTitle()
{
return Title::MakeTitle(MV_NS_MVD, $this->wiki_title);
}
示例12: feedItem
protected function feedItem($row)
{
$title = Title::MakeTitle($row->page_namespace, $row->page_title);
if ($title) {
$date = $row->pending_since;
$comments = $title->getTalkPage()->getFullURL();
$curRev = Revision::newFromTitle($title);
return new FeedItem($title->getPrefixedText(), FeedUtils::formatDiffRow($title, $row->stable, $curRev->getId(), $row->pending_since, $curRev->getComment()), $title->getFullURL(), $date, $curRev->getUserText(), $comments);
} else {
return null;
}
}
示例13: expand_wt
function expand_wt($mvd_id)
{
global $wgOut, $mvgIP;
global $mvDefaultSearchVideoPlaybackRes;
require_once $mvgIP . '/includes/MV_Index.php';
require_once $mvgIP . '/includes/MV_Title.php';
require_once $mvgIP . '/includes/MV_MetavidInterface/MV_Overlay.php';
$mvd = MvIndex::getMVDbyId($mvd_id);
if (count($mvd) != 0) {
$mvTitle = new MvTitle($mvd->wiki_title);
//validate title and load stream ref:
if ($mvTitle->validRequestTitle()) {
list($vWidth, $vHeight) = explode('x', $mvDefaultSearchVideoPlaybackRes);
$embedHTML = '<span style="float:left;width:' . ($vWidth + 20) . 'px">' . $mvTitle->getEmbedVideoHtml($mvd_id, $mvDefaultSearchVideoPlaybackRes) . '</span>';
$wgOut->clearHTML();
$title = Title::MakeTitle(MV_NS_MVD, $mvd->wiki_title);
$article = new Article($title);
$MvOverlay = new MV_Overlay();
$MvOverlay->parse_format_text($article->getContent(), $mvTitle);
$bgcolor = $MvOverlay->getMvdBgColor($mvd);
$pageHTML = $wgOut->getHTML();
//encasulate page html:
$pageHTML = '<span style="padding-top:10px;float:left;width:450px">' . $pageHTML . '</span>';
return $embedHTML . $pageHTML . '<div style="clear: both;"/>';
} else {
return wfMsg('mvBadMVDtitle');
}
} else {
return wfMsg('mv_error_mvd_not_found');
}
//$title = Title::MakeTitle(MV_NS_MVD, $wiki_title);
//$article = new Article($title);
//output table with embed left, and content right
//return $wgOut->parse($article->getContent());
}
示例14: getUnifiedResultsHTML
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);
//.........这里部分代码省略.........
示例15: stream_paging_links
/**
* outputs basic stream paging (this could be done client side)
*
*/
function stream_paging_links($return_set = 'both')
{
global $wgUser, $mvDefaultStreamViewLength, $mvgScriptPath;
$sk = $wgUser->getSkin();
$prev_link = $next_link = '';
// check if their is prev available:
$mvTitle = $this->mv_interface->article->mvTitle;
if ($return_set == 'both' || $return_set == 'prev') {
if ($mvTitle->getStartTimeSeconds() > 0) {
$prev_time_start = $mvTitle->getStartTimeSeconds() - $mvDefaultStreamViewLength;
if ($prev_time_start < 0) {
$prev_time_start = 0;
}
$prev_time_end = $mvTitle->getEndTimeSeconds() - $mvDefaultStreamViewLength;
if ($prev_time_end < $mvDefaultStreamViewLength) {
$prev_time_end = $mvDefaultStreamViewLength;
}
$newTitle = Title::MakeTitle(MV_NS_STREAM, $mvTitle->getStreamName() . '/' . seconds2npt($prev_time_start) . '/' . seconds2npt($prev_time_end));
$prev_link = $sk->makeKnownLinkObj($newTitle, '<img style="index:5" border="0" src="' . htmlspecialchars($mvgScriptPath) . '/skins/images/results_previous.png">', $this->getStateReq());
}
}
if ($return_set == 'both' || $return_set == 'next') {
if ($mvTitle->getDuration() != $mvTitle->getEndTimeSeconds()) {
$next_time_start = $mvTitle->getEndTimeSeconds();
$next_time_end = $mvTitle->getEndTimeSeconds() + $mvDefaultStreamViewLength;
if ($next_time_end > $mvTitle->getDuration()) {
$next_time_end = $mvTitle->getDuration();
}
$newTitle = Title::MakeTitle(MV_NS_STREAM, $mvTitle->getStreamName() . '/' . seconds2npt($next_time_start) . '/' . seconds2npt($next_time_end));
$next_link = $sk->makeKnownLinkObj($newTitle, '<img style="index:5" border="0" src="' . htmlspecialchars($mvgScriptPath) . '/skins/images/results_next.png">', $this->getStateReq());
}
}
if ($return_set == 'both') {
return $prev_link . ' ' . $next_link;
}
if ($return_set == 'prev') {
return $prev_link;
}
if ($return_set == 'next') {
return $next_link;
}
}