parsing error on systems with short_open_tag = Off
[phpmyadmin/crack.git] / libraries / blobstreaming.lib.php
blob65526afa27e95413311058859611aaecbfc1cb4c
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * @author Raj Kissu Rajandran and the team
5 * @package BLOBStreaming
6 */
8 /**
9 * checks whether the necessary plugins for BLOBStreaming exist
11 * @access public
12 * @uses PMA_Config::get()
13 * @uses PMA_Config::settings()
14 * @uses PMA_Config::set()
15 * @uses PMA_BS_SetVariables()
16 * @uses PMA_BS_GetVariables()
17 * @uses PMA_BS_SetFieldReferences()
18 * @return boolean
20 function checkBLOBStreamingPlugins()
22 // load PMA configuration
23 $PMA_Config = $_SESSION['PMA_Config'];
25 // return if unable to load PMA configuration
26 if (empty($PMA_Config))
27 return FALSE;
29 /** Retrieve current server configuration;
30 * at this point, $PMA_Config->get('Servers') contains the server parameters
31 * as explicitely defined in config.inc.php, so it cannot be used; it's
32 * better to use $GLOBALS['cfg']['Server'] which contains the explicit
33 * parameters merged with the default ones
36 $serverCfg = $GLOBALS['cfg']['Server'];
38 // return if unable to retrieve current server configuration
39 if (! $serverCfg) {
40 return FALSE;
43 // if PHP extension in use is 'mysql', specify element 'PersistentConnections'
44 if ($serverCfg['extension'] == "mysql") {
45 $serverCfg['PersistentConnections'] = $PMA_Config->settings['PersistentConnections'];
48 // if connection type is TCP, unload socket variable
49 if (strtolower($serverCfg['connect_type']) == "tcp") {
50 $serverCfg['socket'] = "";
53 $allPluginsExist = false;
54 if (PMA_MYSQL_INT_VERSION >= 50109) {
55 $PMA_Config->set('PBXT_NAME', 'pbxt');
56 $PMA_Config->set('PBMS_NAME', 'pbms');
58 $required_plugins[$PMA_Config->get('PBXT_NAME')]['Library'] = 'libpbxt.so';
59 $required_plugins[$PMA_Config->get('PBMS_NAME')]['Library'] = 'libpbms.so';
60 $number_of_required_plugins_found = 0;
62 // Retrieve MySQL plugins
63 $existing_plugins = PMA_DBI_fetch_result('SHOW PLUGINS');
65 foreach ($existing_plugins as $one_existing_plugin) {
66 // check if required plugins exist
67 foreach ($required_plugins as $one_required_plugin) {
68 if ( strtolower($one_existing_plugin['Library']) == strtolower($one_required_plugin['Library'])
69 && $one_existing_plugin['Status'] == "ACTIVE") {
70 $number_of_required_plugins_found++;
73 if (2 == $number_of_required_plugins_found) {
74 $allPluginsExist = true;
75 break;
78 unset($required_plugins, $existing_plugins, $one_required_plugin, $one_existing_plugin, $number_of_required_plugins_found);
81 // set variable indicating BS plugin existence
82 $PMA_Config->set('BLOBSTREAMING_PLUGINS_EXIST', $allPluginsExist);
84 // do the plugins exist?
85 if ($allPluginsExist)
87 // retrieve BS variables from PMA configuration
88 $bs_set_variables = array();
90 $bs_set_variables[$PMA_Config->get('PBMS_NAME') . '_garbage_threshold'] = (isset($serverCfg['bs_garbage_threshold'])) ? $serverCfg['bs_garbage_threshold'] : NULL;
91 $bs_set_variables[$PMA_Config->get('PBMS_NAME') . '_repository_threshold'] = (isset($serverCfg['bs_repository_threshold'])) ? $serverCfg['bs_repository_threshold'] : NULL;
92 $bs_set_variables[$PMA_Config->get('PBMS_NAME') . '_temp_blob_timeout'] = (isset($serverCfg['bs_temp_blob_timeout'])) ? $serverCfg['bs_temp_blob_timeout'] : NULL;
93 $bs_set_variables[$PMA_Config->get('PBMS_NAME') . '_temp_log_threshold'] = (isset($serverCfg['bs_temp_log_threshold'])) ? $serverCfg['bs_temp_log_threshold'] : NULL;
95 // set BS variables to PMA configuration defaults
96 PMA_BS_SetVariables($bs_set_variables);
98 // retrieve updated BS variables (configurable and unconfigurable)
99 $bs_variables = PMA_BS_GetVariables();
101 // if no BS variables exist, set plugin existence to false and return
102 if (count($bs_variables) <= 0)
104 $PMA_Config->set('BLOBSTREAMING_PLUGINS_EXIST', FALSE);
105 return FALSE;
106 } // end if (count($bs_variables) <= 0)
108 // switch on BS field references
109 if (strtolower($bs_variables[$PMA_Config->get('PBMS_NAME') . '_field_references']) == "off")
110 if(!PMA_BS_SetFieldReferences('ON'))
111 return FALSE;
113 // get BS server port
114 $BS_PORT = $bs_variables[$PMA_Config->get('PBMS_NAME') . '_port'];
116 // if no BS server port exists, set plugin existance to false and return
117 if (!$BS_PORT)
119 $PMA_Config->set('BLOBSTREAMING_PLUGINS_EXIST', FALSE);
120 return FALSE;
121 } // end if (!$BS_PORT)
123 // add selected BS, CURL and fileinfo library variables to PMA configuration
124 $PMA_Config->set('BLOBSTREAMING_PORT', $BS_PORT);
125 $PMA_Config->set('BLOBSTREAMING_HOST', $serverCfg['host']);
126 $PMA_Config->set('BLOBSTREAMING_SERVER', $serverCfg['host'] . ':' . $BS_PORT);
127 $PMA_Config->set('CURL_EXISTS', FALSE);
128 $PMA_Config->set('FILEINFO_EXISTS', FALSE);
130 // check if CURL exists
131 if (function_exists("curl_init"))
133 // initialize curl handler
134 $curlHnd = curl_init();
136 // CURL exists, set necessary variable and close resource
137 if (!empty($curlHnd))
139 $PMA_Config->set('CURL_EXISTS', TRUE);
140 curl_close($curlHnd);
141 } // end if (!empty($curlHnd))
142 } // end if (function_exists("curl_init"))
144 // check if PECL's fileinfo library exist
145 $finfo = NULL;
147 if (function_exists("finfo_open"))
148 $finfo = finfo_open(FILEINFO_MIME);
150 // fileinfo library exists, set necessary variable and close resource
151 if (!empty($finfo))
153 $PMA_Config->set('FILEINFO_EXISTS', TRUE);
154 finfo_close($finfo);
155 } // end if (!empty($finfo))
156 } // end if ($allPluginsExist)
157 else
158 return FALSE;
160 $bs_tables = array();
162 // specify table structure for BS reference table
163 $bs_tables[$PMA_Config->get('PBMS_NAME') . '_reference'] = array();
164 $bs_tables[$PMA_Config->get('PBMS_NAME') . '_reference']['struct'] = <<<EOD
165 CREATE TABLE {$PMA_Config->get('PBMS_NAME')}_reference
167 Table_name CHAR(64) COMMENT 'The name of the referencing table',
168 Blob_id BIGINT COMMENT 'The BLOB reference number - part of the BLOB URL',
169 Column_name CHAR(64) COMMENT 'The column name of the referencing field',
170 Row_condition VARCHAR(255) COMMENT 'This condition identifies the row in the table',
171 Blob_url VARCHAR(200) COMMENT 'The BLOB URL for HTTP GET access',
172 Repository_id INT COMMENT 'The repository file number of the BLOB',
173 Repo_blob_offset BIGINT COMMENT 'The offset in the repository file',
174 Blob_size BIGINT COMMENT 'The size of the BLOB in bytes',
175 Deletion_time TIMESTAMP COMMENT 'The time the BLOB was deleted',
176 Remove_in INT COMMENT 'The number of seconds before the reference/BLOB is removed perminently',
177 Temp_log_id INT COMMENT 'Temporary log number of the referencing deletion entry',
178 Temp_log_offset BIGINT COMMENT 'Temporary log offset of the referencing deletion entry'
179 ) ENGINE=PBMS;
180 EOD;
182 // specify table structure for BS repository table
183 $bs_tables[$PMA_Config->get('PBMS_NAME') . '_repository'] = array();
184 $bs_tables[$PMA_Config->get('PBMS_NAME') . '_repository']['struct'] = <<<EOD
185 CREATE TABLE {$PMA_Config->get('PBMS_NAME')}_repository
187 Repository_id INT COMMENT 'The repository file number',
188 Repo_blob_offset BIGINT COMMENT 'The offset of the BLOB in the repository file',
189 Blob_size BIGINT COMMENT 'The size of the BLOB in bytes',
190 Head_size SMALLINT UNSIGNED COMMENT 'The size of the BLOB header - proceeds the BLOB data',
191 Access_code INT COMMENT 'The 4-byte authorisation code required to access the BLOB - part of the BLOB URL',
192 Creation_time TIMESTAMP COMMENT 'The time the BLOB was created',
193 Last_ref_time TIMESTAMP COMMENT 'The last time the BLOB was referenced',
194 Last_access_time TIMESTAMP COMMENT 'The last time the BLOB was accessed (read)',
195 Content_type CHAR(128) COMMENT 'The content type of the BLOB - returned by HTTP GET calls',
196 Blob_data LONGBLOB COMMENT 'The data of this BLOB'
197 ) ENGINE=PBMS;
198 EOD;
200 // specify table structure for BS custom content type table
201 $bs_tables[$PMA_Config->get('PBMS_NAME') . '_custom_content_type'] = array();
202 $bs_tables[$PMA_Config->get('PBMS_NAME') . '_custom_content_type']['struct'] = <<<EOD
203 CREATE TABLE {$PMA_Config->get('PBMS_NAME')}_custom_content_type
205 Blob_url VARCHAR(200) COMMENT 'The BLOB URL for HTTP GET access',
206 Content_type VARCHAR(255) COMMENT 'The custom MIME type for a given BLOB reference as specified by the user',
208 PRIMARY KEY(Blob_url)
210 EOD;
212 // add BS tables to PMA configuration
213 $PMA_Config->set('BLOBSTREAMING_TABLES', $bs_tables);
215 return TRUE;
219 * checks for databases that support BLOBStreaming
221 * @access public
222 * @uses PMA_GetDatabases()
223 * @uses PMA_TablesExist()
224 * @uses PMA_Config::set()
226 function checkBLOBStreamableDatabases()
228 // load PMA configuration
229 $PMA_Config = $_SESSION['PMA_Config'];
231 // return if unable to load PMA configuration
232 if (empty($PMA_Config))
233 return;
235 // retrieve BS tables from PMA configuration
236 $session_bs_tables = $PMA_Config->get('BLOBSTREAMING_TABLES');
238 $bs_databases = array();
239 $bs_tables = array();
241 // return if BS tables do not exist
242 if (!$session_bs_tables)
243 return;
245 foreach ($session_bs_tables as $table_key=>$table)
247 $bs_tables[$table_key] = array();
248 $bs_tables[$table_key]['Exists'] = FALSE;
251 // retrieve MySQL databases
252 $databases = PMA_GetDatabases();
254 // check if BS tables exist for each database
255 foreach ($databases as $db_key=>$db_name)
257 $bs_databases[$db_name] = $bs_tables;
259 PMA_TablesExist($bs_databases[$db_name], $db_name);
262 // set BS databases in PMA configuration
263 $PMA_Config->set('BLOBSTREAMABLE_DATABASES', $bs_databases);
269 * checks whether a given set of tables exist in a given database
271 * @access public
272 * @param array - list of tables to look for
273 * @param string - name of database
274 * @uses PMA_DBI_select_db()
275 * @uses PMA_DBI_query()
276 * @uses PMA_DBI_fetch_assoc()
278 function PMA_TablesExist(&$tables, $db_name)
280 // select specified database
281 PMA_DBI_select_db($db_name);
283 // run query to retrieve tables in specified database
284 $query = "SHOW TABLES";
285 $result = PMA_DBI_query($query);
287 // while there are records to parse
288 while ($data = @PMA_DBI_fetch_assoc($result))
290 $state = TRUE;
292 // check if necessary tables exist
293 foreach ($tables as $table_key=>$table)
294 if (!$table['Exists'])
295 if ($data['Tables_in_' . $db_name] == $table_key)
296 $tables[$table_key]['Exists'] = TRUE;
297 else
298 if ($state)
299 $state = FALSE;
301 // break if necessary tables are found before all records are parsed
302 if ($state)
303 break;
304 } // end while ($data = @PMA_DBI_fetch_assoc($result))
308 * returns a list of databases
310 * @access public
311 * @uses PMA_DBI_query()
312 * @uses PMA_DBI_fetch_assoc()
313 * @return array - list of databases acquired via MySQL
315 function PMA_GetDatabases()
317 // run query to retrieve databases
318 $query = "SHOW DATABASES";
319 $result = PMA_DBI_query($query);
321 $databases = array();
323 // while there are records to parse
324 while ($data = @PMA_DBI_fetch_assoc($result))
325 $databases[] = $data['Database'];
327 // return list of databases
328 return $databases;
332 * sets BLOBStreaming variables to a list of specified arguments
333 * @access public
334 * @uses PMA_DBI_query()
335 * @returns boolean - success of variables setup
338 function PMA_BS_SetVariables($bs_variables)
340 // if no variables exist in array, return false
341 if (empty($bs_variables) || count($bs_variables) == 0)
342 return FALSE;
344 // set BS variables to those specified in array
345 foreach ($bs_variables as $key=>$val)
346 if (!is_null($val) && strlen($val) > 0)
348 // set BS variable to specified value
349 $query = "SET GLOBAL $key=" . PMA_sqlAddSlashes($val);
350 $result = PMA_DBI_query($query);
352 // if query fails execution, return false
353 if (!$result)
354 return FALSE;
355 } // end if (!is_null($val) && strlen($val) > 0)
357 // return true on success
358 return TRUE;
362 * returns a list of BLOBStreaming variables used by MySQL
364 * @access public
365 * @uses PMA_Config::get()
366 * @uses PMA_DBI_query()
367 * @uses PMA_DBI_fetch_assoc()
368 * @return array - list of BLOBStreaming variables
370 function PMA_BS_GetVariables()
372 // load PMA configuration
373 $PMA_Config = $_SESSION['PMA_Config'];
375 // return if unable to load PMA configuration
376 if (empty($PMA_Config))
377 return NULL;
379 // run query to retrieve BS variables
380 $query = "SHOW VARIABLES LIKE '%" . $PMA_Config->get('PBMS_NAME') . "%'";
381 $result = PMA_DBI_query($query);
383 $BS_Variables = array();
385 // while there are records to retrieve
386 while ($data = @PMA_DBI_fetch_assoc($result))
387 $BS_Variables[$data['Variable_name']] = $data['Value'];
389 // return BS variables
390 return $BS_Variables;
394 * sets the BLOBStreaming global field references to ON/OFF
396 * @access public
397 * @param string - ON or OFF
398 * @uses PMA_Config::get()
399 * @uses PMA_sqlAddslashes()
400 * @uses PMA_DBI_query()
401 * @return boolean - success/failure of query execution
403 function PMA_BS_SetFieldReferences($val)
405 // load PMA configuration
406 $PMA_Config = $_SESSION['PMA_Config'];
408 // return if unable to load PMA configuration
409 if (empty($PMA_Config))
410 return FALSE;
412 // set field references to value specified
413 $query = "SET GLOBAL " . $PMA_Config->get('PBMS_NAME') . "_field_references=" . PMA_sqlAddslashes($val);
414 $result = PMA_DBI_try_query($query, null, 0);
416 // get last known error (if applicable)
417 PMA_DBI_getError();
419 // return success of query execution
420 if ($result && 0 == $GLOBALS['errno'])
421 return TRUE;
422 else
423 return FALSE;
427 * gets the SQL table definition for a given BLOBStreaming table
429 * @access public
430 * @param string - table name
431 * @uses PMA_Config::get()
432 * @return string - SQL table definition
434 function PMA_BS_GetTableStruct($tbl_name)
436 // retrieve table structures for BS tables
437 $bs_tables = $_SESSION['PMA_Config']->get('BLOBSTREAMING_TABLES');
439 // return if tables don't exist
440 if (!$bs_tables)
441 return;
443 // return if specified table doesn't exist in collection of BS tables
444 if (!isset($bs_tables[$tbl_name]))
445 return;
447 // return specified table's structure
448 return $bs_tables[$tbl_name]['struct'];
452 * creates the BLOBStreaming tables for a given database
454 * @access public
455 * @param string - database name
456 * @uses PMA_Config::get()
457 * @uses PMA_DBI_select_db()
458 * @uses PMA_DBI_query()
459 * @uses PMA_BS_GetTableStruct()
460 * @return boolean - success/failure of transactional query execution
462 function PMA_BS_CreateTables($db_name)
464 // retrieve BS tables
465 $bs_tables = $_SESSION['PMA_Config']->get('BLOBSTREAMING_TABLES');
467 // select specified database
468 PMA_DBI_select_db($db_name);
470 // create necessary BS tables for specified database
471 foreach ($bs_tables as $table_key=>$table)
473 $result = PMA_DBI_query(PMA_BS_GetTableStruct($table_key));
475 // return false if query execution fails
476 if (!$result)
477 return FALSE;
480 // return true on success
481 return TRUE;
485 * drops BLOBStreaming tables for a given database
487 * @access public
488 * @param string - database name
489 * @uses PMA_Config::get()
490 * @uses PMA_DBI_select_db()
491 * @uses PMA_backquote()
492 * @uses PMA_DBI_query()
493 * @return boolean - success/failure of transactional query execution
495 function PMA_BS_DropTables($db_name)
497 // load PMA configuration
498 $PMA_Config = $_SESSION['PMA_Config'];
500 // return if unable to load PMA configuration
501 if (empty($PMA_Config))
502 return FALSE;
504 // retrieve BS tables
505 $bs_tables = $PMA_Config->get('BLOBSTREAMING_TABLES');
507 // select specified database
508 PMA_DBI_select_db($db_name);
510 // drop BS tables
511 foreach ($bs_tables as $table_key=>$table)
513 $query = "DROP TABLE IF EXISTS " . PMA_backquote($table_key);
514 $result = PMA_DBI_query($query);
516 // return false if query execution fails
517 if (!$result)
518 return FALSE;
521 // return true on success
522 return TRUE;
526 * returns the field name for a primary key of a given table in a given database
528 * @access public
529 * @param string - database name
530 * @param string - table name
531 * @uses PMA_DBI_select_db()
532 * @uses PMA_backquote()
533 * @uses PMA_DBI_query()
534 * @uses PMA_DBI_fetch_assoc()
535 * @return string - field name for primary key
537 function PMA_BS_GetPrimaryField($db_name, $tbl_name)
539 // load PMA configuration
540 $PMA_Config = $_SESSION['PMA_Config'];
542 // return if unable to load PMA configuration
543 if (empty($PMA_Config))
544 return FALSE;
546 // select specified database
547 PMA_DBI_select_db($db_name);
549 // retrieve table fields
550 $query = "SHOW FULL FIELDS FROM " . PMA_backquote($tbl_name);
551 $result = PMA_DBI_query($query);
553 // while there are records to parse
554 while ($data = PMA_DBI_fetch_assoc($result))
555 if ("PRI" == $data['Key'])
556 return $data['Field'];
558 // return NULL on no primary key
559 return NULL;
563 * checks whether a BLOB reference exists in the BLOB repository
565 * @access public
566 * @param string - BLOB reference
567 * @param string - database name
568 * @uses PMA_DBI_select_db()
569 * @uses PMA_backquote()
570 * @uses PMA_Config::get()
571 * @uses PMA_sqlAddslashes()
572 * @uses PMA_DBI_query()
573 * @return boolean - existence of BLOB reference
575 function PMA_BS_ReferenceExists($bs_reference, $db_name)
577 $referenceExists = FALSE;
579 // return false on invalid BS reference
580 if (strlen ($bs_reference) < strlen ("~*$db_name/~") || "~*$db_name/~" != substr ($bs_reference, 0, strlen ($db_name) + 4))
581 return $referenceExists;
583 // load PMA configuration
584 $PMA_Config = $_SESSION['PMA_Config'];
586 // return if unable to load PMA configuration
587 if (empty($PMA_Config))
588 return $referenceExists;
590 // select specified database
591 PMA_DBI_select_db($db_name);
593 // run query on BS reference retrieval
594 $query = "SELECT * FROM " . PMA_backquote($PMA_Config->get('PBMS_NAME') . "_reference") . " WHERE Blob_url='" . PMA_sqlAddslashes($bs_reference) . "'";
595 $result = PMA_DBI_query($query);
597 // if record exists
598 if ($data = @PMA_DBI_fetch_assoc($result))
599 $referenceExists = TRUE;
601 // return reference existance
602 return $referenceExists;
606 * creates a HTTP link to a given blob reference for a given database
608 * @access public
609 * @param string - BLOB reference
610 * @param string - database name
611 * @uses PMA_Config::get()
612 * @uses PMA_DBI_select_db()
613 * @uses PMA_backquote()
614 * @uses PMA_sqlAddslashes()
615 * @uses PMA_DBI_query()
616 * @uses PMA_DBI_fetch_assoc()
617 * @return string - HTTP link or Error
619 function PMA_BS_CreateReferenceLink($bs_reference, $db_name)
621 // load PMA configuration
622 $PMA_Config = $_SESSION['PMA_Config'];
624 // return if unable to load PMA configuration
625 if (empty($PMA_Config))
626 return '';
628 // generate bs reference link
629 $bs_ref_link = 'http://' . $PMA_Config->get('BLOBSTREAMING_SERVER') . '/' . $bs_reference;
631 // select specified database
632 PMA_DBI_select_db($db_name);
634 $pbms_repo_bq = PMA_backquote($PMA_Config->get('PBMS_NAME') . "_repository");
635 $pbms_ref_bq = PMA_backquote($PMA_Config->get('PBMS_NAME') . "_reference");
636 $pbms_cust_content_bq = PMA_backquote($PMA_Config->get('PBMS_NAME') . "_custom_content_type");
638 // run query on determining specified BS reference
639 $query = "SELECT $pbms_repo_bq.Content_type, $pbms_cust_content_bq.Content_type AS Custom_type";
640 $query .= " FROM $pbms_repo_bq LEFT JOIN $pbms_ref_bq ON";
641 $query .= "$pbms_repo_bq.Repository_id=$pbms_ref_bq.Repository_id";
642 $query .= " AND $pbms_repo_bq.Blob_size=$pbms_ref_bq.Blob_size";
643 $query .= " AND $pbms_repo_bq.Repo_blob_offset=$pbms_ref_bq.Repo_blob_offset";
644 $query .= " LEFT JOIN $pbms_cust_content_bq ON $pbms_cust_content_bq.Blob_url=$pbms_ref_bq.Blob_url";
645 $query .= " WHERE $pbms_ref_bq.Blob_url='" . PMA_sqlAddslashes($bs_reference) . "'";
647 $result = PMA_DBI_query($query);
649 // if record exists
650 if ($data = @PMA_DBI_fetch_assoc($result))
652 // determine content-type for BS repository file (original or custom)
653 $is_custom_type = false;
655 if (isset($data['Custom_type']))
657 $content_type = $data['Custom_type'];
658 $is_custom_type = true;
660 else
661 $content_type = $data['Content_type'];
663 if (!$content_type)
664 $content_type = NULL;
666 $output = "<a href=\"#\" onclick=\"requestMIMETypeChange('" . urlencode($db_name) . "', '" . urlencode($GLOBALS['table']) . "', '" . urlencode($bs_reference) . "', '" . urlencode($content_type) . "')\">$content_type</a>";
668 // specify custom HTML for various content types
669 switch ($content_type)
671 // no content specified
672 case NULL:
673 $output = "NULL";
674 break;
675 // image content
676 case 'image/jpeg':
677 case 'image/png':
678 $output .= ' (<a href="' . $bs_ref_link . '" target="new">' . $GLOBALS['strViewImage'] . '</a>)';
679 break;
680 // audio content
681 case 'audio/mpeg':
682 $output .= ' (<a href="#" onclick="popupBSMedia(\'' . PMA_generate_common_url() . '\',\'' . urlencode($bs_reference) . '\', \'' . urlencode($content_type) . '\',' . ($is_custom_type ? 1 : 0) . ', 640, 120)">' . $GLOBALS['strPlayAudio']. '</a>)';
683 break;
684 // video content
685 case 'application/x-flash-video':
686 case 'video/mpeg':
687 $output .= ' (<a href="#" onclick="popupBSMedia(\'' . PMA_generate_common_url() . '\',\'' . urlencode($bs_reference) . '\', \'' . urlencode($content_type) . '\',' . ($is_custom_type ? 1 : 0) . ', 640, 480)">' . $GLOBALS['strViewVideo'] . '</a>)';
688 break;
689 // unsupported content. specify download
690 default:
691 $output .= ' (<a href="' . $bs_ref_link . '" target="new">' . $GLOBALS['strDownloadFile']. '</a>)';
694 // return HTML
695 return $output;
696 } // end if ($data = @PMA_DBI_fetch_assoc($result))
698 // return on error
699 return 'Error';