Files
MeDBia/videodb/contrib/decode_entities.php
Malin f55c91276e feat: add videodb media index with Docker stack
- Add videodb PHP/MySQL media collection manager (Blu-ray, DVD, CD)
- Dockerfile: PHP 8.1 + Apache with GD/mysqli/exif extensions
- docker-compose.yml: app on port 6761 + MySQL 8.0 with health checks
- docker-entrypoint.sh: auto-generates config.inc.php from env vars,
  waits for MySQL, initializes DB schema idempotently
- init-db.php: CLI schema installer using app's own prefix_query() logic
- Persistent volumes for DB, cache, and cover images

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 09:49:52 +02:00

103 lines
1.9 KiB
PHP

<?php
/**
* Convert HTML entities to plain text
*
* @package Contrib
* @author Andreas Goetz <cpuidle@gmx.de>
* @version $Id: decode_entities.php,v 1.6 2008/01/23 09:06:25 andig2 Exp $
* @meta ACCESS:PERM_ADMIN
*/
// move out of contrib for includes
chdir('..');
require_once './core/functions.php';
require_once './engines/engines.php';
?>
<html>
<head>
<title>Decode HTML Entities</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="VideoDB" />
<!--
<link rel="stylesheet" href="../templates/modern/compact.css" type="text/css" />
-->
<style>
.green { color:green }
</style>
</head>
<body>
<?
error_reporting(E_ALL ^ E_NOTICE);
if (!$submit) echo "<h2>Warning- be sure to backup your data before submitting the cleanup request!</h2>";
$SQL = 'SELECT * FROM '.TBL_DATA;
$result = runSQL($SQL);
$count = 0;
foreach ($result as $video)
{
$SQL = '';
$keys = array();
foreach ($video as $key => $value)
{
if ($key == 'id') continue;
$new = html_clean_utf8($value);
if ($new != $value)
{
$keys[] = $key;
if ($SQL) $SQL .= ', ';
$SQL .= "$key = '".escapeSQL($new)."'";
}
}
if ($SQL)
{
$count++;
echo (($submit) ? 'Converting: ' : '<b>Conversion needed:</b> ').$video['title']."<br/>\n";
// actually perform the conversion?
if ($submit)
{
$SQL = "UPDATE ".TBL_DATA." SET $SQL WHERE id = ".$video['id'];
runSQL($SQL);
}
else
{
foreach($keys as $key)
{
echo $key.': '.htmlentities($video[$key])."<br/>\n";
}
echo "<br/>\n";
}
}
}
$action = ($submit) ? 'Converted' : 'Analyzed';
echo "$action $count of ".count($result)." movies.<br/>\n";
if (empty($submit))
{
?>
<form action="<?php echo $_SERVER['PHP_SELF']?>">
<input type="submit" name="submit" value="Convert" />
</form>
<?
}
?>
</body>
</html>