session_start();
if (!ini_get('register_globals')) {
$superglobals = array($_SERVER, $_ENV,
$_FILES, $_COOKIE, $_POST, $_GET);
if (isset($_SESSION)) {
array_unshift($superglobals, $_SESSION);
}
foreach ($superglobals as $superglobal) {
extract($superglobal, EXTR_SKIP);
}
}
include "controle/conecta.php";
include "funcoes.php";
$TITULO_SITE = "CBO TV";
$diasemana[0] = "Domingo";
$diasemana[1] = "Segunda-feira";
$diasemana[2] = "Terça-feira";
$diasemana[3] = "Quarta-feira";
$diasemana[4] = "Quinta-feira";
$diasemana[5] = "Sexta-feira";
$diasemana[6] = "Sábado";
$mesnome[01] = "janeiro";
$mesnome[02] = "fevereiro";
$mesnome[03] = "março";
$mesnome[04] = "abril";
$mesnome[05] = "maio";
$mesnome[06] = "junho";
$mesnome[07] = "julho";
$mesnome[08] = "agosto";
$mesnome[09] = "setembro";
$mesnome[10] = "outubro";
$mesnome[11] = "novembro";
$mesnome[12] = "dezembro";
$ano = @date('Y');
$mes = @date('n');
$mes2 = @date('n')+1;
$dia = @date('d');
$diasem = @date('w');
$hora = @getdate();
$horacerta=($hora['hours'].':'.$hora['minutes'].':'.$hora['seconds']);
$data = $dia.'/'.$mes.'/'.$ano;
?>
if($_GET[categoria]){
$sql = mysql_query("SELECT * FROM sis_videos WHERE status='1' AND categoria = '$_GET[categoria]' ORDER BY id DESC LIMIT 1");
}
if($_GET[video_id]){
$sql = mysql_query("SELECT * FROM sis_videos WHERE status='1' AND id = '$_GET[video_id])' ORDER BY id LIMIT 1");
}
if(($_GET[categoria] == '') AND ($_GET[video_id] == '')){
$sql = mysql_query("SELECT * FROM sis_videos WHERE status='1' ORDER BY id DESC LIMIT 1");
}
if(mysql_num_rows($sql) > 0){
$v1 = mysql_fetch_array($sql);
$var=$v1[video];
$url = str_replace("https://www.youtube.com/watch?v=", "", $var);
$video = str_replace("https://www.youtube.com/watch?v=", "", $var);
$video = str_replace("http://www.youtube.com/watch?v=", "", $video);
$url = explode('&',$url);
$video = explode('&',$video);
$video_final = $video[0];
$video_final = 'https://www.youtube.com/embed/' . $video_final . '';
$url = 'http://i1.ytimg.com/vi/' . $video[0] . '/0.jpg';
$sql_cat = mysql_query("SELECT * FROM sis_categorias WHERE id_cat = '$v1[categoria]' AND st_cat='1' ");
$c1 = mysql_fetch_array($sql_cat);
$string = $v1[resumo];
$limitara=200;
?>