assign('gotMenu',$gotMenu); $smarty->assign('gotTree',$gotTree); $smarty->assign('gotBlock',$gotBlock); $smarty->assign('gotNewsWorld',$gotNewsWorld); if($id!=''){ $gotCont=sql_query('SELECT cid, name_'.$_SESSION['lang'].', txt_'.$_SESSION['lang'].', created, views_total, sort_type, url_name, views_today FROM '.$dbprefix.'audio WHERE status=1 AND url_name="'.$id.'"',0); if($gotCont[0]<1) header('Location: '.$defServerName.'mp3/'); $smarty->assign('gotCont',$gotCont); $sorttype=explode('_', $gotCont[5]); switch ($sorttype[0]){ case 'title': $order="name_".$_SESSION['lang'].' '.$sorttype[1]; break; case 'date': $order="created".' '.$sorttype[1]; break; case 'custom': $order="custom_sort".' '.$sorttype[1]; break; default: $order="name_".$_SESSION['lang'].' ASC'; } $gotSub=sql_query('SELECT cid, name_'.$_SESSION['lang'].', txt_'.$_SESSION['lang'].', created, views_total, url_name FROM '.$dbprefix.'audio WHERE status=1 AND parentid="'.$gotCont[0].'" ORDER by '.$order,1); $smarty->assign('gotSub',$gotSub); $parID=$gotCont[0]; while($parID!=0){ $gotParent=sql_query('SELECT cid, name_'.$_SESSION['lang'].', parentid, url_name FROM '.$dbprefix.'audio WHERE status=1 AND cid="'.$parID.'"',0); $gotPath[]=array($gotParent[0], $gotParent[1], $gotParent[2], $gotParent[3]); $parID=$gotParent[2]; } unset($gotPath[0]); if(count($gotPath)) krsort($gotPath); $smarty->assign('gotPath',$gotPath); } else{ $gotSub=sql_query('SELECT cid, name_'.$_SESSION['lang'].', txt_'.$_SESSION['lang'].', created, views_total, url_name FROM '.$dbprefix.'audio WHERE status=1 AND parentid=0 ORDER by name_'.$_SESSION['lang'],1); $smarty->assign('gotSub',$gotSub); } $smarty->assign('gotNews',$gotNews); $smarty->assign('gotPubl',$gotPubl); $smarty->assign('gotLastPath',$gotLastPath); ### GET NEWSTYPE $smarty->assign('gotNewsType',$gotNewsType); $smarty->assign('gotNewsTypeCnt',count($gotNewsType)); foreach ($genLang as $key=>$val){ $smarty->assign($key,$val); } if(isset($_COOKIE['audio_visit']) && $_COOKIE['audio_visit']==$gotCont[0]) $old_visiter=true; else { setcookie("audio_visit", $gotCont[0], time()+2592000); $old_visiter=false; if($_COOKIE['audio_visit']=$gotCont[0]) $old_visiter=false; else $old_visiter=true; } if((int)$gotCont[0]>0){ $index=$values=array(); if($old_visiter==false) {$index[]='views_total'; $values[]=$viewsTotal=$gotCont[4]+1;} else $viewsTotal=$gotCont[4]; if($old_visiter==false) $rez=sql_update($dbprefix.'audio','WHERE cid="'.$gotCont[0].'"',$index,$values); list($getTodayDate)=sql_query('SELECT value FROM '.$dbprefix.'settings WHERE vname="current_date"',0); if($getTodayDate==date("Y-m-d")){ $index=$values=array(); $index[]='views_today'; $values[]=$gotCont[6]+1; $rez=sql_update($dbprefix.'audio','WHERE cid="'.$gotCont[0].'"',$index,$values); } else{ $index=$values=array(); $index[]='views_today'; $values[]=0; $rez=sql_update($dbprefix.'audio','WHERE 1',$index,$values); $index=$values=array(); $index[]='views_today'; $values[]=0; $rez=sql_update($dbprefix.'categories','WHERE 1',$index,$values); $index=$values=array(); $index[]='visited_today'; $values[]=0; $rez=sql_update($dbprefix.'news','WHERE 1',$index,$values); $index=$values=array(); $index[]='visited_today'; $values[]=0; $rez=sql_update($dbprefix.'newsworld','WHERE 1',$index,$values); $index=$values=array(); $index[]='views_today'; $values[]=0; $rez=sql_update($dbprefix.'gallery_cat','WHERE 1',$index,$values); $index=$values=array(); $index[]='value'; $values[]=date("Y-m-d"); $rez=sql_update($dbprefix.'settings','WHERE vname="current_date"',$index,$values); } } $smarty->assign('viewsTotal',$viewsTotal); if($gotCont[6]=='volkoslavski_tolkovanieotrovenia01') $mp3name=$defServerName.'files/file/'.$gotCont[6].'.mp3'; elseif($gotCont[6]=='volkoslavski_tolkovanieotrovenia02') $mp3name=$defServerName.'files/file/'.$gotCont[6].'.mp3'; elseif($gotCont[6]=='volkoslavski_tolkovanieotrovenia03') $mp3name=$defServerName.'files/file/'.$gotCont[6].'.mp3'; elseif($gotCont[6]=='volkoslavski_tolkovanieotrovenia04a') $mp3name=$defServerName.'files/file/'.$gotCont[6].'.mp3'; elseif($gotCont[6]=='volkoslavski_tolkovanieotrovenia04b') $mp3name=$defServerName.'files/file/'.$gotCont[6].'.mp3'; else $mp3name='http://media.adventist.org.ua/mp3/'.$gotCont[6].'.mp3'; $smarty->assign('mp3name',$mp3name); $tpl = $smarty->fetch($file_tpl.'.tpl'); print $tpl; ?>