assign('gotMenu',$gotMenu); $smarty->assign('gotTree',$gotTree); $smarty->assign('gotBlock',$gotBlock); 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); $gotCont[2]=str_replace('[pagebreak]', '',$gotCont[2]); $Find = "/\[mediahttp\](.*)\[\/mediahttp\]/i"; // $getDownloadVideo="$1"; // $link2video=preg_match($Find, $getDownloadVideo, $gotCont[2]); $Replace="
Скачать проповедь
"; $gotCont[2] = preg_replace($Find, $Replace, $gotCont[2]); $smarty->assign('gotCont',$gotCont); $smarty->assign('link2video',$link2video); $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['video_visit']) && $_COOKIE['video_visit']==$gotCont[0]) $old_visiter=true; else { setcookie("video_visit", $gotCont[0], time()+2592000); $old_visiter=false; if($_COOKIE['video_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[]='value'; $values[]=date("Y-m-d"); $rez=sql_update($dbprefix.'settings','WHERE vname="current_date"',$index,$values); } } $smarty->assign('viewsTotal',$viewsTotal); // $mp3name=$defServerName.'files/mmx/mp3/'.$gotCont[6].'.mp3'; // $mp3file='files/mmx/mp3/'.$gotCont[6].'.mp3'; // $mp3file='http://media.adventist.org.ua/mp3/'.$gotCont[6].'.mp3'; // if(file_exists($mp3file)) $smarty->assign('mp3name',$mp3name); $mp3name='http://media.adventist.org.ua/mp3/'.$gotCont[6].'.mp3'; $smarty->assign('mp3name',$mp3name); $tpl = $smarty->fetch($file_tpl.'.tpl'); print $tpl; ?>