';
echo '';
$characters_to_remove = array('&', "'", '"', '>', '<', '-', ',', '/');
$replace_with = array('&', ''', '"', '>', '<', '', '', '');
// Modified SQL to include keywords/tags field
$sql = "SELECT VID, title, description, thumb, duration, keywords FROM video WHERE active = '1' ORDER BY addtime DESC LIMIT 20000";
$rs = $conn->execute($sql);
$videos = $rs->getrows();
foreach ($videos as $video) {
$title = str_replace($characters_to_remove, $replace_with, $video['title']);
$description = str_replace($characters_to_remove, $replace_with, strip_tags($video['description']));
$VID = $video['VID'];
$thumbnail = get_thumb_url($VID) . '/' . htmlspecialchars($video['thumb']) . '.jpg';
$duration = round($video['duration']);
if (empty($description)) {
$description = strip_tags($title);
}
// Process keywords/tags
$keywords = '';
if (!empty($video['keywords'])) {
// Split keywords by comma and clean them
$keyword_array = explode(',', $video['keywords']);
$clean_keywords = array();
foreach ($keyword_array as $keyword) {
$keyword = trim($keyword);
if (!empty($keyword)) {
// Clean keyword for XML
$keyword = str_replace($characters_to_remove, $replace_with, $keyword);
$clean_keywords[] = $keyword;
}
}
$keywords = $clean_keywords;
}
?> ]]> ]]> ]]> ';
?>
Share