| Server IP : 172.67.201.108 / Your IP : 216.73.217.139 Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5 System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/banners/public_html/bway/oldfeeds/ |
Upload File : |
<?php
// One-time fix: backfill empty thumbnails using the video ID
require_once __DIR__ . '/mysql_tls.php';
$linkWrite = oldfeeds_mysqli_connect('amazonaurora.cluster-cemzxojvmybt.us-east-1.rds.amazonaws.com', 'admin', 'xxatN6Lb8Kbwb9MiU1At');
mysqli_select_db($linkWrite, 'amazonrds');
$q = "SELECT videoid, title FROM feedmastervideo WHERE (thumbnail IS NULL OR thumbnail = '') AND videoid LIKE 'yt:video:%'";
$r = mysqli_query($linkWrite, $q);
$count = 0;
if ($r) {
while ($row = mysqli_fetch_assoc($r)) {
if (preg_match('/yt:video:([a-zA-Z0-9_-]+)/', $row['videoid'], $m)) {
$thumb = 'https://i3.ytimg.com/vi/' . $m[1] . '/hqdefault.jpg';
$uq = "UPDATE feedmastervideo SET thumbnail = '" . mysqli_real_escape_string($linkWrite, $thumb) . "' WHERE videoid = '" . mysqli_real_escape_string($linkWrite, $row['videoid']) . "'";
mysqli_query($linkWrite, $uq);
echo "[FIXED] " . htmlspecialchars($row['title']) . " → " . htmlspecialchars($thumb) . "<br>\n";
$count++;
}
}
}
echo "<br><b>Fixed $count records.</b>";
mysqli_close($linkWrite);
?>