Index: trunk/extensions/MetavidWiki/includes/MV_GlobalFunctions.php |
— | — | @@ -672,18 +672,22 @@ |
673 | 673 | return sprintf( "%d:%02d:%02d", $dur['hours'], $dur['minutes'], $dur['seconds'] ); |
674 | 674 | } |
675 | 675 | } |
676 | | -function seconds2Description( $seconds, $short=false){ |
| 676 | +function seconds2Description( $seconds, $short=false, $singular=false){ |
677 | 677 | $dur = time_duration_2array( $seconds ); |
678 | 678 | $o=''; |
679 | | - if( $dur['hours'] ) |
680 | | - $o.= wfMsg('mv_hours', intval( $dur['hours']) ); |
681 | | - if( $dur['minutes'] ){ |
| 679 | + if( $dur['hours'] != 0 ){ |
| 680 | + $msg = ($singular)?'mv_hours_singular':'mv_hours'; |
| 681 | + $o.= wfMsg($msg, intval( $dur['hours']) ); |
| 682 | + } |
| 683 | + if( $dur['minutes'] != 0 ){ |
| 684 | + $msg = ($singular)?'mv_minutes_singular':'mv_minutes'; |
682 | 685 | $o.=($o!='')?' ':''; |
683 | | - $o.= wfMsg('mv_minutes', intval( $dur['minutes']) ); |
684 | | - } |
685 | | - if( $short==false && $dur['seconds'] ){ |
| 686 | + $o.= wfMsg($msg, intval( $dur['minutes']) ); |
| 687 | + } |
| 688 | + if( ( $short == false || $o == '' ) && $dur['seconds'] ){ |
| 689 | + $msg = ($singular)?'mv_seconds_singular':'mv_seconds'; |
686 | 690 | $o.=($o!='')?' ':''; |
687 | | - $o.= wfMsg('mv_seconds', intval( $dur['seconds']) ); |
| 691 | + $o.= wfMsg($msg, intval( $dur['seconds']) ); |
688 | 692 | } |
689 | 693 | return $o; |
690 | 694 | } |
Index: trunk/extensions/MetavidWiki/includes/MV_Index.php |
— | — | @@ -511,8 +511,8 @@ |
512 | 512 | __METHOD__, |
513 | 513 | $options ); |
514 | 514 | |
515 | | - //echo "SQL:".$dbr->lastQuery($result)." \n"; |
516 | | - //die; |
| 515 | + //echo "SQL:".$dbr->lastQuery($result)." \n"; |
| 516 | + //die; |
517 | 517 | // $result = $dbr->query($sql, 'MV_Index:doFiltersQuery_base'); |
518 | 518 | |
519 | 519 | $this->numResults = $dbr->numRows( $result ); |
Index: trunk/extensions/MetavidWiki/includes/specials/MV_SpecialMediaSearch.php |
— | — | @@ -416,8 +416,9 @@ |
417 | 417 | $clip_desc_txt = 'Speech By ' . $personTitle->getText(); |
418 | 418 | } |
419 | 419 | |
420 | | - $pmeta_out.='This clip is part of a '. seconds2Description ( $pMvTitle->getSegmentDuration() ). ' ' . |
421 | | - $sk->makeKnownLinkObj($pAnnoStreamLink, $clip_desc_txt ); |
| 420 | + $pmeta_out.='This '. $sk->makeKnownLinkObj($pAnnoStreamLink, seconds2Description ( $mvTitle->getSegmentDuration(), true, true ) ). |
| 421 | + ' clip is part of a larger '. |
| 422 | + $sk->makeKnownLinkObj($pAnnoStreamLink, seconds2Description ( $pMvTitle->getSegmentDuration(), true, true ) ) . ' Speech'; |
422 | 423 | if($pmvd->category){ |
423 | 424 | $pmeta_out.='<br>Covering: '; |
424 | 425 | $coma=''; |
— | — | @@ -859,9 +860,9 @@ |
860 | 861 | if ( $f['t'] != 'match' ) // no desc for text search |
861 | 862 | $o .= ( $query_key ) ? $a : $a . wfMsg( 'mv_' . $f['t'] ) . ' '; |
862 | 863 | if ( $f['t'] == 'date_range' ) { // handle special case of date range: |
863 | | - $o .= wfMsg( 'mv_time_separator', $bo . htmlspecialchars( $f['vs'] ) . $bc, $bo . htmlspecialchars( $f['ve'] ) . $bc ); |
| 864 | + $o .= ' '+ wfMsg( 'mv_time_separator', $bo . htmlspecialchars( $f['vs'] ) . $bc, $bo . htmlspecialchars( $f['ve'] ) . $bc ); |
864 | 865 | } else { |
865 | | - $o .= $bo . str_replace( '_', ' ', htmlspecialchars( $f['v'] ) ) . $bc; |
| 866 | + $o .=' '. $bo . str_replace( '_', ' ', htmlspecialchars( $f['v'] ) ) . $bc .' '; |
866 | 867 | } |
867 | 868 | } |
868 | 869 | } |
Index: trunk/extensions/MetavidWiki/languages/MV_Messages.php |
— | — | @@ -427,8 +427,11 @@ |
428 | 428 | 'mv_other_options' => 'Other options', |
429 | 429 | 'mv_contextmenu_opt' => 'Enable context menus', |
430 | 430 | 'mv_hours' => '$1 {{PLURAL:$1|hour|hours}} ', |
| 431 | + 'mv_hours_singular' => '$1 hour', |
431 | 432 | 'mv_minutes' => '$1 {{PLURAL:$1|minute|minutes}}', |
| 433 | + 'mv_minutes_singular' => '$1 minute', |
432 | 434 | 'mv_seconds' => '$1 {{PLURAL:$1|second|seconds}}', |
| 435 | + 'mv_seconds_singular' => '$1 second', |
433 | 436 | 'mv_stream_length' => 'Total video length: ', |
434 | 437 | |
435 | 438 | 'mv_sequence_timeline' => 'Sequence timeline:', |
Index: trunk/extensions/MetavidWiki/skins/mv_search.js |
— | — | @@ -389,6 +389,8 @@ |
390 | 390 | js_log('selected:' + v.innerHTML ); |
391 | 391 | //update the image: |
392 | 392 | $j('#mv_person_img_'+inx).attr('src', $j(v).children('img').attr('src')); |
| 393 | + //update the text: |
| 394 | + $j('#mv_person_input_'+inx).val( $j('#mv_person_input_'+inx).val().replace('_', ' ') ); |
393 | 395 | }, |
394 | 396 | formatItem:function(row){ |
395 | 397 | //return '<img width="44" src="'+ row[2] + '">'+row[1]; |