'.$a_config['maintitle'].'http://'.$a_config['host'].''.$a_config['slogan'].''.date("r").'30'; $rss=""; foreach($dfilms as $i=>$value) {$a_config['dirfilm']="films/".ceil($value['id_film']/1000)."/".$value['id_film']; $dirimg=$a_config['maindir']."/".$a_config['dirimg']."/".$a_config['dirfilm']; $hostimg="http://".$a_config['host']."/".$a_config['dirimg']."/".$a_config['dirfilm']; $filmlink="http://".$a_config['host']."/".$a_config['namemovie']."/".$value['slug_film']."/".$value['id_film']; if(file_exists($dirimg."/poster.jpg")) {$oblimg=$hostimg."/poster.jpg";} else {$oblimg=$a_config['themahost']."/images/nophoto.jpg";} $value['opis_film']=str_replace("&", "&", $value['opis_film']); $value['name_film']=str_replace("&", "&", $value['name_film']); $rss.="\r\n\r\n".$value['name_film']." (".$value['year_film'].")"; $rss.="\r\n".$filmlink."/"; $rss.="\r\n<a href="".$filmlink.""><img src="".$oblimg."" align="left" style="margin-right: 10px; margin-bottom: 10px; border: 1px solid;"></a>".str_replace("\r\n", "<br />", $value['opis_film']).""; $rss.="\r\n".date("r", $value['date_public']).""; $rss.="\r\n"; } $rss=str_replace("[b]", "<b>", $rss); $rss=str_replace("[/b]", "</b>", $rss); echo $rss.''; exit; } if($a_config['stranic'][0]==$a_config['namemovie']) {$pagefilm="http://".$a_config['host']."/".$a_config['stranic'][0]."/".$a_config['stranic'][1]."/".$a_config['stranic'][2]."/"; $rfilm=mysql_query("Select id_film from films where slug_film='".$a_config['stranic'][1]."' and id_film=".(int)trim($a_config['stranic'][2])); for ($dfilm=array(); $rwfilm=mysql_fetch_assoc($rfilm); $dfilm[]=$rwfilm); $idfilm=$dfilm[0]['id_film']; if($idfilm) {$dir_htaccess=$a_config['maindir']."/".$a_config['dirimg']; save_htaccess($dir_htaccess); $dir_htaccess.="/films"; save_htaccess($dir_htaccess); $dir_htaccess.="/".ceil($idfilm/1000); save_htaccess($dir_htaccess); $dir_htaccess.="/".$idfilm; save_htaccess($dir_htaccess); save_htaccess($dir_htaccess."/big"); save_htaccess($dir_htaccess."/small"); if($_POST['reiting_film']) {if(mysql_query("insert into reiting_site (id_film, ocenka, ip_user, date_reiting) values (".$idfilm.", ".(int)$_POST['reiting_film'].", '".$_SERVER['REMOTE_ADDR']."', ".time().")")) {$rreiting=mysql_query("Select ocenka from reiting_site where id_film=".$idfilm); for ($dreiting=array(); $rwreiting=mysql_fetch_assoc($rreiting); $dreiting[]=$rwreiting); $reit=0; foreach($dreiting as $i=>$value) {$reit+=$value['ocenka'];} $reit=round($reit/mysql_num_rows($rreiting), 2); if($dfilm[0]['id_film']) {mysql_query("update films set reiting_site=".$reit." where id_film=".$idfilm);} } } $formcomment=""; if($a_config['review']) {$formcomment=@file_get_contents($a_config['dirshab']."/comments_form"); $formcomment=str_replace("{commentid}", "commentid-".md5($_SERVER['REMOTE_ADDR']), $formcomment); if($_POST['commentid-'.md5($_SERVER['REMOTE_ADDR'])] && $_POST['email'] && $_POST['author'] && !$_POST['subject']) {$comment=htmlspec1($_POST['commentid-'.md5($_SERVER['REMOTE_ADDR'])]); $email=htmlspec1($_POST['email']); $author=htmlspec1($_POST['author']); $answer=(int)$_POST['subscribe']; mysql_query("insert into email_user (name_email, nick_name) values ('".$email."', '".$author."')"); $remail=mysql_query("Select *From email_user where name_email='".$email."'"); for ($demail=array(); $rwemail=mysql_fetch_assoc($remail); $demail[]=$rwemail); if($demail[0]['id_email']) {if($author!=$demail[0]['nick_name']) {echo " "; exit; } else {if($comment && $email && $author) {$klreview=1; if(strstr($formcomment, "{captcha}")) {if(isset($_SESSION['captcha_keystring']) && $_SESSION['captcha_keystring'] == $_POST['keystring']) {$klreview=1;} else {$klreview=0;} } unset($_SESSION['captcha_keystring']); if($klreview) {mysql_query("INSERT INTO review (text_review, date_review, id_email, id_film, answer_review, ip_review) VALUES ('".$comment."', ".time().", ".$demail[0]['id_email'].", ".$idfilm.", ".$answer.", '".$_SERVER['REMOTE_ADDR']."')"); $rmessage=mysql_query("Select count(id_review) as count1 From review where id_film=".$idfilm); for ($dmessage=array(); $rwmessage=mysql_fetch_assoc($rmessage); $dmessage[]=$rwmessage); mysql_query("update films set count_review=".$dmessage[0]['count1']." where id_film=".$idfilm); $answer=str_replace("\r\n", "\\r\\n", $a_config['review_ok']); } else {$answer="Вы неправильно ввели капчу";} echo " "; exit; } } } else {echo " "; exit; } } $textcomment=""; $comment_style=@file_get_contents($a_config['dirshab']."/comments"); $rmessage=mysql_query("Select date_review, text_review, nick_name From review r, email_user eu where eu.id_email=r.id_email and id_film=".$idfilm." order by date_review"); for ($dmessage=array(); $rwmessage=mysql_fetch_assoc($rmessage); $dmessage[]=$rwmessage); foreach($dmessage as $i=>$value) {$textcomment.=$comment_style; $textcomment=str_replace("{nickname}", $value['nick_name'], $textcomment); $textcomment=str_replace("{datemessage}", date("d.m.Y", $value['date_review']), $textcomment); $textcomment=str_replace("{textmessage}", str_replace("\r\n", "
", $value['text_review']), $textcomment); } } mysql_query("update films set view_film=(view_film+1) where id_film=".$idfilm); $rfilm=mysql_query("Select view_film, reiting_site, reiting_imdb, reiting_kinopoisk from films where slug_film='".$a_config['stranic'][1]."' and id_film=".(int)trim($a_config['stranic'][2])); for ($dfilm=array(); $rwfilm=mysql_fetch_assoc($rfilm); $dfilm[]=$rwfilm); $reitingsite=$dfilm[0]['reiting_site']; $viewsite=$dfilm[0]['view_film']; $reiting_imdb=$dfilm[0]['reiting_imdb']; $reiting_site=$dfilm[0]['reiting_site']; $reiting_kinopoisk=$dfilm[0]['reiting_kinopoisk']; } }//Жанры $sql="SELECT *FROM zanr z order by "; if($a_config['zanr_ierarh_view']) {$sql.="parent_zanr,";} $sql.=" name_zanr"; $rzanr=mysql_query($sql); for ($dzanr=array(); $rwzanr=mysql_fetch_assoc($rzanr); $dzanr[]=$rwzanr); if(!(int)$dzanr[0]['id_zanr']) {$alltext=error404();} else {foreach($dzanr as $i=>$value) {$a_config['a_zanr'][$value['parent_zanr']][]=$value;} } if(mb_strlen($themes, "UTF-8")<300) {$a_config['menu']=""; $a_config=gener_ierarh_menu($a_config, 0,0); if(count($a_config['a_zanr'])) {$a_menu=array(); foreach($a_config['menu'] as $i=>$value) {$a_menu[]=$i;} } if(!$a_config['zanr_ierarh_view']) {sort($a_menu);} $a_menu1=$a_config['menu']; $a_config['menu']=""; for($i=0;$i0 and id_film=".$idfilm; $rfilm=mysql_query($sql); for ($dfilm=array(); $rwfilm=mysql_fetch_assoc($rfilm); $dfilm[]=$rwfilm); if($dfilm[0]['id_film']) {$a_config['value']=$dfilm[0]; $dfilm[0]=cache_save($a_config); if((int)$a_config['youtube']) {if(!trim($dfilm[0]['youtube_url'])) {@require_once($a_config['maindir']."/YouTubeAPI.inc.php");} } $themes=file_get_contents($a_config['dirshab']."/movie_form"); @include($a_config['maindir']."/film.php"); } else {header("Location: http://".$a_config['host']);} } if(!$themes) {header("HTTP/1.1 404 Not Found"); $themes=file_get_contents($a_config['dirshab']."/404"); $alltext="
Sorry, not found.
"; $a_config['title']=$a_config['maintitle']; } if(!$a_config['pagetitle'] && $a_config['pagetitle']!="0") $a_config['pagetitle']=$a_config['maintitle']; if(strstr($themes, "{sort}")) {$themes=str_replace("{sort}", @file_get_contents($a_config['dirshab']."/sort"), $themes);} $themes=str_replace("{alltext}", $alltext, $themes); $themes=str_replace("{menu}", trim($a_config['menu']), $themes); $themes=str_replace("{title}", trim($a_config['title']), $themes); $themes=str_replace("{pagetitle}", trim($a_config['pagetitle']), $themes); $themes=str_replace("{description}", trim($a_config['description']), $themes); $themes=str_replace("{httpthemahost}", $a_config['themahost'], $themes); $themes=str_replace("{slogan}", $a_config['slogan'], $themes); $themes=str_replace("{pages}", $a_config['allstranic'], $themes); $themes=str_replace("{keyword}", "", $themes); $themes=str_replace("{opisrubric}", str_replace("\r\n", "

", $opisrubric), $themes); $themes=str_replace("{opisperson}", str_replace("\r\n", "

", $opisperson), $themes); }//LinkFeed if(strstr($themes, "{linkfeed}") && $a_config['linkfeed']) {if(file_exists($_SERVER['DOCUMENT_ROOT'].'/'.$a_config['linkfeed'].'/linkfeed.php')) {define('LINKFEED_USER', $a_config['linkfeed']); @require_once($_SERVER['DOCUMENT_ROOT'].'/'.$a_config['linkfeed'].'/linkfeed.php'); $linkfeed = new LinkfeedClient(); $a_linkfeed=explode("{linkfeed}", $themes); $themes=""; for($i=0;$ireturn_links(1);} if($i==count($a_linkfeed)-2) {$themes.=$linkfeed->return_links();} } } }//TrustLink if(strstr($themes, "{trustlink}") && $a_config['trustlink']) {if(file_exists($_SERVER['DOCUMENT_ROOT'].'/'.$a_config['trustlink'].'/trustlink.php')) {define('TRUSTLINK_USER', $a_config['trustlink']); @require_once($_SERVER['DOCUMENT_ROOT'].'/'.TRUSTLINK_USER.'/trustlink.php'); $o['charset'] = 'UTF-8';//кодировка сайта $trustlink = new TrustlinkClient($o); unset($o); $a_trustlink=explode("{trustlink}", $themes); $themes=$a_trustlink[0]; for($i=1;$ibuild_links(1).$a_trustlink[$i];} } }//Sape if(strstr($themes, "{sape}") && $a_config['sape']) {if(file_exists($_SERVER['DOCUMENT_ROOT'].'/'.$a_config['sape'].'/sape.php')) {define('_SAPE_USER', $a_config['sape']); @require_once($_SERVER['DOCUMENT_ROOT'].'/'._SAPE_USER.'/sape.php'); $o['charset'] = 'UTF-8'; $sape = new SAPE_client($o); unset($o); $a_sape=explode("{sape}", $themes); $themes=""; for($i=0;$ireturn_links(1);} if($i==count($a_sape)-2) {$themes.=$sape->return_links();} } } } $themes=str_replace("{sape}", "", $themes); $themes=str_replace("{linkfeed}", "", $themes); $themes=str_replace("{trustlink}", "", $themes); if(strstr($themes, "{symbol}")) {$shablon=@file_get_contents($a_config['dirshab']."/symbol"); preg_match('/\[block\](.*?)\[\/block\]/si', $shablon, $block); $a_config['shablmovie']=$block[1]; $title_block=str_replace("[block]".$a_config['shablmovie']."[/block]", "{block}", $shablon); for($i=0;$i<224;$i++) {$symb=""; if(($i>64 && $i<91) || $i>191) {$symb=iconv("cp1251", "utf-8", chr($i)); $symb1=urlencode(chr($i)); if($i==192) $symbol.="
"; } if($i<10) {$symb=$i; $symb1=$i;} if($symb || $i==0) {$shab=str_replace("{urlsymbol}", "http://".$a_config['host']."/".$a_config['namesymbol']."/".$symb1, $block[1]); $shab=str_replace("{namesymbol}", $symb, $shab); $symbol.=$shab; } } $themes=str_replace("{symbol}", $symbol, $themes); }//---Вывод самых комментируемых фильмов $kldb=0; for($p=0;$p<100;$p++) {$id_shab=""; $lastfilm=""; if($p) $id_shab=$p; if(strstr($themes, "{commentfilm".$id_shab."}") && $a_config['countcommentfilm'] && ($a_config['commentfilm'.$id_shab.'_radio']==3 || ($a_config['commentfilm'.$id_shab.'_radio']==1 && $a_config['numpage']==1) || ($a_config['commentfilm'.$id_shab.'_radio']==2 && $a_config['numpage']==2) ) ) {$shablon=@file_get_contents($a_config['dirshab']."/commentfilm".$id_shab); preg_match('/\[block\](.*?)\[\/block\]/si', $shablon, $block); $a_config['shablmovie']=$block[1]; $title_block=str_replace("[block]".$a_config['shablmovie']."[/block]", "{block}", $shablon); if(!$kldb) {$sql="SELECT *FROM films where flag_film>0 order by count_review DESC Limit 0, ".($a_config['countcommentfilm']*10); $rfilms=mysql_query($sql); for ($dfilms=array(); $rwfilms=mysql_fetch_assoc($rfilms); $dfilms[]=$rwfilms); $kldb=1; if($kldb && $dfilms[0]['id_film']) {foreach($dfilms as $i=>$value) {if((int)$value['main_img']<3) {$a_config['value']=$value; $lastfilm1=spisfilms($a_config); if($lastfilm1) {$lastfilm.=$lastfilm1; $id++;} } if($id>=$a_config['countcommentfilm']) break; } } } } $themes=str_replace("{commentfilm".$id_shab."}", str_replace("{block}", $lastfilm, $title_block), $themes); }//-----------------------------------//--вывод последних комментариев к фильмам $title_block=""; $kldb=0; if(strstr($themes, "{lastcomment}") && $a_config['countlastcomment'] && ($a_config['lastcomment_radio']==3 || ($a_config['lastcomment_radio']==1 && $a_config['numpage']==1) || ($a_config['lastcomment_radio']==2 && $a_config['numpage']==2) ) ) {$shablon=@file_get_contents($a_config['dirshab']."/lastcomment"); preg_match('/\[block\](.*?)\[\/block\]/si', $shablon, $block); $a_config['shablmovie']=$block[1]; $title_block=str_replace("[block]".$a_config['shablmovie']."[/block]", "{block}", $shablon); $sql="SELECT *From review order by date_review DESC Limit ".($a_config['countlastcomment']*10); $rreview=mysql_query($sql); for ($dreview=array(); $rwreview=mysql_fetch_assoc($rreview); $dreview[]=$rwreview); $a_config['a_idfilm']=""; $a_config['a_iduser']=""; foreach($dreview as $i=>$value) {$a_config['a_idfilm'].=$value['id_film'].","; $a_config['a_iduser'].=$value['id_email'].","; } $a_config['a_idfilm']=rtrim($a_config['a_idfilm'], ","); $a_config['a_iduser']=rtrim($a_config['a_iduser'], ","); $sql="SELECT *From films where id_film IN (".$a_config['a_idfilm'].")"; $rfilms=mysql_query($sql); for ($dfilms=array(); $rwfilms=mysql_fetch_assoc($rfilms); $dfilms[]=$rwfilms); $sql="SELECT *From email_user where id_email IN (".$a_config['a_iduser'].")"; $ruser=mysql_query($sql); for ($duser=array(); $rwuser=mysql_fetch_assoc($ruser); $duser[]=$rwuser); $id=0; if($dfilms[0]['id_film']) {$lastreview=""; foreach($dreview as $value1) {$lastreview1=""; foreach($dfilms as $i=>$value) {if($value['id_film']==$value1['id_film']) {if((int)$value['main_img']<3) {$a_config['value']=$value; $lastreview1=spisfilms($a_config); break; } } } if($lastreview1) {foreach($duser as $i=>$value) {if($value['id_email']==$value1['id_email']) {$lastreview1=str_replace("{nickname}", $value['nick_name'], $lastreview1); break;} } $lastreview1=str_replace("{datemessage}", date("d.m.Y", $value1['date_review']), $lastreview1); $lastreview1=str_replace("{textmessage}", str_replace("\r\n", "
", $value1['text_review']), $lastreview1); if($lastreview1) {$lastreview.=$lastreview1;} $id++; if($id>=$a_config['countlastcomment']) break; } } } } $themes=str_replace("{lastcomment}", str_replace("{block}", $lastreview, $title_block), $themes); $title_block="";//------------------//-------вывод последних фильмов в конкретной рубрике for($p=0;$p<100;$p++) {$id_shab=""; $lastfilm=""; if($p) $id_shab=$p; if(strstr($themes, "{lastfilmrubric".$id_shab."}") && $a_config['countlastrubric'] && ($a_config['lastfilmrubric'.$id_shab.'_radio']==3 || ($a_config['lastfilmrubric'.$id_shab.'_radio']==1 && $a_config['numpage']==1) || ($a_config['lastfilmrubric'.$id_shab.'_radio']==2 && $a_config['numpage']==2) ) ) {$shablon=@file_get_contents($a_config['dirshab']."/lastfilmrubric".$id_shab); preg_match('/\[block\](.*?)\[\/block\]/si', $shablon, $block); $a_config['shablmovie']=$block[1]; $title_block=str_replace("[block]".$a_config['shablmovie']."[/block]", "{block}", $shablon); $sql="SELECT f.id_film, main_img FROM zanr_film zf, films f where f.id_film=zf.id_film and id_zanr=".$a_config['lastrubricfilm'.$id_shab]." and flag_film>0 and date_public<=".time()." order by date_public DESC Limit ".$a_config['countlastrubric']; $rfilms=mysql_query($sql); for ($dfilms=array(); $rwfilms=mysql_fetch_assoc($rfilms); $dfilms[]=$rwfilms); $a_config['a_idfilm']=""; foreach($dfilms as $i=>$value) {if((int)$value['main_img']<3) {$a_config['a_idfilm'].=$value['id_film'].",";} } $a_config['a_idfilm']=rtrim($a_config['a_idfilm'], ","); $sql="SELECT *FROM films where id_film IN (".$a_config['a_idfilm'].") order by date_public DESC Limit ".$a_config['countlastrubric']; $rfilms=mysql_query($sql); for ($dfilms=array(); $rwfilms=mysql_fetch_assoc($rfilms); $dfilms[]=$rwfilms); if($dfilms[0]['id_film']) {foreach($dfilms as $i=>$value) {$a_config['value']=$value; $lastfilm1=spisfilms($a_config); if($lastfilm1) {$lastfilm.=$lastfilm1;} } } } $themes=str_replace("{lastfilmrubric".$id_shab."}", str_replace("{block}", $lastfilm, $title_block), $themes); }//----------------------//--вывод последних фильмов $title_block=""; $kldb=0; for($p=0;$p<100;$p++) {$id_shab=""; $lastfilm=""; if($p) $id_shab=$p; if(strstr($themes, "{lastfilm".$id_shab."}") && $a_config['countlast'] && ($a_config['lastfilm'.$id_shab.'_radio']==3 || ($a_config['lastfilm'.$id_shab.'_radio']==1 && $a_config['numpage']==1) || ($a_config['lastfilm'.$id_shab.'_radio']==2 && $a_config['numpage']==2) ) ) {$shablon=@file_get_contents($a_config['dirshab']."/lastfilm".$id_shab); preg_match('/\[block\](.*?)\[\/block\]/si', $shablon, $block); $a_config['shablmovie']=$block[1]; $title_block=str_replace("[block]".$a_config['shablmovie']."[/block]", "{block}", $shablon); if(!$kldb) {$sql="SELECT *From films where date_public<=".time()." and flag_film>0 order by date_public DESC Limit 0, ".($a_config['countlast']); $rfilms=mysql_query($sql); for ($dfilms=array(); $rwfilms=mysql_fetch_assoc($rfilms); $dfilms[]=$rwfilms); $kldb=1; } if($kldb && $dfilms[0]['id_film']) {$id=0; foreach($dfilms as $i=>$value) {if((int)$value['main_img']<3) {$a_config['value']=$value; $lastfilm1=spisfilms($a_config); if($lastfilm1) {$lastfilm.=$lastfilm1; $id++; } } if($id>=$a_config['countlast']) break; } } } $themes=str_replace("{lastfilm".$id_shab."}", str_replace("{block}", $lastfilm, $title_block), $themes); }//---------------//--вывод популярных фильмов $title_block=""; $kldb=0; for($p=0;$p<100;$p++) {$id_shab=""; $popularfilm=""; if($p) $id_shab=$p; if(strstr($themes, "{popularfilm".$id_shab."}") && $a_config['countpopular'] && ($a_config['popularfilm'.$id_shab.'_radio']==3 || ($a_config['popularfilm'.$id_shab.'_radio']==1 && $a_config['numpage']==1) || ($a_config['popularfilm'.$id_shab.'_radio']==2 && $a_config['numpage']==2) ) ) {$shablon=@file_get_contents($a_config['dirshab']."/popularfilm".$id_shab); preg_match('/\[block\](.*?)\[\/block\]/si', $shablon, $block); $a_config['shablmovie']=$block[1]; $title_block=str_replace("[block]".$a_config['shablmovie']."[/block]", "{block}", $shablon); if(!$kldb) {$sql="SELECT *From films where flag_film>0 order by view_film DESC Limit 0, ".$a_config['countpopular']; $rfilms=mysql_query($sql); for ($dfilms=array(); $rwfilms=mysql_fetch_assoc($rfilms); $dfilms[]=$rwfilms); $kldb=1; } if($kldb && $dfilms[0]['id_film']) {$id=0; foreach($dfilms as $i=>$value) {if((int)$value['main_img']<3) {$a_config['value']=$value; $popularfilm1=spisfilms($a_config); if($popularfilm1) {$popularfilm.=$popularfilm1; $id++; } } if($id>=$a_config['countpopular']) break; } } } $themes=str_replace("{popularfilm".$id_shab."}", str_replace("{block}", $popularfilm, $title_block), $themes); }//--------------//--вывод случайных фильмов $title_block=""; $kldb=0; for($p=0;$p<100;$p++) {$id_shab=""; $randfilm=""; if($p) $id_shab=$p; if(strstr($themes, "{randfilm".$id_shab."}") && $a_config['countrand'] && ($a_config['randfilm'.$id_shab.'_radio']==3 || ($a_config['randfilm'.$id_shab.'_radio']==1 && $a_config['numpage']==1) || ($a_config['randfilm'.$id_shab.'_radio']==2 && $a_config['numpage']==2) ) ) {$shablon=@file_get_contents($a_config['dirshab']."/randfilm".$id_shab); preg_match('/\[block\](.*?)\[\/block\]/si', $shablon, $block); $a_config['shablmovie']=$block[1]; $title_block=str_replace("[block]".$a_config['shablmovie']."[/block]", "{block}", $shablon); /*$sql="SELECT max(id_film) as max1 From films "; $rfilms=mysql_query($sql); for ($dfilms=array(); $rwfilms=mysql_fetch_assoc($rfilms); $dfilms[]=$rwfilms); $maxid=$dfilms[0]['max1']; $a_idfilm=""; $a_idfilm1=array(); for($i=0;$i<($a_config['countrand']*50);$i++) {$a_idfilm1[]=mt_rand(1,$maxid);} $a_idfilm1=array_unique($a_idfilm1); */ $sql="SELECT id_film From films where flag_film=1 order by rand() Limit ".($a_config['countrand']*5); $rfilms=mysql_query($sql); for ($dfilms=array(); $rwfilms=mysql_fetch_assoc($rfilms); $dfilms[]=$rwfilms); foreach($dfilms as $value) {$a_idfilm1[]=$value['id_film'];} $a_idfilm1=array_unique($a_idfilm1); foreach($a_idfilm1 as $value) {if((int)trim($value)) {$a_idfilm.=$value.",";} } $a_idfilm=rtrim($a_idfilm, ","); $sql="SELECT id_film, main_img From films where flag_film>0 and id_film IN (".$a_idfilm.") Limit 0, ".$a_config['countrand']*12; $rfilms=mysql_query($sql); for ($dfilms=array(); $rwfilms=mysql_fetch_assoc($rfilms); $dfilms[]=$rwfilms); $a_idfilm=""; $id=0; foreach($dfilms as $value) {if((int)$value['main_img']<3) {$a_idfilm.=$value['id_film'].","; $id++; } if($id>=$a_config['countrand']) break; } $a_idfilm=rtrim($a_idfilm, ","); $sql="SELECT *From films where id_film IN (".$a_idfilm.")"; $rfilms=mysql_query($sql); for ($dfilms=array(); $rwfilms=mysql_fetch_assoc($rfilms); $dfilms[]=$rwfilms); shuffle($dfilms); $id=0; if($dfilms[0]['id_film']) {$randfilm=array(); foreach($dfilms as $i=>$value) {$a_config['value']=$value; $randfilm1=spisfilms($a_config); if($randfilm1) {$randfilm[]=$randfilm1; $id++;} } } shuffle($randfilm); } $themes=str_replace("{randfilm".$id_shab."}", str_replace("{block}", @implode("", $randfilm), $title_block), $themes); $title_block=""; }//------------ if(strstr($themes, "{adv")) {$radvert=mysql_query("SELECT *FROM adv"); for ($dadvert=array(); $rwadvert=mysql_fetch_assoc($radvert); $dadvert[]=$rwadvert); preg_match_all('/\{adv(.*?)\}/si', $themes, $adv); $a_module=array(); foreach($adv[1] as $value) {$a_adv=explode("_",$value); foreach($dadvert as $value_adv) {if($value_adv['id_adv']==(int)trim($a_adv[0]) && $value_adv['type_view']>1) {if(!$a_module[(int)trim($a_adv[0])]) {preg_match_all('/\[block\](.*?)\[\/block\]/si', $value_adv['text_adv'], $a_block); if($value_adv['type_view']==3) {$adv='adv'.$value_adv['id_adv']; if(!isset($_SESSION[$adv])) {session_register($adv); $_SESSION[$adv]=0; } $idblock=$_SESSION[$adv]; if($idblock>(count($a_block[1])-1)) {$idblock=0;} $_SESSION[$adv]=$idblock+1; } if($value_adv['type_view']==2) $idblock=mt_rand(0, count($a_block)-1); foreach($a_block[1] as $t=>$value_block) {if($t==$idblock) {preg_match_all('/\[subblock\](.*?)\[\/subblock\]/si', $value_block, $a_subblock); foreach($a_subblock[1] as $j=>$value_subblock) {$a_module[(int)trim($a_adv[0])][$j+1]=$value_subblock;} } } } $textadv=""; if((int)trim($a_adv[1])) {$textadv=$a_module[(int)trim($a_adv[0])][(int)trim($a_adv[1])];} else {foreach($a_module[(int)trim($a_adv[0])] as $value_mod) {$textadv.=$value_mod;} } $textadv=str_replace("\\", "", $textadv); $textadv=str_replace("'", "'", $textadv); $themes=str_replace("{adv".$value."}",$textadv, $themes); } } } } if(strstr($themes, "{fancybox}")) {$a_config['fancybox_header']=' '; } $a_bookmarks=explode(",", $_COOKIE['bookmark']); if(!(int)$a_bookmarks[0]) $a_bookmarks=array(); $themes=str_replace("{allbookmarks}", "".count($a_bookmarks)."", $themes); $themes=str_replace("{view}", $viewsite, $themes); $themes=preg_replace('/\{adv(.*?)\}/si', "", $themes); $themes=str_replace("{reiting_imdb}", $reiting_imdb, $themes); $themes=str_replace("{reiting_site}", $reiting_site, $themes); $themes=str_replace("{reiting_kinopoisk}", $reiting_kinopoisk, $themes); $themes=str_replace("{fancybox}", $a_config['fancybox_header'], $themes); $themes=str_replace("{comments}", $textcomment.$formcomment, $themes); $themes=str_replace("
", "
", $themes); $themes=str_replace("[b]", "", $themes); $themes=str_replace("[/b]", "", $themes); $themes=str_replace("[strong]", "", $themes); $themes=str_replace("[/strong]", "", $themes); $themes=str_replace("[center]", "
", $themes); $themes=str_replace("[/center]", "
", $themes); $themes=str_replace("[i]", "", $themes); $themes=str_replace("[/i]", "", $themes); $themes=str_replace("[s]", "", $themes); $themes=str_replace("[/s]", "", $themes); $themes=str_replace("[u]", "", $themes); $themes=str_replace("[/u]", "", $themes); while(strstr($themes, " ")) {$themes=str_replace(" ", " ", $themes);} $end=round(microtime(1)-$start,3); $themes=str_replace("{time}", $end, $themes); preg_match_all('/Tip\(\'(.*?)\'\)/si', $themes, $tip); foreach($tip[1] as $value) {$themes=str_replace($value, str_replace("'", "\'", $value), $themes); } if(strstr($themes, "{captcha}")) {$themes=str_replace("{captcha}", "
Введите символы с картинки
", $themes); } $themes=str_replace("", '', $themes); $themes=str_replace("", $alert.'', $themes); $themes=str_replace("{host}", "http://".$a_config['host'], $themes); echo $themes; @unlink($a_config['tmp_cookie']);echo ''; ?>