(GPLv2)
or write to the Free Software Foundation, Inc., 51 Franklin Street,
Fifth Floor, Boston, MA02110-1301, USA.
********************************************************************************/
if (stristr(htmlentities($_SERVER['PHP_SELF']), "block_youtube.php")) {
die("
Error: This file cannot be opened directly! |
");
}
global $dblink;
$ytconfig = getConfigbl($dblink->get_list("SELECT * FROM memht_youtube_config"));
//Random
if ($result = $dblink->get_list("SELECT id,title,videoid FROM memht_youtube_videos WHERE enabled=1 ORDER BY RAND() LIMIT 3")) {
foreach ($result as $row) {
$id = intval($row['id']);
$vtitle = outCode($row['title']);
$videoid = outCode($row['videoid']);
$thumbnail = str_replace("{{VIDEOID}}",$videoid,outCode($ytconfig['thumbnail']));
$thumbnail = "
";
echo "";
}
}
function getConfigbl($result) {
$config = array();
foreach ($result as $row) {
$config[$row['key']] = $row['value'];
}
return $config;
}
?>