Index: branches/MetavidWiki-exp/MetavidWiki/RELEASE |
— | — | @@ -1,10 +1,38 @@ |
2 | | -version beta 02 |
3 | | -changes in this release: |
| 2 | +version beta 1.0rc1 |
| 3 | +changes features of this release: |
4 | 4 | |
5 | 5 | |
6 | | -mv_embed |
| 6 | += Metavid 1.0rc1 Release Summary = |
7 | 7 | |
| 8 | +== Unified Search == |
| 9 | +* new unified search model groups and agrgates relavent semantic metadata per search |
| 10 | +* advanced search improvments |
8 | 11 | |
| 12 | +== Mv_embed == |
| 13 | +* support stream selection, supports flash stream type (Summer of code Sstudent *stjepan*) |
| 14 | +* flash media server added for serving portions of flvs to arbitrary clients. (thanks FLV4PHP) |
| 15 | +* Also See http://metavid.ucsc.edu/wiki/index.php/Mv_embed |
| 16 | + |
| 17 | +== JQuery 1.2.6 == |
| 18 | +* updated to latest and greates |
| 19 | +* Also see http://docs.jquery.com/Release:jQuery_1.2.6 |
| 20 | + |
| 21 | +== Updated compatibility to latest metavidWiki version *1.13* == |
| 22 | +* Also see http://svn.wikimedia.org/svnroot/mediawiki/tags/REL1_13_0RC2/phase3/RELEASE-NOTES |
| 23 | + |
| 24 | +== Updated Compatibility to latest Semantic MediaWiki 1.2 == |
| 25 | +* faster, lazyloading of all classes, better db structure, + lots more |
| 26 | +* Also See http://semantic-mediawiki.org/wiki/SMW_1.2 |
| 27 | + |
| 28 | +== Massive security review (thanks '''tstarling''') == |
| 29 | +* properly escaped all values outputted to browser and database |
| 30 | +* proper use of database wrapper functions |
| 31 | +* closed some security holes (running older versions of metavid is a bad idea please update now) |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | +==Old Versions== |
| 36 | + |
9 | 37 | version: beta 01 |
10 | 38 | First Release of the metavidWiki software (nothing too special just gziped the svn) |
11 | 39 | see http://metavid.ucsc.edu/wiki/index.php/MetaVidWiki_Features_Overview |
Index: branches/MetavidWiki-exp/MetavidWiki/maintenance/tv2mvWiki/README |
— | — | @@ -1,14 +1,19 @@ |
2 | | -This is the latest version of the metavid capture software. |
3 | | -It has been tuned a bit to be more genneraly applicable/scallable |
| 2 | +This will eventually host the tools for capturing brodcasted content |
| 3 | +and insertting it into a wiki |
4 | 4 | |
5 | | -The genneral flow and machine layout is as follows: |
| 5 | +presently the script metavid project uses are accesible here: |
| 6 | +http://slugforge.cse.ucsc.edu/gf/project/metavid/ |
| 7 | +but I don't recomend using them not genneraly applicable. |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +The genneral flow and machine layout should be as follows: |
6 | 12 | note: obvisuly your layout may differ and adjustments may be needed. |
7 | 13 | |
8 | 14 | dependencies: |
9 | 15 | metavidWiki |
10 | 16 | ffmpeg2theora |
11 | | - icecast |
12 | | - |
| 17 | + icecast |
13 | 18 | ~Video for Linux~ compatible capture hardware |
14 | 19 | |
15 | 20 | |
— | — | @@ -47,6 +52,5 @@ |
48 | 53 | mediaWiki_demon.php |
49 | 54 | |
50 | 55 | |
51 | | - |
52 | 56 | ===http capture admin=== |
53 | 57 | (can be run on any server) |
\ No newline at end of file |
Index: branches/MetavidWiki-exp/MetavidWiki/includes/MV_GlobalFunctions.php |
— | — | @@ -6,7 +6,7 @@ |
7 | 7 | * for more info visit http:/metavid.ucsc.edu/code |
8 | 8 | * |
9 | 9 | */ |
10 | | -define('MV_VERSION','0.1 (pre alpha)'); |
| 10 | +define('MV_VERSION','1.0rc1 (pre alpha)'); |
11 | 11 | |
12 | 12 | |
13 | 13 | if ( !defined( 'MEDIAWIKI' ) ) die( 1 ); |
— | — | @@ -155,8 +155,8 @@ |
156 | 156 | $wgSpecialPages['MediaSearch'] = array('MediaSearch'); |
157 | 157 | $wgSpecialPages['MV_SpecialSearch'] = array('MV_SpecialSearch'); |
158 | 158 | |
159 | | - $wgAutoloadClasses['MV_SpecialMVAdmin'] = dirname(__FILE__) .'/specials/MV_SpecialMVAdmin.php'; |
160 | | - $wgSpecialPages['MV_SpecialMVAdmin'] = array('MV_SpecialMVAdmin'); |
| 159 | + $wgAutoloadClasses['MVAdmin'] = dirname(__FILE__) .'/specials/MV_SpecialMVAdmin.php'; |
| 160 | + $wgSpecialPages['MVAdmin'] = array('MV_SpecialMVAdmin'); |
161 | 161 | //require_once( dirname(__FILE__) . '/specials/MV_SpecialCRUDStream.php'); |
162 | 162 | //require_once( dirname(__FILE__) . '/specials/MV_SpecialListStreams.php'); |
163 | 163 | //require_once( dirname(__FILE__) . '/specials/MV_SpecialExport.php'); |
— | — | @@ -228,7 +228,7 @@ |
229 | 229 | $mvgScriptPath = htmlspecialchars( $mvgScriptPath ); |
230 | 230 | $wgJsMimeType = htmlspecialchars( $wgJsMimeType) ; |
231 | 231 | /* (moved to on_dom ready) but here as well*/ |
232 | | - $wgOut->addScript("<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/jquery/jquery-1.2.1.js\"></script>"); |
| 232 | + $wgOut->addScript("<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/jquery/jquery-1.2.6.min.js\"></script>"); |
233 | 233 | $wgOut->addScript("<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/jquery/plugins/jquery.autocomplete.js\"></script>"); |
234 | 234 | $wgOut->addScript("<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/jquery/plugins/jquery.hoverIntent.js\"></script>"); |
235 | 235 | |
— | — | @@ -266,15 +266,6 @@ |
267 | 267 | $wgOut->addScript("<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/mv_embed.js\"></script>"); |
268 | 268 | } |
269 | 269 | } |
270 | | - if($head_set=='search' || $head_set=='sequence'){ |
271 | | - //get jquery and autocomplete for seq/search |
272 | | - //already included for all pages to support autoComplete |
273 | | - if(!($mvEnableAutoComplete || $mvEnableJSLinkBack ||$mvEnableJSMVDrewrite) ){ |
274 | | - $wgOut->addScript("<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/jquery/jquery-1.2.1.js\"></script>"); |
275 | | - $wgOut->addScript("<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/jquery/plugins/jquery.autocomplete.js\"></script>"); |
276 | | - $wgOut->addScript("<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_embed/jquery/plugins/jquery.hoverIntent.js\"></script>"); |
277 | | - } |
278 | | - } |
279 | 270 | |
280 | 271 | if($head_set=='search') |
281 | 272 | $wgOut->addScript("<script type=\"{$wgJsMimeType}\" src=\"{$mvgScriptPath}/skins/mv_search.js\"></script>"); |
Index: branches/MetavidWiki-exp/MetavidWiki/includes/MV_Stream.php |
— | — | @@ -12,7 +12,6 @@ |
13 | 13 | * |
14 | 14 | */ |
15 | 15 | if ( !defined( 'MEDIAWIKI' ) ) die( 1 ); |
16 | | -/*the format to extension mapping*/ |
17 | 16 | |
18 | 17 | /* handles metavid stream config and updates mv_stream table*/ |
19 | 18 | class MV_Stream { |
Index: branches/MetavidWiki-exp/MetavidWiki/includes/MV_StreamFile.php |
— | — | @@ -14,7 +14,6 @@ |
15 | 15 | * MvStreamFile handles the mapping of path types to urls & |
16 | 16 | * active record style management of the mv_stream_files table |
17 | 17 | */ |
18 | | - |
19 | 18 | class MV_StreamFile{ |
20 | 19 | var $stream_id=''; |
21 | 20 | var $base_offset='';//base offset from the stream date_start_time |
— | — | @@ -70,10 +69,9 @@ |
71 | 70 | $dbw->delete($mvStreamFilesTable, array('id'=>$this->id)); |
72 | 71 | } |
73 | 72 | function writeStreamFileDB(){ |
74 | | - global $mvStreamFilesTable; |
75 | 73 | $dbw = & wfGetDB(DB_WRITE); |
76 | 74 | if($this->id==''){ |
77 | | - $dbw->insert($mvStreamFilesTable, array( |
| 75 | + $dbw->insert('mv_stream_files', array( |
78 | 76 | 'stream_id'=>$this->stream_id, |
79 | 77 | 'base_offset'=>$this->base_offset, |
80 | 78 | 'duration'=>$this->duration, |
— | — | @@ -83,7 +81,7 @@ |
84 | 82 | ), __METHOD__); |
85 | 83 | }else{ |
86 | 84 | //update: |
87 | | - $dbw->update($mvStreamFilesTable, array( |
| 85 | + $dbw->update('mv_stream_files', array( |
88 | 86 | 'base_offset'=>$this->base_offset, |
89 | 87 | 'duration'=>$this->duration, |
90 | 88 | 'file_desc_msg'=>$this->file_desc_msg, |
— | — | @@ -93,10 +91,10 @@ |
94 | 92 | } |
95 | 93 | } |
96 | 94 | function getStreamFileDB($quality=null){ |
97 | | - global $mvDefaultVideoQualityKey, $mvStreamFilesTable; |
| 95 | + global $mvDefaultVideoQualityKey; |
98 | 96 | if($quality==null)$quality=$mvDefaultVideoQualityKey; |
99 | 97 | $dbr = & wfGetDB(DB_READ); |
100 | | - $result = $dbr->select($dbr->tableName($mvStreamFilesTable), array('path'), array ( |
| 98 | + $result = $dbr->select('mv_stream_files', array('path'), array ( |
101 | 99 | 'stream_id' => $this->_parent_stream->getStreamId(), |
102 | 100 | 'file_desc_msg'=>$quality |
103 | 101 | )); |
Index: branches/MetavidWiki-exp/MetavidWiki/includes/MV_StreamImage.php |
— | — | @@ -14,17 +14,7 @@ |
15 | 15 | |
16 | 16 | //two modes -stand alone- and -mediaWiki- |
17 | 17 | |
18 | | -if ( !defined( 'MEDIAWIKI' ) ){ |
19 | | - die('not an entry point'); |
20 | | - //*stand alone mode* |
21 | | - //need to setup db connection, etc grab the LocalSettings.php |
22 | | - //include_once('../') |
23 | | - |
24 | | - //get config values etc |
25 | | - //start object and serv image: |
26 | | - //$MV_OggImage = new MV_OggImage(array('mode'=>'stand_alone')); |
27 | | - //$MV_OggImage->doManuallRequest(); |
28 | | -} |
| 18 | +if ( !defined( 'MEDIAWIKI' ) )die('not an entry point'); |
29 | 19 | |
30 | 20 | //serves up images and does necessary transforms if the file does not exist |
31 | 21 | //@@TODO in the future it would be ideal if it was integrated similar to oggHandler |
— | — | @@ -57,7 +47,9 @@ |
58 | 48 | |
59 | 49 | //by default return a non-direct link so that javascript can modify the url to get new images |
60 | 50 | if(!$directLink){ |
61 | | - return $wgScript.'?action=ajax&rs=mv_frame_server&stream_id='.$stream_id.'&t='.$req_time.$req_size_out; |
| 51 | + return $wgScript.'?action=ajax&rs=mv_frame_server&stream_id=' . |
| 52 | + htmlspecialchars($stream_id) . |
| 53 | + '&t=' . htmlspecialchars($req_time) . htmlspecialchars($req_size_out); |
62 | 54 | } |
63 | 55 | $req_time = MV_StreamImage::procRequestTime($stream_id, $req_time); |
64 | 56 | if($req_time==false){ |
— | — | @@ -73,8 +65,8 @@ |
74 | 66 | list($im_width, $im_height, $ext) = MV_StreamImage::getSizeType($req_size); |
75 | 67 | $s='_'.$im_width.'x'.$im_height; |
76 | 68 | } |
77 | | - return $mvWebImgLoc .'/'. MV_StreamImage::getRelativeImagePath($stream_id) . |
78 | | - '/'.$req_time.$s.'.'.$ext; |
| 69 | + return htmlspecialchars($mvWebImgLoc) .'/'. MV_StreamImage::getRelativeImagePath($stream_id) . |
| 70 | + '/'.htmlspecialchars($req_time).htmlspecialchars($s) . '.' . htmlspecialchars($ext); |
79 | 71 | }else{ |
80 | 72 | //throw 'error finding image'; |
81 | 73 | return MV_StreamImage::getMissingImageURL($req_size); |
— | — | @@ -88,7 +80,7 @@ |
89 | 81 | if($req_size)$s='_'.$im_width.'x'.$im_height; |
90 | 82 | |
91 | 83 | if(MV_StreamImage::getMissingImagePath($req_size, $s, $ext) ){ |
92 | | - return $mvWebImgLoc .'/images_not_available'.$s.'.'.$ext; |
| 84 | + return htmlspecialchars($mvWebImgLoc) .'/images_not_available'.$s.'.'.$ext; |
93 | 85 | } |
94 | 86 | } |
95 | 87 | function getMissingImagePath($req_size){ |
— | — | @@ -98,15 +90,16 @@ |
99 | 91 | if($req_size)$s='_'.$im_width.'x'.$im_height; |
100 | 92 | |
101 | 93 | if(is_file($mvLocalImgLoc.'/images_not_available'.$s.'.'.$ext)){ |
102 | | - return $mvLocalImgLoc.'/images_not_available'.$s.'.'.$ext; |
| 94 | + return htmlspecialchars($mvLocalImgLoc) . |
| 95 | + '/images_not_available' . htmlspecialchars($s) . '.' . htmlspecialchars($ext); |
103 | 96 | }else{ |
104 | 97 | //try and generate it; |
105 | 98 | if(!MV_StreamImage::doTransformImage($mvLocalImgLoc.'/images_not_available.jpg', |
106 | 99 | $mvLocalImgLoc.'/images_not_available'.$s.'.'.$ext, |
107 | 100 | $im_width, $im_height, $ext)){ |
108 | | - return $mvLocalImgLoc.'/images_not_available.jpg'; |
| 101 | + return htmlspecialchars($mvLocalImgLoc).'/images_not_available.jpg'; |
109 | 102 | }else{ |
110 | | - return $mvLocalImgLoc.'/images_not_available'.$s.'.'.$ext; |
| 103 | + return htmlspecialchars($mvLocalImgLoc).'/images_not_available'.htmlspecialchars($s).'.'.htmlspecialchars($ext); |
111 | 104 | } |
112 | 105 | } |
113 | 106 | } |
— | — | @@ -131,7 +124,7 @@ |
132 | 125 | } |
133 | 126 | } |
134 | 127 | function procRequestTime($stream_id, $req_time){ |
135 | | - global $mvStreamImageTable, $mvShellOggFrameGrab, $mvImageGranularityRate; |
| 128 | + global $mvShellOggFrameGrab, $mvImageGranularityRate; |
136 | 129 | if(!$req_time)$req_time='0'; |
137 | 130 | if(count(explode(":",$req_time))==3){ |
138 | 131 | $req_time = ntp2seconds($req_time); |
— | — | @@ -143,13 +136,17 @@ |
144 | 137 | //query the image db to find the closest to req time (while still being in front) |
145 | 138 | $dbr = & wfGetDB(DB_READ); |
146 | 139 | //if($req_time<$mvImageGranularityRate)$req_time = $mvImageGranularityRate; |
147 | | - $select = " `id`, `time`, `time`-'$req_time' as distance "; |
148 | | - $cond = " `stream_id`=$stream_id |
| 140 | + $vars = " `id`, `time`, `time`-'$req_time' as distance "; |
| 141 | + $conds = " `stream_id`=".mysql_real_escape_string($stream_id) |
149 | 142 | AND (`time`-'$req_time')>=0 |
150 | | - AND (`time`-'$req_time')<= $mvImageGranularityRate"; |
| 143 | + AND (`time`-'$req_time')<= mysql_real_escape_string($mvImageGranularityRate); |
151 | 144 | $opt['ORDER BY']=' `distance` ASC '; |
152 | 145 | $opt['LIMIT']=1; |
153 | | - $res = $dbr->select($mvStreamImageTable, $select, $cond, 'MV_StreamImage::procRequestTime', $opt); |
| 146 | + $res = $dbr->select('mv_stream_images', |
| 147 | + $vars, |
| 148 | + $conds, |
| 149 | + __METHOD__, |
| 150 | + $opt); |
154 | 151 | //print $dbr->lastQuery(); |
155 | 152 | //die; |
156 | 153 | if($dbr->numRows($res)==0){ |
Index: branches/MetavidWiki-exp/MetavidWiki/includes/MV_MagicWords.php |
— | — | @@ -12,6 +12,7 @@ |
13 | 13 | * magic words has all parser rewrite keys functions |
14 | 14 | * format is {{#mvData:magicTypeKey|format=format|num_results=#}} etc |
15 | 15 | */ |
| 16 | +if ( !defined( 'MEDIAWIKI' ) ) die( 1 ); |
16 | 17 | class MV_MagicWords{ |
17 | 18 | var $args = array(); |
18 | 19 | |
— | — | @@ -92,12 +93,16 @@ |
93 | 94 | //gets the top few clip ranges |
94 | 95 | function getTopClips(){ |
95 | 96 | $dbr = & wfGetDB(DB_READ); |
96 | | - $result = $dbr->select('mv_clipview_digest', '`query_key`,`stream_id`,`start_time`, `end_time`, COUNT(1) as `hit_count`', |
97 | | - 'view_date >=\''.$this->getStartTime().'\'', |
98 | | - __METHOD__, |
99 | | - array('GROUP BY' => 'query_key', 'ORDER BY'=>'`hit_count` ASC', |
100 | | - 'LIMIT'=>($this->params['num_results'])) |
101 | | - ); |
| 97 | + $vars = array('query_key','stream_id','start_time','end_time', 'COUNT(1) as hit_count'); |
| 98 | + $conds = array('view_date >='.$dbr->addQuotes($this->getStartTime())); |
| 99 | + $options = array('GROUP BY' => 'query_key', 'ORDER BY'=>'`hit_count` ASC', |
| 100 | + 'LIMIT'=>($this->params['num_results']) ); |
| 101 | + $result = $dbr->select('mv_clipview_digest', |
| 102 | + $vars, |
| 103 | + $conds, |
| 104 | + __METHOD__, |
| 105 | + $options |
| 106 | + ); |
102 | 107 | if($dbr->numRows($result)==0){ |
103 | 108 | return ''; |
104 | 109 | }else{ |
— | — | @@ -125,7 +130,7 @@ |
126 | 131 | $mvTitle->getTimeDesc().'" src="'.$mvTitle->getStreamImageURL('small'). |
127 | 132 | '"/>', |
128 | 133 | 'tl=1' ); |
129 | | - |
| 134 | + $title_span=''; |
130 | 135 | if(isset($mvStream->date_start_time)){ |
131 | 136 | $parts = split('_',$mvStream->getStreamName()); |
132 | 137 | if(count($parts)>=3){ |
— | — | @@ -196,29 +201,50 @@ |
197 | 202 | function getTopSearches(){ |
198 | 203 | $dbr =& wfGetDB(DB_READ); |
199 | 204 | $o=''; |
| 205 | + $options=array(); |
200 | 206 | /*$result = $dbr->select('mv_search_digest', '`query_key`, COUNT(1) as `hit_count`', "`time` >= '$start_time' ", |
201 | 207 | __METHOD__, |
202 | 208 | array('GROUP BY' => 'query_key', 'ORDER BY `hit_count` ASC', |
203 | 209 | 'LIMIT 0,'.$this->params['num_results']) );*/ |
204 | | - $sql="SELECT `mv_search_digest`.`query_key`, COUNT(1) as `hit_count`, `mv_query_key_lookup`.`filters` |
| 210 | + /*$sql="SELECT `mv_search_digest`.`query_key`, COUNT(1) as `hit_count`, `mv_query_key_lookup`.`filters` |
205 | 211 | FROM `mv_search_digest` |
206 | 212 | LEFT JOIN `mv_query_key_lookup` ON (`mv_search_digest`.`query_key` = `mv_query_key_lookup`.`query_key`) |
207 | 213 | WHERE `time` >= '{$this->getStartTime()}' GROUP BY `mv_search_digest`.`query_key` |
208 | | - LIMIT 0, {$this->params[num_results]}"; |
209 | | - $result = $dbr->query($sql); |
| 214 | + LIMIT 0, {$this->params[num_results]}";*/ |
| 215 | + //$from_tables |
| 216 | + $vars = array($dbr->tableName('mv_search_digest').'.query_key', |
| 217 | + 'COUNT(1) as `hit_count`', |
| 218 | + $dbr->tableName('mv_query_key_lookup').'.filters'); |
| 219 | + $from_tables= $dbr->tableName('mv_search_digest'). |
| 220 | + ' LEFT JOIN' . $dbr->tableName('mv_query_key_lookup') . |
| 221 | + ' ON ( '. |
| 222 | + $dbr->tableName('mv_search_digest').'.query_key = ' . |
| 223 | + $dbr->tableName('mv_query_key_lookup').'.query_key '. |
| 224 | + ' ) '; |
| 225 | + $conds = '`time` >= ' . $dbr->addQuotes($this->getStartTime()); |
| 226 | + |
| 227 | + $options['GROUP BY']=$dbr->tableName('mv_search_digest').'.query_key'; |
| 228 | + $options['LIMIT'] = $this->params[num_results]; |
| 229 | + |
| 230 | + $result = $dbr->select( $from_tables, |
| 231 | + $vars, |
| 232 | + $conds, |
| 233 | + __METHOD__, |
| 234 | + $options); |
| 235 | + |
210 | 236 | if($dbr->numRows($result)==0){ |
211 | 237 | return ''; |
212 | 238 | }else{ |
213 | 239 | //@@todo probably should try to abstract out formating.. |
214 | 240 | //but will need to wait until we have a few more test cases to do a productive abstraction |
215 | 241 | if($this->params['format']=='ul_list'){ |
216 | | - $class_attr=($this->params['class']!='')?' class="'.$this->params['class'].'"':''; |
| 242 | + $class_attr=($this->params['class']!='')?' class="' . htmlspecialchars($this->params['class']) . '"':''; |
217 | 243 | $o.='<ul'.$class_attr.'>'; |
218 | 244 | } |
219 | 245 | $mvms=new MV_SpecialMediaSearch(); |
220 | 246 | $sTitle=Title::MakeTitle(NS_SPECIAL, 'MediaSearch'); |
221 | 247 | while($row = $dbr->fetchObject( $result )){ |
222 | | - $title_desc = $row->hit_count.' '.wfMsg('mv_date_'.$this->params['time_range']); |
| 248 | + $title_desc = htmlspecialchars($row->hit_count).' '.wfMsg('mv_date_'.$this->params['time_range']); |
223 | 249 | $mvms->loadFiltersFromSerialized($row->filters); |
224 | 250 | $o.='<li><a title="'.$title_desc.'" href="'.$sTitle->escapeLocalURL($mvms->get_httpd_filters_query().'&tl=1' ).'">'. |
225 | 251 | $mvms->getFilterDesc($query_key=true) . |
Index: branches/MetavidWiki-exp/MetavidWiki/includes/MV_Settings.php |
— | — | @@ -1,6 +1,5 @@ |
2 | 2 | <? |
3 | 3 | if ( !defined( 'MEDIAWIKI' ) ) die( 1 ); |
4 | | -//include the default settings: |
5 | 4 | // (this file is depricated update your MV_LocalSettings.php to point to MV_LocalSettings) |
6 | 5 | include_once(dirname(__FILE__) .'/../MV_LocalSettings.php'); |
7 | 6 | ?> |
\ No newline at end of file |
Index: branches/MetavidWiki-exp/MetavidWiki/includes/MV_ImageGallery.php |
— | — | @@ -9,6 +9,7 @@ |
10 | 10 | * @email dale@ucsc.edu |
11 | 11 | * @url http://metavid.ucsc.edu |
12 | 12 | */ |
| 13 | +if ( !defined( 'MEDIAWIKI' ) ) die( 1 ); |
13 | 14 | class MV_ImageGallery extends ImageGallery{ |
14 | 15 | private $mAttribs = array(); |
15 | 16 | private $contextTitle = false; |
Index: branches/MetavidWiki-exp/MetavidWiki/includes/MV_Index.php |
— | — | @@ -101,7 +101,7 @@ |
102 | 102 | function getMVDInRange($stream_id, $start_time=null, $end_time=null, $mvd_type='all',$getText=false,$smw_properties='', $limit='200'){ |
103 | 103 | global $mvIndexTableName, $mvDefaultClipLength; |
104 | 104 | $dbr =& wfGetDB(DB_SLAVE); |
105 | | - //set up select vars: |
| 105 | + //set up select vars: |
106 | 106 | $conds=$options=$vars=array(); |
107 | 107 | $from_tables =''; |
108 | 108 | // |
— | — | @@ -118,12 +118,12 @@ |
119 | 119 | if(!is_array($smw_properties)) |
120 | 120 | $smw_properties = explode(',',$smw_properties); |
121 | 121 | foreach($smw_properties as $prop_name){ |
122 | | - $vars[] = mysql_escape_string($prop_name).'.object_title as '.mysql_escape_string($prop_name); |
| 122 | + $vars[] = mysql_real_escape_string($prop_name).'.object_title as '.mysql_real_escape_string($prop_name); |
123 | 123 | $from_tables.=' LEFT JOIN '. $dbr->tableName('smw_relations') . |
124 | | - ' as ' . mysql_escape_string($prop_name) . |
| 124 | + ' as ' . mysql_real_escape_string($prop_name) . |
125 | 125 | ' ON (' . $dbr->tableName('mv_mvd_index') . '.mv_page_id'. |
126 | | - ' = ' . mysql_escape_string($prop_name) . '.subject_id'. |
127 | | - ' AND '. mysql_escape_string($prop_name).'.relation_title'. |
| 126 | + ' = ' . mysql_real_escape_string($prop_name) . '.subject_id'. |
| 127 | + ' AND '. mysql_real_escape_string($prop_name).'.relation_title'. |
128 | 128 | ' = ' . $dbr->addQuotes($prop_name) . ')'; |
129 | 129 | } |
130 | 130 | } |
— | — | @@ -144,9 +144,9 @@ |
145 | 145 | |
146 | 146 | } |
147 | 147 | if($end_time) |
148 | | - $cond[]='AND start_time <= '. $dbr->addQuotes($end_time); |
| 148 | + $conds[]='start_time <= '. $dbr->addQuotes($end_time); |
149 | 149 | if($start_time) |
150 | | - $cond[]='AND end_time >= '. $dbr->addQuotes($start_time); |
| 150 | + $conds[]='end_time >= '. $dbr->addQuotes($start_time); |
151 | 151 | |
152 | 152 | //add in ordering |
153 | 153 | $options['ORDER BY']= 'start_time ASC'; |
— | — | @@ -158,8 +158,8 @@ |
159 | 159 | $conds, |
160 | 160 | __METHOD__, |
161 | 161 | $options); |
162 | | - /*print $dbr->lastQuery(); |
163 | | - die;*/ |
| 162 | + //print $dbr->lastQuery(); |
| 163 | + //die; |
164 | 164 | //echo $sql; |
165 | 165 | //$result =& $dbr->query( $sql, 'MV_Index:time_index_query'); |
166 | 166 | return $result; |
— | — | @@ -249,7 +249,8 @@ |
250 | 250 | $from_tables_top=''; |
251 | 251 | $vars_top= $conds_top= $options_top=array(); |
252 | 252 | |
253 | | - $date_range_join = $do_top_range_query = false; |
| 253 | + $do_top_range_query = false; |
| 254 | + $date_range_join=true; |
254 | 255 | |
255 | 256 | $dbr =& wfGetDB(DB_SLAVE); |
256 | 257 | //organize the queries (group full-text searches and category/attributes) |
— | — | @@ -273,6 +274,7 @@ |
274 | 275 | |
275 | 276 | $group_spoken=true; |
276 | 277 | //$categoryTable = ; |
| 278 | + $valid_filter_count=0; |
277 | 279 | foreach($filters as $f){ |
278 | 280 | //proocc and or for fulltext: |
279 | 281 | if(!isset($f['a']))$f['a']='and'; |
— | — | @@ -283,7 +285,9 @@ |
284 | 286 | } |
285 | 287 | //add to the fulltext query: |
286 | 288 | switch($f['t']){ |
287 | | - case 'spoken_by': |
| 289 | + case 'spoken_by': |
| 290 | + //skip if empty value: |
| 291 | + if(trim($f['v'])=='')continue; |
288 | 292 | //if we have an OR set prev to OR |
289 | 293 | if($last_person_aon=='+' && $aon==''){ |
290 | 294 | $ftq=str_replace('+"spoken by', '"spoken by', $ftq); |
— | — | @@ -292,17 +296,23 @@ |
293 | 297 | //full text based semantic query: |
294 | 298 | $ftq.=' '.$aon.'"spoken by '. mysql_real_escape_string($f['v']).'" '; |
295 | 299 | //table based query: |
296 | | - $last_person_aon=$aon; |
| 300 | + $last_person_aon=$aon; |
| 301 | + $valid_filter_count++; |
297 | 302 | //$conds[]= |
298 | 303 | break; |
299 | 304 | case 'match': |
| 305 | + //skip if empty value: |
| 306 | + if(trim($f['v'])=='')continue; |
300 | 307 | $ftq_match.=$aon.'"'.mysql_real_escape_string($f['v']).'"'; |
301 | 308 | //only need to split out ftq match if spoken by is more than one |
302 | 309 | if($ftq_match_asql!='') |
303 | | - $ftq_match_asql = $asql; |
| 310 | + $ftq_match_asql = $asql; |
| 311 | + $valid_filter_count++; |
304 | 312 | break; |
305 | 313 | //top level queries (sets up time ranges ) |
306 | 314 | case 'category': |
| 315 | + //skip if empty value: |
| 316 | + if(trim($f['v'])=='')continue; |
307 | 317 | $do_top_range_query=true; |
308 | 318 | //full text based category query: |
309 | 319 | $toplq.=' '.$aon.'"category '.mysql_real_escape_string($f['v']).'" '; |
— | — | @@ -315,6 +325,7 @@ |
316 | 326 | case 'not':$toplq_cat='NOT';break; |
317 | 327 | } |
318 | 328 | $toplq_cat.=$dbr->tableName( 'categorylinks').'.cl_to='.$dbr->addQuotes($f['v']); |
| 329 | + $valid_filter_count++; |
319 | 330 | break; |
320 | 331 | case 'date_range': |
321 | 332 | $date_range_join = true; |
— | — | @@ -323,22 +334,30 @@ |
324 | 335 | list($month, $day, $year) = explode('/',$f['ve']); |
325 | 336 | $ets = mktime(0,0,0,$month, $day+1, $year); //(the start of the next day) |
326 | 337 | //add date condtion: |
327 | | - $date_cond = ' '.$asql.'( `mv_streams`.`date_start_time` > ' |
| 338 | + //note dissable and or for date range for now: $asql |
| 339 | + $conds[] = ' ( `mv_streams`.`date_start_time` > ' |
328 | 340 | . $dbr->addQuotes($sts) . |
329 | 341 | ' AND `mv_streams`.`date_start_time` < '. $dbr->addQuotes($ets) . |
330 | | - ') '; |
| 342 | + ') '; |
| 343 | + //print $date_cond; |
| 344 | + $valid_filter_count++; |
331 | 345 | break; |
332 | | - case 'stream_name': |
| 346 | + case 'stream_name': |
| 347 | + //skip if empty value: |
| 348 | + if(trim($f['v'])=='')continue; |
333 | 349 | $stream =& mvGetMVStream($f['v']); |
334 | 350 | //add stream cond |
335 | 351 | $conds[]=$asql." stream_id = ". $dbr->addQuotes($stream->getStreamId()); |
| 352 | + $valid_filter_count++; |
336 | 353 | break; |
337 | 354 | case 'smw_property': |
338 | 355 | //more complicated query work needed |
339 | 356 | break; |
340 | 357 | } |
341 | 358 | } |
342 | | - |
| 359 | + if($valid_filter_count==0){ |
| 360 | + return array(); |
| 361 | + } |
343 | 362 | //add the top query to the base query: |
344 | 363 | $ftq.=$toplq; |
345 | 364 | $vars = "mv_page_id as id,". $dbr->tableName('mv_mvd_index').'.stream_id, |
— | — | @@ -389,30 +408,33 @@ |
390 | 409 | //$sql.="WHERE "; |
391 | 410 | //$sql.=" ( `{$mvIndexTableName}`.`mvd_type`='ht_en' OR `{$mvIndexTableName}`.`mvd_type`='anno_en') AND" ; |
392 | 411 | |
393 | | - //add conditions: |
394 | | - $conds.= ' '.$dbr->tableName('mv_mvd_index') . '.mvd_type = \'ht_en\' '. |
395 | | - ' OR '. $dbr->tableName('mv_mvd_index') . '.mvd_type=\'anno_en\' '. |
396 | | - $date_cond; |
| 412 | + //add conditions to last condition element (cuz we have to manually mannage and or): |
| 413 | + |
| 414 | + $conds[count($conds)]= ' '.$dbr->tableName('mv_mvd_index') . '.mvd_type = \'ht_en\' '. |
| 415 | + ' OR '. $dbr->tableName('mv_mvd_index') . '.mvd_type=\'anno_en\' '; |
| 416 | + |
397 | 417 | //limit to ht_en & anno_en (for now) (future allow selection |
398 | | - |
| 418 | + //$conds_inx = (count($conds)==0)?0:count($conds)-1; |
399 | 419 | $two_part_anor=''; |
400 | 420 | if($group_spoken){ |
401 | 421 | $ftq.=$ftq_match; |
402 | 422 | }else{ |
403 | 423 | if($ftq_match!=''){ |
404 | | - $conds.=$ftq_match_asql.' MATCH ( '. $dbr->tableName( 'searchindex' ).'.si_text )'. |
| 424 | + $conds[].=$ftq_match_asql.' MATCH ( '. $dbr->tableName( 'searchindex' ).'.si_text )'. |
405 | 425 | ' AGAINST(\''.$ftq_match.'\' IN BOOLEAN MODE) '; |
406 | 426 | //if($ftq!='')$sql.=' AND '; |
407 | 427 | } |
408 | 428 | } |
409 | 429 | if($ftq!=''){ |
410 | | - $conds.=" MATCH ( ".$dbr->tableName( 'searchindex' ).'.si_text ) '. |
| 430 | + $conds[].=" MATCH ( ".$dbr->tableName( 'searchindex' ).'.si_text ) '. |
411 | 431 | ' AGAINST(\''.$ftq.'\' IN BOOLEAN MODE) '; |
412 | 432 | } |
| 433 | + //print_r($conds); |
| 434 | + //die; |
413 | 435 | //date range stuff is SLOW when its the only filter (pulls up matches for everything) |
414 | | - if($snq!='' || $ftq!='' && isset($date_range_andor)) |
| 436 | + /*if($snq!='' || $ftq!='' && isset($date_range_andor)) |
415 | 437 | $sql.=$date_range_andor; |
416 | | - $sql.=" $date_range_where "; |
| 438 | + $sql.=" $date_range_where ";*/ |
417 | 439 | |
418 | 440 | switch($this->order){ |
419 | 441 | case 'relevent': |
— | — | @@ -436,7 +458,7 @@ |
437 | 459 | __METHOD__, |
438 | 460 | $options); |
439 | 461 | |
440 | | - echo "SQL:".$dbr->lastQuery($result)." \n"; |
| 462 | + //echo "SQL:".$dbr->lastQuery($result)." \n"; |
441 | 463 | //die; |
442 | 464 | //$result = $dbr->query($sql, 'MV_Index:doFiltersQuery_base'); |
443 | 465 | |
Index: branches/MetavidWiki-exp/MetavidWiki/includes/specials/MV_SpecialMVAdmin.php |
— | — | @@ -27,11 +27,11 @@ |
28 | 28 | |
29 | 29 | class MVAdmin extends SpecialPage { |
30 | 30 | |
31 | | - /** |
| 31 | + /* |
32 | 32 | * Constructor |
33 | 33 | */ |
34 | 34 | public function __construct() { |
35 | | - global $wgMessageCache; ///TODO: should these be messages? |
| 35 | + global $wgMessageCache; ///TODO: should these be messages? |
36 | 36 | $wgMessageCache->addMessages(array('mvadmin' => 'Admin functions for MetavidWiki')); |
37 | 37 | parent::__construct('MVAdmin', 'delete'); |
38 | 38 | } |
— | — | @@ -51,7 +51,8 @@ |
52 | 52 | $wgOut->permissionRequired('delete'); |
53 | 53 | return; |
54 | 54 | } |
55 | | - |
| 55 | + $wgOut->addHTML('web admin install currently dissabled'); |
| 56 | + exit(); |
56 | 57 | $wgOut->setPageTitle(wfMsg('mvadmin')); |
57 | 58 | |
58 | 59 | /**** Execute actions if any ****/ |
— | — | @@ -112,6 +113,4 @@ |
113 | 114 | $wgOut->addHTML($html); |
114 | 115 | return true; |
115 | 116 | } |
116 | | - |
117 | 117 | } |
118 | | -SpecialPage :: addPage(new MVAdmin()); |
Index: branches/MetavidWiki-exp/MetavidWiki/includes/specials/MV_SpecialMediaSearch.php |
— | — | @@ -175,6 +175,7 @@ |
176 | 176 | ); |
177 | 177 | $this->unified_term_search = $term; |
178 | 178 | //if not doing advanced search we are done |
| 179 | + |
179 | 180 | if (!$this->adv_search) |
180 | 181 | return; |
181 | 182 | } |
— | — | @@ -208,7 +209,10 @@ |
209 | 210 | if ($this->unified_term_search != '') |
210 | 211 | $this->unified_term_search .= ' '; |
211 | 212 | $this->unified_term_search .= $f['v']; |
| 213 | + }else if($f['t']=='spoken_by'){ |
| 214 | + $this->unified_term_search = $f['v']; |
212 | 215 | } |
| 216 | + |
213 | 217 | } |
214 | 218 | } |
215 | 219 | } else { |
— | — | @@ -232,8 +236,7 @@ |
233 | 237 | break; |
234 | 238 | } |
235 | 239 | } |
236 | | - } |
237 | | - //print "CUR un: " . $this->unified_term_search; |
| 240 | + } |
238 | 241 | } |
239 | 242 | function doSearch($log_search=true) { |
240 | 243 | global $mvEnableSearchDigest, $mvSearchDigestTable; |
— | — | @@ -435,19 +438,21 @@ |
436 | 439 | //look for people matches max of 3 |
437 | 440 | $first_block = ' first_block'; |
438 | 441 | $matches = 0; |
439 | | - $person_out = MV_SpecialMediaSearch :: auto_complete_person($this->unified_term_search, 3, 'person_html', $matches); |
| 442 | + $person_out_ary=array(); |
| 443 | + $person_out = MV_SpecialMediaSearch :: auto_complete_person($this->unified_term_search, 3, 'person_html', $matches, $person_out_ary); |
440 | 444 | if ($person_out != '' || count($sideBarLinkBucket['person']) != 0) { |
441 | 445 | //for now don't include({$matches}) |
442 | 446 | $o .= "<div class=\"block{$first_block}\"> |
443 | 447 | <h6>" . wfMsg('mv_people_results') . "</h6> |
444 | 448 | </div>"; |
445 | | - $o .= '<div class="block wide_block">' . |
446 | | - $person_out; |
| 449 | + $o .= '<div class="block wide_block">'; |
| 450 | + $o .= $person_out; |
447 | 451 | if (isset ($sideBarLinkBucket['person'])) { |
448 | 452 | $pAry = & $sideBarLinkBucket['person']; |
449 | 453 | arsort($pAry); |
450 | 454 | $i = 0; |
451 | 455 | foreach ($pAry as $person_name => $count) { |
| 456 | + if(in_array($person_name,$person_out_ary) )continue; |
452 | 457 | if ($i == $perSectionCount) |
453 | 458 | break; |
454 | 459 | $o .= MV_SpecialMediaSearch :: format_ac_line($person_name, '', '', MV_SpecialMediaSearch :: getPersonImageURL($person_name), $format = 'person_html'); |
— | — | @@ -1061,7 +1066,7 @@ |
1062 | 1067 | return $out; |
1063 | 1068 | } |
1064 | 1069 | /*@@todo cache result for given values*/ |
1065 | | - function auto_complete_person($val, $result_limit = '5', $format = 'ac_line', & $match_count = '') { |
| 1070 | + function auto_complete_person($val, $result_limit = '5', $format = 'ac_line', & $match_count = '',& $person_ary=array()) { |
1066 | 1071 | $dbr = & wfGetDB(DB_SLAVE); |
1067 | 1072 | $result = $dbr->select('categorylinks', 'cl_sortkey', array ( |
1068 | 1073 | 'cl_to' => 'Person', |
— | — | @@ -1076,6 +1081,7 @@ |
1077 | 1082 | $out = ''; |
1078 | 1083 | while ($row = $dbr->fetchObject($result)) { |
1079 | 1084 | $person_name = $row->cl_sortkey; |
| 1085 | + $person_ary[$person_name]=true; |
1080 | 1086 | //make sure the person page exists: |
1081 | 1087 | $personTitle = Title :: makeTitle(NS_MAIN, $person_name); |
1082 | 1088 | if ($personTitle->exists()) { |
Index: branches/MetavidWiki-exp/MetavidWiki/includes/MV_ParserCache.php |
— | — | @@ -9,6 +9,7 @@ |
10 | 10 | * @email dale@ucsc.edu |
11 | 11 | * @url http://metavid.ucsc.edu |
12 | 12 | */ |
| 13 | +if ( !defined( 'MEDIAWIKI' ) ) die( 1 ); |
13 | 14 | //quick hack to shift namespace of inline metavid parse cache |
14 | 15 | //avoids conflicts of inline display with full article display |
15 | 16 | class MV_ParserCache extends ParserCache{ |
Index: branches/MetavidWiki-exp/MetavidWiki/includes/MV_Title.php |
— | — | @@ -274,13 +274,11 @@ |
275 | 275 | * web stream is file_desc_msg as: mv_ogg_low_quality |
276 | 276 | * $mvDefaultVideoQualityKey in MV_Settings.php |
277 | 277 | * |
278 | | - * @@todo point to MV_OggSplit (for segmenting the ogg stream) |
279 | | - * (for now using anx) |
280 | 278 | */ |
281 | 279 | function getWebStreamURL($quality=null){ |
282 | 280 | global $mvStreamFilesTable, $mvVideoArchivePaths, $mvDefaultVideoQualityKey; |
283 | 281 | //@@todo mediawiki path for media (insted of hard link to $mvVideoArchive) |
284 | | - //@@todo make sure file exisits |
| 282 | + //@@todo make sure file exisits |
285 | 283 | if(!$quality)$quality=$mvDefaultVideoQualityKey; |
286 | 284 | $anx_req=''; |
287 | 285 | if( $this->getStartTime()!='' && $this->getEndTime()!=''){ |
— | — | @@ -293,7 +291,10 @@ |
294 | 292 | 'stream_id' => $this->mvStream->id, |
295 | 293 | 'file_desc_msg'=>$quality |
296 | 294 | )); |
297 | | - $streamFile =$dbr->fetchObject($result); |
| 295 | + if( $dbr->numRows($result)==0)return false; |
| 296 | + $streamFile =$dbr->fetchObject($result); |
| 297 | + |
| 298 | + //print_r($streamFile); |
298 | 299 | //make sure we have streamFiles (used to generate the link) |
299 | 300 | $mvStreamFile = new MV_StreamFile($this->mvStream, $streamFile); |
300 | 301 | //if link empty return false: |
— | — | @@ -307,7 +308,8 @@ |
308 | 309 | function getROEURL(){ |
309 | 310 | $roeTitle = Title::newFromText('MvExportStream', NS_SPECIAL); |
310 | 311 | //add the query: |
311 | | - $query = 'feed_format=roe&stream_name='.$this->getStreamName().'&t='.$this->getTimeRequest(); |
| 312 | + $query = 'feed_format=roe&stream_name=' . htmlspecialchars($this->getStreamName()) . |
| 313 | + '&t=' . htmlspecialchars( $this->getTimeRequest() ); |
312 | 314 | return $roeTitle->getFullURL($query) ; |
313 | 315 | } |
314 | 316 | function getEmbedVideoHtml($vid_id='', $size='', $force_server='', $autoplay=false){ |
— | — | @@ -320,32 +322,41 @@ |
321 | 323 | }else{ |
322 | 324 | list($vWidth, $vHeight, $na) = MV_StreamImage::getSizeType($size); |
323 | 325 | } |
324 | | - $vid_id=($vid_id=='')?'':'id="'.$vid_id.'"'; |
| 326 | + |
| 327 | + |
325 | 328 | $stream_web_url = $this->getWebStreamURL($mvDefaultVideoQualityKey); |
326 | 329 | //print "lookign for q: $mvDefaultFlashQualityKey "; |
327 | | - $flash_stream_url = $this->getWebStreamURL($mvDefaultFlashQualityKey); |
| 330 | + |
| 331 | + //print "FOUND: $flash_stream_url"; |
328 | 332 | $roe_url = $this->getROEURL(); |
329 | 333 | if($stream_web_url){ |
330 | 334 | $o=''; |
331 | 335 | if($this->dispVideoPlayerTime){ |
332 | 336 | $o.='<span id="mv_videoPlayerTime">'.$this->getStartTime().' to '. |
333 | | - $this->getEndTime() . |
| 337 | + htmlspecialchars( $this->getEndTime() ) . |
334 | 338 | '</span>'; |
335 | | - } |
336 | | - $auto_play_attr=($autoplay)?' autoplay="true" ':''; |
337 | | - $o.='<'.$tag.' '.$vid_id.' thumbnail="'.$this->getStreamImageURL($size, null, $force_server).'" '. |
| 339 | + } |
| 340 | + $o.='<'.htmlspecialchars($tag); |
| 341 | + $o.=($vid_id=='')?'':' id="'.htmlspecialchars($vid_id).'" '; |
| 342 | + $o.='thumbnail="'.$this->getStreamImageURL($size, null, $force_server).'" '. |
338 | 343 | 'roe="'.$roe_url.'" '. |
339 | | - 'show_meta_link="false" ' . $auto_play_attr . |
340 | | - 'style="width:'.$vWidth.'px;height:'.$vHeight.'px" '. |
| 344 | + 'show_meta_link="false" '; |
| 345 | + $o.= ($autoplay)?' autoplay="true" ':''; |
| 346 | + $o.='style="width:'.htmlspecialchars($vWidth).'px;height:'.htmlspecialchars($vHeight).'px" '. |
341 | 347 | 'controls="true" embed_link="true" >'; |
342 | 348 | |
343 | | - if($stream_web_url!='') |
344 | | - $o.='<source type="'.MV_StreamFile::getTypeForQK($mvDefaultVideoQualityKey).'" src="'.$stream_web_url .'"/>'; |
| 349 | + if($stream_web_url) |
| 350 | + $o.='<source type="'. |
| 351 | + htmlspecialchars(MV_StreamFile::getTypeForQK($mvDefaultVideoQualityKey)) . |
| 352 | + '" src="'.$stream_web_url .'"></source>'; |
| 353 | + |
| 354 | + $flash_stream_url = $this->getWebStreamURL($mvDefaultFlashQualityKey); |
| 355 | + if($flash_stream_url) |
| 356 | + $o.='<source type="'. |
| 357 | + htmlspecialchars(MV_StreamFile::getTypeForQK($mvDefaultFlashQualityKey)) . |
| 358 | + '" src="'.$flash_stream_url .'"></source>'; |
345 | 359 | |
346 | | - if($flash_stream_url!='') |
347 | | - $o.='<source type="'.MV_StreamFile::getTypeForQK($mvDefaultFlashQualityKey).'" src="'.$flash_stream_url .'"/>'; |
348 | | - |
349 | | - $o.='</video>'; |
| 360 | + $o.='</video>'; |
350 | 361 | return $o; |
351 | 362 | }else{ |
352 | 363 | return wfMsg('mv_error_stream_missing'); |
Index: branches/MetavidWiki-exp/MetavidWiki/includes/MV_Image.php |
— | — | @@ -11,6 +11,7 @@ |
12 | 12 | * |
13 | 13 | * extends image to deal give pointers to metavid media |
14 | 14 | */ |
| 15 | +if ( !defined( 'MEDIAWIKI' ) ) die( 1 ); |
15 | 16 | class MV_Image extends Image { |
16 | 17 | |
17 | 18 | } |
Index: branches/MetavidWiki-exp/MetavidWiki/includes/MV_MetavidInterface/MV_MetavidInterface.php |
— | — | @@ -85,7 +85,7 @@ |
86 | 86 | var mvTitle = \''.htmlspecialchars($this->article->mvTitle->getWikiTitle()).'\'; |
87 | 87 | var mvTracks = \''.htmlspecialchars($this->components['MV_Overlay']->getMVDReqString()). '\'; |
88 | 88 | var mvgScriptPath = \''.htmlspecialchars($mvgScriptPath).'\'; |
89 | | - /*]]>*/</script>\n'); |
| 89 | + /*]]>*/</script>'); |
90 | 90 | |
91 | 91 | //also add prev next paging |
92 | 92 | $this->page_header ='<h1 class="videoHeader">'. |
Index: branches/MetavidWiki-exp/MetavidWiki/includes/MV_MetavidInterface/MV_Overlay.php |
— | — | @@ -154,7 +154,7 @@ |
155 | 155 | }else{ |
156 | 156 | $wgOut->addHTML($content); |
157 | 157 | } |
158 | | - $wgOut->addHTML("</div>\n"); |
| 158 | + $wgOut->addHTML("</div>"); |
159 | 159 | $wgOut->addHTML("</fieldset>"); |
160 | 160 | } |
161 | 161 | function get_tl_mvd_request($titleKey, $mvd_id){ |
Index: branches/MetavidWiki-exp/MetavidWiki/includes/MV_MetavidInterface/MV_EditPageAjax.php |
— | — | @@ -80,7 +80,7 @@ |
81 | 81 | //output the person selector: |
82 | 82 | if (!isset ($semantic_data['spoken_by']))$semantic_data['spoken_by'] = ''; |
83 | 83 | $img = mv_get_person_img($semantic_data['spoken_by']); |
84 | | - $wgOut->addHTML('<img id=\"mv_edit_im_'.htmlspecialchars($this->mvd_id).'" style="display: block;margin-left: auto;margin-right: auto;" src="'.htmlspecialchars($img->getURL()).'" width="44">'); |
| 84 | + $wgOut->addHTML('<img id="mv_edit_im_'.htmlspecialchars($this->mvd_id).'" style="display: block;margin-left: auto;margin-right: auto;" src="'.htmlspecialchars($img->getURL()).'" width="44">'); |
85 | 85 | $wgOut->addHTML('<input style="font-size:x-small" |
86 | 86 | value="'.htmlspecialchars($semantic_data['spoken_by']).'" |
87 | 87 | name="smw_Spoken_By" |
Index: branches/MetavidWiki-exp/MetavidWiki/skins/mv_embed/mv_embed.js |
— | — | @@ -417,6 +417,7 @@ |
418 | 418 | }, |
419 | 419 | clientSupports: { 'thumbnail' : true }, |
420 | 420 | detect: function() { |
| 421 | + js_log("running detect"); |
421 | 422 | this.players = new mediaPlayers(); |
422 | 423 | |
423 | 424 | // First some browser detection |
— | — | @@ -1730,16 +1731,18 @@ |
1731 | 1732 | if(quick_switch){ |
1732 | 1733 | $j('#img_thumb_'+this.id).attr('src', src); |
1733 | 1734 | }else{ |
| 1735 | + var _this = this; |
1734 | 1736 | if(this.thumbnail_disp){ |
1735 | 1737 | $j('#dc_'+this.id).append('<img src="'+src+'" ' + |
1736 | 1738 | 'style="display:none;position:absolute;zindex:2;top:0px;left:0px;" ' + |
1737 | 1739 | 'width="'+this.width+'" height="'+this.height+'" '+ |
1738 | 1740 | 'id = "new_img_thumb_'+this.id+'" />'); |
1739 | 1741 | $j('#new_img_thumb_'+this.id).fadeIn("slow", function(){ |
| 1742 | + js_log('done fading in: '+src); |
1740 | 1743 | //once faded in remove org and rename new: |
1741 | | - $j('#img_thumb_'+this.id).remove(); |
1742 | | - $j('#new_img_thumb_'+this.id).attr('id', 'img_thumb_'+this.id); |
1743 | | - $j('#img_thumb_'+this.id).css('zIndex','1'); |
| 1744 | + $j('#img_thumb_'+_this.id).remove(); |
| 1745 | + $j('#new_img_thumb_'+_this.id).attr('id', 'img_thumb_'+_this.id); |
| 1746 | + $j('#img_thumb_'+_this.id).css('zindex','1'); |
1744 | 1747 | }); |
1745 | 1748 | } |
1746 | 1749 | } |
— | — | @@ -2458,7 +2461,14 @@ |
2459 | 2462 | function loadExternalJs(url){ |
2460 | 2463 | js_log('load js: '+ url); |
2461 | 2464 | if(window['$j']) |
2462 | | - $j.getScript(url); |
| 2465 | + //have to use direct ajax call insted of $j.getScript() |
| 2466 | + //since you can't send "cache" option to $j.getScript() |
| 2467 | + $j.ajax({ |
| 2468 | + type: "GET", |
| 2469 | + url: url, |
| 2470 | + dataType: 'script', |
| 2471 | + cache: true |
| 2472 | + }); |
2463 | 2473 | else |
2464 | 2474 | { |
2465 | 2475 | var e = document.createElement("script"); |
Index: branches/MetavidWiki-exp/MetavidWiki/util/MV_OggSplit.php |
— | — | @@ -1,4 +1,5 @@ |
2 | 2 | <?php |
| 3 | + if ( !defined( 'MEDIAWIKI' ) ) die( 1 ); |
3 | 4 | /** |
4 | 5 | * MV_OggSplit.php |
5 | 6 | * |