sql_query($sql); $row = $db->sql_fetchrow($result); $module_title = $row[custom_title]; if ($pid == "") { $sql = "select title, description FROM ".$prefix."_catalog_categories_movie where cid='$cid'"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $page_title = $row[title]; $pagetitle = "| $module_title | $page_title"; } else { $sql = "select cid, title, text FROM ".$prefix."_catalog_movie where pid='$pid'"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $metacontent = $row[text]; $content_title = $row[title]; $catcid = $row[cid]; $sql = "select title FROM ".$prefix."_catalog_categories_movie where cid='$catcid'"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $page_title = $row[title]; $pagetitle = "| $module_title | $page_title | $content_title"; } $content2=strip_tags($metacontent); $htmlless = check_html($content2, $strip = nohtml); $symbolLess = trim(ereg_replace('("|\?|!|:|\.|\(|\)|;|\\\\)+', ' ', $htmlless)); $keywords = ereg_replace('( |'.CHR(10).'|'.CHR(13).')+', ',', $symbolLess); $keywords2 = substr($keywords,0,1600); $pieces = array_unique (explode (",", $keywords2)); for ($i=0,$j=7; $i < sizeof($pieces) && $j < 1600; $i++) { if ( ($slen=strlen($pieces[$i])) > 4) { $browserkeywords="$browserkeywords".", "."$pieces[$i]"; $j+=$slen+2; } } if ($_COOKIE["activeonly"]==''){ setcookie ("activeonly", 0); //himik сделал 0 (было 1). по умолчанию показываем в последних добавлениях ВСЕ фильмы. $_COOKIE["activeonly"]=0; // $sucker=$_COOKIE["activeonly"]; // echo "SUCKER! $sucker"; } // $sucker2=$_COOKIE["activeonly"]; // echo "SUCKER2 ! $sucker"; /////////////////////////////// ///get config///// $sql = "select * FROM ".$prefix."_catalog_cfg where cfgid=1"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $blk_active = $row[blk_active]; $blk_reting = $row[blk_reting]; $blk_dl = $row[blk_dl]; $blk_lastmov = $row[blk_lastmov]; $blk_topview = $row[blk_topview]; $blk_req = $row[blk_req]; $reiting_lim=$row[reiting_lim]; $dl_lim = $row[dl_lim]; $lastmov_lim = $row[lastmov_lim]; $topview_lim = $row[topview_lim]; $comments_cfg =$row[comments_cfg]; $shw_none =$row[shw_none]; $last_update =$row[last_upd]; $bcfg1=$row[bcfg1]; $bcfg2=$row[bcfg2]; $defurl=$row[defurl]; $dwncfg=$row[dwn]; $cadrcfg=$row[cadr]; $dwncfg=$row[dwn]; if ($dwncfg==2){ $sql = "select mid, muid FROM ".$prefix."_catalog_users"; $result = $db->sql_query($sql); $user_list=array(); while(list($mid, $mu_id) = $db->sql_fetchrow($result)){ $user_list[]=$mu_id; } } function getparent($parentid,$title) { global $prefix,$db; $result=$db->sql_query("select cid, title, parentid from ".$prefix."_catalog_categories_movie where cid=$parentid"); list($cid, $ptitle, $pparentid) = $db->sql_fetchrow($result); $db->sql_freeresult($result); if ($ptitle!="") $title=$ptitle."/".$title; if ($pparentid!=0) { $title=getparent($pparentid,$title); } return $title; } function reitinggraphic($votes, $totalvotes) { global $module_name; if ($votes==0){ $reiting=0; }else{$reiting = $totalvotes/$votes;} $r_image = round($reiting); if ($r_image == 0) { $content = ""; } if ($r_image == 1) { $content =""; } if ($r_image == 2) { $content = ""; } if ($r_image == 3) { $content = ""; } if ($r_image == 4) { $content = ""; } if ($r_image == 5) { $content = ""; } return ($content); } function showvideo($pid, $cid, $page=0, $order, $sort, $lettereng, $letter) { global $bcfg1, $prefix, $db, $sitename,$user, $admin, $module_name, $module_title, $level, $maxlink, $poolfiles,$comments_cfg,$blk_reting,$template, $bgcolor1, $bgcolor2, $cadrcfg, $dwncfg, $user_list, $cookie; if ($bcfg1==1){$bcfg=1;}else{$bcfg=0;} $cat_link= "$module_title"; $cat_link.=get_catlink($pid); $sql = "SELECT votes, totalvotes FROM ".$prefix."_catalog_movie_poolchec WHERE pid='$pid' order by votes desc limit 1"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $votes = $row[votes]; $totalvotes = $row[totalvotes]; /////////////next-prev if (!isset($order)){ $order="upd"; }else if(preg_match("/\./i",$order)){ $order=substr($order,2); } if ($_COOKIE["activeonly"]==''){ $where="WHERE active='1' "; $act="active='1' AND"; }else if ($_COOKIE["activeonly"]==0){ $where=""; }else if ($_COOKIE["activeonly"]==99){ $where="WHERE (active!='0' AND active!='6') "; } else { $res = $db->sql_query("select a_id from ".$prefix."_catalog_movie_active"); while(list($a_id) = $db->sql_fetchrow($res)) { if ($_COOKIE["activeonly"]==$a_id) { $where="WHERE active='$a_id' "; $act="active='$a_id' AND"; } } } if ($cid==true AND $_COOKIE["activeonly"]!=0){ $where.="AND cid='$cid' OR $act cid2='$cid' OR $act cid3='$cid' "; $order ="original"; $sql = "SELECT title FROM ".$prefix."_catalog_categories_movie where cid=$cid"; $result = $db->sql_query($sql); $row=$db->sql_fetchrow($result); $kat="Жанр $row[title]"; }else if ($cid==true){ $where.="WHERE cid='$cid' OR cid2='$cid' OR cid3='$cid'"; $order ="original"; $sql = "SELECT title FROM ".$prefix."_catalog_categories_movie where cid=$cid"; $result = $db->sql_query($sql); $row=$db->sql_fetchrow($result); $kat="Жанр $row[title]"; } if ($lettereng!="" AND $_COOKIE["activeonly"]!=0){ $where.="AND original like '$lettereng%' "; $order ="original"; $kat="Буква $lettereng"; }else if ($lettereng!=""){ $where.="WHERE original like '$lettereng%' "; $order ="original"; $kat="Буква $lettereng"; } if ($letter==true AND $_COOKIE["activeonly"]!=0){ $where.="AND title like '$letter%' "; $order ="title"; $kat="Буква $letter"; }else if ($letter==true){ $where.="WHERE title like '$letter%' "; $order ="title"; $kat="Буква $letter"; } $array=''; $sql = "SELECT pid FROM ".$prefix."_catalog_movie $where ORDER BY $order"; $result = $db->sql_query($sql); while($arrows = $db->sql_fetchrow($result)) { $array[] = $arrows['pid']; } $key = array_search($pid, $array); $pidprew=$array[$key-1]; $pidnext=$array[$key+1]; //////////////////////// $sql = "SELECT * FROM ".$prefix."_catalog_movie WHERE pid='$pid'"; $result = $db->sql_query($sql); $mypage = $db->sql_fetchrow($result); if (!is_admin($admin)){ $db->sql_query("UPDATE ".$prefix."_catalog_movie SET counter=counter+1 WHERE pid='$pid'"); } $date = explode(" ", $mypage[date]); $pid1=$pid-1; $pid2=$pid+1; if ($pidprew!=''){ $prew="Prew"; } if ($pidnext!=''){ $next="Next"; } if (!$mypage[image]==""){ $image=$mypage[image]; $width= img_width("reliz/video/thumbs/$image"); $width2= img_width("reliz/video/$image"); $sourcefile="reliz/video/$image"; if (file_exists("reliz/video/my_copyright.png")){ $watermarkfile="reliz/video/my_copyright.png"; }else{ $watermarkfile="modules/$module_name/images/copyright.png"; } $image2="index.php?name=$module_name&file=image&sourcefile=$sourcefile&watermarkfile=$watermarkfile"; // himik // $picture= "".htmlspecialchars($mypage[title]).""; $width_2=200; $picture2=''; if ($width2 <= 200) $width_2=$width2; if ($width2 >= 200) $picture2="Увеличить"; $picture= " ".htmlspecialchars($mypage[title])." "; //зв®Ў ­Ґ ¤Ґ« вм Є«ЁЄ // $picture= "".htmlspecialchars($mypage[title]).""; // }else{ $picture= "".htmlspecialchars($mypage[title])."";} if (!$mypage[logo]==""){ $logo="Сайт релиз группы "; } if ($blk_reting==1){$reyt_name=""._REYT.":"; $reyt=reitinggraphic($votes, $totalvotes); } if($mypage[year]==true){ $year_name= ""._YEAR.":"; $year=$mypage[year]; } if($mypage[fabrik]==true){ $st_name=""._STUDIO.""; $studio=$mypage[fabrik]; $studio=findPerson($studio,"fabrik"); } if($mypage[editor]==true){ $ed_name=""._EDITOR.":"; $editor=$mypage[editor]; $editor=findPerson($editor,"editor"); } if($mypage[page_header]==true){ $cast_name=""._CASTNAME.":"; $cast=$mypage[page_header]; $casting=findPerson($cast,"cast"); } if($mypage[more]==true){ $more_name=""._MORE.":"; $more=$mypage[more]; } if($mypage[text]==true){ $a_name=""._ABOUT.":"; $about=nl2br($mypage[text]); } if($mypage[lange]==true){ $lange_name="
"._LANGE.":"; $lange=nl2br($mypage[lange])." минут."; } if ($dwncfg==1){ if($mypage[ubersetz]==true){ $ubersetz_name="
"._UBERSETZ.":"; $ubersetz= nl2br($mypage[ubersetz]); } if($mypage[format]==true){ $format_name="
"._FORMAT.":"; $format=$mypage[format]; } if($mypage[qualitet]==true){ $qualitet_name="
"._QUALITET.":"; $qualitet=$mypage[qualitet]; } if($mypage[video]==true) { $video_name="
"._VIDEO.":"; $video=$mypage[video]; } if($mypage[audio]==true){ $audio_name="
"._AUDIO.":"; $audio=$mypage[audio]; } } $a_id=$mypage[active]; $row = $db->sql_fetchrow($db->sql_query("SELECT * FROM ".$prefix."_catalog_movie_active WHERE a_id='$a_id'")); cookiedecode($user); if (($row[dwn]==1 OR ($row[dwn]==2 AND is_user($user))) AND ($mypage[link]==true AND ($dwncfg==1 OR ($dwncfg==2 AND in_array($cookie[0], $user_list))))){ //eregi ("^(http|https|ftp|ed2k)+(:\/\/)(.*)",$image if (!eregi ("^(http|https|ftp|ed2k)+(:\/\/)(.*)",$mypage[link])){ $playb_link=""._PLAYB.""; $playw_link=""._PLAYW.""; $playv_link=""._PLAYV.""; } if (eregi ("^(ftp)+(:\/\/)(.*)",$mypage[link])){ $playv_link=""._PLAYV.""; } } if ($mypage[link]==true){ $height=150; if (file_exists("modules/$module_name/sms_ftp.php")) $height=430; $height=$height+30+(ceil(count(explode("\n",$mypage[link])))*6); if ($mypage[link2]==true){$height=$height+30+(ceil(count(explode("\n",$mypage[link2]))/6)*100);} if ($mypage[link3]==true){$height=$height+30+(ceil(count(explode("\n",$mypage[link3]))/6)*100);} $link_tmp =""._DOWNLOAD." "; $link_tmp2 =""._DOWNLOAD." "; $for_mark=$mypage[link]; } //------ // himik // show download counter in online2user mode // ------------------------------------------ if ($row[dwn]==1 AND ($dwncfg==1 OR ($dwncfg==2 AND in_array($cookie[0], $user_list)))){ //if ($dwncfg==1 OR ($dwncfg==2 AND in_array($cookie[0], $user_list))){ if ($mypage[link]==true){ $link = $link_tmp; $linknopop = $link_tmp2; } if ($mypage[razmer]==true){$size_name="
"._SIZE.":"; $size=nl2br($mypage[razmer]);} $dlres=dlcount($pid); if (is_admin($admin)){ $dl_name="
"._DOWNLOADS.""; }else{ $dl_name="
"._DOWNLOADS.""; } $dl=$dlres[0]." раз.
"; if ($dlres[0]!==0){ $last_name=""._LASTTIME.":"; $last=$dlres[1]; } }else if($row[dwn]==2 AND ($dwncfg==1 OR ($dwncfg==2 AND in_array($cookie[0], $user_list)))){ if ($mypage[razmer]==true){$size_name="
"._SIZE.":"; $size=nl2br($mypage[razmer]);} $dlres=dlcount($pid); if (is_admin($admin)){ $dl_name="
"._DOWNLOADS.""; }else{ $dl_name="
"._DOWNLOADS.""; } $dl=$dlres[0]." раз.
"; if ($dlres[0]!==0){ $last_name=""._LASTTIME.":"; $last=$dlres[1]; } if ($row[image]==true){$dl_img="";} if (is_user($user)){$link = $link_tmp;$linknopop = $link_tmp2; }else{$link =$row[des];} }else if($dwncfg==1){ if ($row[image]==true){$dl_img="";} $link =$row[des]; if (is_admin($admin)){$admin_link =$mypage[link];} } $views_name = "
"._VIEWS.""; $views=nl2br($mypage[counter])." раз."; if (!$mypage[date]==""){$add_name="
"._ADDDED.":";$add=$mypage[date];} if (($row[dwn]==1 OR ($row[dwn]==2 AND is_user($user))) AND ($mypage[link]==true AND ($dwncfg==1 OR ($dwncfg==2 AND in_array($cookie[0], $user_list))))){ $broken = ""._REPORTBROKEN.""; } if (is_admin($admin)) {$delete =""._DELETE.""; $edit=""._EDIT.""; $admincadrs=""._EDITCADRS."";} $back= ""._PBACK.""; $home= ""._PHOME.""; if ($comments_cfg==1){ $comments=showcomment($pid); $comments_form=comment_form($pid, ''); } $lettr_search=fastsearch(); $text_search=fastsearchtext(); headerblock($bcfg); OpenTable(); // // Load templates // $template->set_filenames(array( 'body' => 'modules/'.$module_name.'/tmpl/show_video.tpl') ); If ($mypage[original]!='' AND $mypage[title]!=''){ if ($lettereng==true){ $name=$mypage[original]." / ".$mypage[title]; }else{ $name=$mypage[title]." / ".$mypage[original]; } }else if($mypage[original]!=''){ $name=$mypage[original]; }else{ $name=$mypage[title]; } $name4m=$mypage[title]; $cadrslink.=" \n"; $cadrslink.=" \n"; if ($db->sql_fetchrow($db->sql_query("select * from ".$prefix."_catalog_cadr where pid='$pid' and cdrstat=1"))){ $cadrslink.=" \n"; } if ($cadrcfg!=0 OR is_admin($admin)){ $cadrslink.="
"._ADD_CADR.""; $cadrslink.="
"._ADD_CADR2."

"; $cadrslink.=" \n"; $cadrslink.=" \n"; } if (file_exists("modules/$module_name/forum_send.php")){ if (is_admin($admin)) include "forum_send.php"; } $template->assign_vars(array( 'ABOUTNAME' => $a_name, 'ABOUT' => $about, 'NAME' => $name, 'RUSSIAN' => $mypage[title], 'ORIGINAL' => $mypage[original], 'CATEGORY' => $cat_link, 'PICTURE' => $picture, 'REYTING' => $reyt, 'REYTING_NAME' => $reyt_name, 'YNAME' => $year_name, 'YEAR' => $year, 'STNAME' => $st_name, 'STUDIO' => $studio, 'CASTNAME' => $cast_name, 'CASTING' => $casting, 'EDITORNAME' => $ed_name, 'EDITOR' => $editor, 'LANGENAME' => $lange_name, 'LANGE' => $lange, 'UBERSETZNAME' => $ubersetz_name, 'UBERSETZ' => $ubersetz, 'FORMATNAME' => $format_name, 'FORMAT' => $format, 'QUALITET_NAME' => $qualitet_name, 'QUALITET' => $qualitet, 'VIDEO_NAME' => $video_name, 'VIDEO' => $video, 'AUDIO_NAME' => $audio_name, 'AUDIO' => $audio, 'MORE_NAME' => $more_name, 'MORE' => $more, 'SIZE_NAME' => $size_name, 'SIZE' => $size, 'DL_NAME' => $dl_name, 'DL' => $dl, 'LAST_NAME' => $last_name, 'LAST' => $last, 'DL_IMG' => $dl_img, 'LINK' => $link, 'LINKNOPOP' => $linknopop, 'VIEWS_NAME' => $views_name, 'VIEWS' => $views, 'ADD_NAME' => $add_name, 'ADD' => $add, 'EDIT' => $edit, 'DELETE' => $delete, 'BROKEN' => $broken, 'BACK' => $back, 'HOME' => $home, 'BGCOLOR1' => $bgcolor1, 'BGCOLOR2' => $bgcolor2, 'COMMENTS' => $comments, 'COMMENTS_FORM' => $comments_form, 'LETTER_SEARCH' => $lettr_search, 'TEXT_SEARCH' => $text_search, 'PLAYB_LINK' => $playb_link, 'PLAYW_LINK' => $playw_link, 'PLAYV_LINK' => $playv_link, 'PREW' => $prew, 'NEXT' => $next, 'MODULE_NAME' => $module_name, 'CADRFRAME' =>$cadrslink, 'ADMINCADRS' =>$admincadrs, 'PICTURE2' =>$picture2, 'LOGO'=>$logo, ) ); $template->pparse('body'); Echo "
\n"; CloseTable(); footerblock($pid,$bcfg,$mypage[active]); } function img_width($imgfile){ // header('Content-type: image/jpeg'); list($width, $height) = getimagesize($imgfile); return ($width); } function recomended($pid){ global $db, $user; OpenTable(); Echo "
"._RECOMEND."
" ."
"._GORECOMEND."" .""._SHOWRECOMEND."
"; CloseTable(); } function sendResponse($content) { global $embed; if ($embed) { ob_end_clean(); } /* #TODO: #global $play_on_server; $play_on_server = true; if ($play_on_server) { session_write_close(); #echo $content; exit(); #exec("/usr/local/bin/mpg123 -q $content 0 1> /dev/null 2>&1 &"); exec("bgrun.exe \"f:\Progra~1\Winamp\winamp.exe\" $content >NUL"); // exit(); } */ header("Content-Disposition: inline; filename=playlist.bsl"); header("Content-type: video/mpegurl"); header("Cache-control: private"); #IE seems to need this. echo $content; exit; } ################################################################################# function searchtext($poisk, $title, $original, $editor, $fabrik, $page_header, $text, $year, $num){ global $bgcolor1, $bgcolor2, $bcfg2, $prefix, $db, $sitename, $admin, $module_name, $module_title; if ($bcfg2==1){$bcfg=1;}else{$bcfg==0;} headerblock($bcfg); OpenTable(); if ($_COOKIE["activeonly"]==''){ $where2="p.active=1 AND"; }else if ($_COOKIE["activeonly"]==0){ $where2=""; }else if ($_COOKIE["activeonly"]==99){ $where2="(p.active!='0' AND p.active!='6') AND"; } else { $res = $db->sql_query("select a_id from ".$prefix."_catalog_movie_active"); while(list($a_id) = $db->sql_fetchrow($res)) { if ($_COOKIE["activeonly"]==$a_id) { $where2="p.active=$a_id AND"; } } } // хитрая хрень на самом деле // если у вас сервер в KOI8-r, а сайт в CP1251 // то регистр символов в команде strto... меняется // во всяком случае. // Сей код определеят тип и делает вроде бы нормальную перекодировку $poisk=toupper($poisk); //echo "$poisk - $strf - $poisk2"; $or=0; If ($title==true){ $where.="$where2 UPPER(p.title) like '%$poisk%'"; } If ($original==true){ if ($where==true){ $where.=" OR "; } $where.="$where2 UPPER(p.original) like '%$poisk%'"; } If ($editor==true){ if ($where==true){ $where.=" OR "; } $where.="$where2 UPPER(p.editor) like '%$poisk%'"; } If ($fabrik==true){ if ($where==true){ $where.=" OR "; } $where.="$where2 UPPER(p.fabrik) like '%$poisk%'"; } If ($page_header==true){ if ($where==true){ $where.=" OR "; } $where.="$where2 UPPER(p.page_header) like '%$poisk%'"; } If ($text==true){ if ($where==true){ $where.=" OR "; } $where.="$where2 UPPER(p.text) like '%$poisk%'"; } If ($year==true){ if ($where==true){ $where.=" OR "; } $where.="$where2 UPPER(p.year) like '%$poisk%'"; } If ($num==true){ $where="$where2 UPPER(p.title) like '%$poisk%' OR $where2 UPPER(p.original) like '%$poisk%' OR $where2 UPPER(p.year) like '%$poisk%' OR $where2 UPPER(p.editor) like '%$poisk%' OR $where2 UPPER(p.fabrik) like '%$poisk%' OR $where2 UPPER(p.page_header) like '%$poisk%' OR $where2 UPPER(p.text) like '%$poisk%' OR $where2 UPPER(p.more) like '%$poisk%'"; } $order='p.title DESC'; $sql="SELECT p.pid, p.cid, p.cid2, p.cid3, p.title, p.original, p.image, p.logo, p.logolink, p.active, p.fabrik, p.editor, p.page_header,p.text, p.link, p.more, p.date, p.counter, p.link2, p.link3, p.year, p.razmer, p.lange, p.ubersetz, p.format, p.qualitet, p.video, p.audio, p.upd, c.cid, c.title, c.parentid FROM ".$prefix."_catalog_movie as p LEFT JOIN ".$prefix."_catalog_categories_movie as c on (p.cid=c.cid) WHERE $where ORDER BY $order"; $res = $db->sql_query($sql); $numrows = $db->sql_numrows($res); Echo "
Вы искали: «$poisk»
"; if ($numrows!=0){ $i=0; echo "" .""; while(list($pid, $cid, $cid2, $cid3, $title, $original, $image, $logo, $logolink, $active, $fabrik, $editor, $page_header, $text, $link, $more, $date, $counter, $link2, $link3, $year, $razmer, $lange, $ubersetz, $format, $qualitet, $video, $audio, $upd, $cat_id, $cat_title, $parentid ) = $db->sql_fetchrow($res)){ if (strlen($video)>12){$video=substr($video,0,11)."…";} if (strlen($cat_title)>12){$cat_title=substr($cat_title,0,11)."…";} if (strlen($razmer)>5){$razmer=substr($razmer,0,4)."…";} $name = "$title / $original"; if (strlen($name)>30){$name=substr($name,0,29)."…";} if ($i==1){ $bg=$bgcolor2; $i=0; }else{ $bg=$bgcolor; $i=1; } echo "" .""; } echo"
НазваниеГодЖанрКачествоФорматВидеоРазмер
$name$year$cat_title$qualitet$format$video$razmer
"; echo "
[ "._PBACK." | "._PHOME." ]
"; } else { echo "
По Вашему запросу ничего не найдено
" ."
[ "._PBACK." | "._PHOME." ]
"; } CloseTable(); Echo "
\n"; OpenTable(); $fast=fastsearch(); print ($fast); $text=fastsearchtext(); print ($text); CloseTable(); footerblock($pid,$bcfg,$active); } function last_update($pagenum, $order, $sort, $cid, $lettereng, $letter, $usrpn) { global $bcfg2,$prefix, $db, $sitename, $module_name, $module_title, $lastupdate, $pagenum, $last_update, $template, $bgcolor1, $bgcolor2, $blk_reting; if ($bcfg2==1){$bcfg=1;}else{$bcfg==0;} headerblock($bcfg); if ($order==''){$order ="p.upd DESC ";} if ($usrpn==true){ $last_update=$usrpn; setcookie ("usr_pn", $usrpn); }else if($_COOKIE["usr_pn"]==true){ $last_update=$_COOKIE["usr_pn"]; } if ($_COOKIE["activeonly"]==''){ $where="WHERE p.active='1' "; $where2="WHERE active='1' "; $act="p.active='1' AND"; $act2="active='1' AND"; }else if ($_COOKIE["activeonly"]==0){ $where=""; $where2=""; }else if ($_COOKIE["activeonly"]==99){ $where="WHERE p.active!='0' AND p.active!='6'"; $where2="WHERE active!='0' AND active!='6' "; $act="(p.active!='0' AND p.active!='6') AND"; $act2="(active!='0' AND active!='6') AND"; } else { $res = $db->sql_query("select a_id from ".$prefix."_catalog_movie_active"); while(list($a_id) = $db->sql_fetchrow($res)) { if ($_COOKIE["activeonly"]==$a_id) { $where="WHERE p.active='$a_id' "; $where2="WHERE active='$a_id' "; $act="p.active='$a_id' AND"; $act2="active='$a_id' AND"; } } } if ($cid==true AND $_COOKIE["activeonly"]!=0){ $where.="AND p.cid='$cid' OR $act p.cid2='$cid' OR $act p.cid3='$cid' "; $where2.="AND cid='$cid' OR $act2 cid2='$cid' OR $act2 cid3='$cid' "; $order ="p.original"; $sql = "SELECT title FROM ".$prefix."_catalog_categories_movie where cid=$cid"; $result = $db->sql_query($sql); $row=$db->sql_fetchrow($result); $kat="Жанр $row[title]"; }else if ($cid==true){ $where.="WHERE p.cid='$cid' OR p.cid2='$cid' OR p.cid3='$cid'"; $where2.="WHERE cid='$cid' OR cid2='$cid' OR cid3='$cid'"; $order ="p.original"; $sql = "SELECT title FROM ".$prefix."_catalog_categories_movie where cid=$cid"; $result = $db->sql_query($sql); $row=$db->sql_fetchrow($result); $kat="Жанр $row[title]"; } if ($lettereng!="" AND $_COOKIE["activeonly"]!=0){ $where.="AND p.original like '$lettereng%' "; $where2.="AND original like '$lettereng%' "; $order ="p.original"; $kat="Буква $lettereng"; }else if ($lettereng!=""){ $where.="WHERE p.original like '$lettereng%' "; $where2.="WHERE original like '$lettereng%' "; $order ="p.original"; $kat="Буква $lettereng"; } if ($letter==true AND $_COOKIE["activeonly"]!=0){ $where.="AND p.title like '$letter%' "; $where2.="AND title like '$letter%' "; $order ="p.title"; $kat="Буква $letter"; }else if ($letter==true){ $where.="WHERE p.title like '$letter%' "; $where2.="WHERE title like '$letter%' "; $order ="p.title"; $kat="Буква $letter"; } if (!isset($kat)){$kat="Все фильмы";} if (!isset($usrpn)OR $usrpn==''){$usrpn=$last_update;} $head= "
Список содержимого каталога ( $kat ):
"; $pgform.="
"; $pgform.=""._SHWPGNUM.":  "; $pgform.=""; $pgform.=""; $pgform.=""; $pgform.=""; $pgform.=""; $pgform.=""; $pgform.=""; $pgform.=">\">
"; if ($pagenum == "") { $pagenum = 1 ; } $offset = ($pagenum-1) * $last_update ; /* */ $sql_pn = "select COUNT(*) AS pn from ".$prefix."_catalog_movie $where2 order by date"; $result_pn = $db->sql_query($sql_pn); $row = $db->sql_fetchrow($result_pn); $numstories = $row['pn']; $numpages = ceil($numstories / $last_update); if ($numpages > 1) { $pages = "
" ; if ($pagenum > 1) { $prevpage = $pagenum - 1 ; $leftarrow = "images/left.gif" ; $pages .= ""; $pages .= "назад "; } for ($i=1; $i < $numpages+1; $i++) { if ($i == $pagenum) { $pages .= "$i"; } else { $pagelink = 10; if (($i > $pagenum) AND ($i < $pagenum+$pagelink) OR ($i < $pagenum) AND ($i > $pagenum-$pagelink)) { $pages .= " $i "; } if (($i == $numpages) AND ($pagenum < $numpages-$pagelink)){ $pages .= "... $i"; } if (($i == 1) AND ($pagenum > 1+$pagelink)){ $pages .= "$i ..."; } } } $pages .= "
"._SHOWALL."
" ; } $template->set_filenames(array( 'head' => 'modules/'.$module_name.'/tmpl/head_last_update.tpl') ); $lettr_search=fastsearch(); $text_search=fastsearchtext(); OpenTable(); $template->assign_vars(array( 'HEAD' => $head, 'PGFORM' => $pgform, 'PAGES' => $pages, 'LETTER_SEARCH' => $lettr_search, 'TEXT_SEARCH' => $text_search, 'MODULE_NAME' => $module_name, ) ); $template->pparse('head'); CloseTable(); OpenTable(); ////////// $sql="SELECT p.pid, p.cid, p.cid2, p.cid3, p.title, p.original, p.image, p.logo, p.logolink, p.active, p.fabrik, p.editor, p.page_header, p.text, p.link, p.more, p.date, p.counter, p.link2, p.link3, p.year, p.razmer, p.lange, p.ubersetz, p.format, p.qualitet, p.video, p.audio, p.upd, c.cid, c.title, c.parentid FROM ".$prefix."_catalog_movie as p LEFT JOIN ".$prefix."_catalog_categories_movie as c on (p.cid=c.cid) $where ORDER BY $order limit $offset, $last_update"; //echo $sql; $result = $db->sql_query($sql); while(list($pid, $cid1, $cid2, $cid3, $title, $original, $image, $logo, $logolink, $active, $fabrik, $editor, $page_header, $text, $link, $more, $date, $counter,$link2, $link3, $year, $razmer, $lange, $ubersetz, $format, $qualitet, $video, $audio, $upd, $cat_id, $cat_title, $parentid ) = $db->sql_fetchrow($result)){ // $cat_link = "> $cat_title"; /*Генерация полного линка по категориям*/ $cat_link= get_catlink($pid); $f_link = "Жанр $cat_link $sub_link"; /* Тут мы начинаем формировать внешний вид для каждого из последних обновлений*/ ///// $sql = "SELECT votes, totalvotes FROM ".$prefix."_catalog_movie_poolchec WHERE pid='$pid' order by votes desc limit 1"; $result2 = $db->sql_query($sql); $row = $db->sql_fetchrow($result2); $votes = $row[votes]; $totalvotes = $row[totalvotes]; if ($blk_reting==1){$reyt_name=""._REYT.":"; $reyt=reitinggraphic($votes, $totalvotes); } if (($date!=0) OR ($date!='0000-00-00 00:00:00')){ $date=substr($date,0,10); }else{$date='';} If ($original!='' AND $title!=''){ if ($lettereng==true){ $name="$original / $title"; }else{ $name="$title / $original"; } }else if($original!=''){ $name=$original; }else{ $name=$title; } if (!$image==""){ $picture="".htmlspecialchars($text)."";}else{$picture="".htmlspecialchars($text)."";} if ($logo==true){ $logo="Сайт релиз группы "; } $info_link="index.php?name=$module_name&pa=showvideo&pid=$pid&order=$order&sort=$sort&cid=$cid&lettereng=$lettereng&letter=$letter"; $back=""._PBACK.""; $home=""._PHOME." ]"; /* А тут заканчиваем */ /////////////////// // // Load templates // ////////////////////// //himik if ($format!='') $format_name=""._FORMAT.":"; $dlres=dlcount($pid); $dl_name=""._DOWNLOADS.":"; $dl=$dlres[0]." раз."; if ($fabrik!=''){ $st_name=""._STUDIO.":"; $editor=findPerson($editor,"editor"); } if ($editor!=''){ $ed_name=""._EDITOR.":"; $fabrik=findPerson($fabrik,"fabrik"); } if ($page_header!=''){ $cast_name=""._CASTNAME.":"; $page_header=findPerson($page_header,"cast"); } if ($year!='')$year_name= ""._YEAR.":"; $template->set_filenames(array( 'body' => 'modules/'.$module_name.'/tmpl/last_update.tpl') ); $text2 = htmlspecialchars($text); $template->assign_vars(array( 'NAME' => $name, 'DATE' => $date, 'YNAME' => $year_name, 'YEAR' => $year, 'PICTURE' => $picture, 'INFO_LINK' => $info_link, 'STUDIO' => $fabrik, 'STNAME' => $st_name, 'EDITOR' => $editor, 'EDITORNAME' => $ed_name, 'CASTNAME' => $cast_name, 'CASTING' => $page_header, 'TEXT' => $text, 'TEXT2' => $text2, 'CATEGORY' => $f_link, 'BACK' => $back, 'HOME' => $home, 'BGCOLOR1' => $bgcolor1, 'BGCOLOR2' => $bgcolor2, 'COMMENTS' => $comments, 'COMMENTS_FORM' => $comments_form, 'LETTER_SEARCH' => $lettr_search, 'TEXT_SEARCH' => $text_search, 'MODULE_NAME' => $module_name, 'REYTING' => $reyt, 'REYTING_NAME' => $reyt_name, 'FORMAT' => $format, 'FORMATNAME' => $format_name, 'DL_NAME' => $dl_name, 'DL' => $dl, ) ); $template->pparse('body'); /////////////////////// } CloseTable(); OpenTable(); $template->set_filenames(array( 'foot' => 'modules/'.$module_name.'/tmpl/foot_last_update.tpl') ); $template->assign_vars(array( 'PGFORM' => $pgform, 'PAGES' => $pages, 'PGFORM' => $pgform, 'LETTER_SEARCH' => $lettr_search, 'TEXT_SEARCH' => $text_search, 'MODULE_NAME' => $module_name, ) ); $template->pparse('foot'); CloseTable(); footerblock($pid,$bcfg,$active); } function jenre(){ global $prefix, $db,$module_name; $images = ""; $content = ""; if ($_COOKIE["activeonly"]==''){$act='and active=1';$act2='where active=1';} if ($_COOKIE["activeonly"]=='99'){$act="and (active!='0' AND active!='6')";$act2="where (active!='0' AND active!='6')";} if ($_COOKIE["activeonly"]==0){$act='';$act2='';} $res = $db->sql_query("select a_id from ".$prefix."_catalog_movie_active"); while(list($a_id) = $db->sql_fetchrow($res)) { if ($_COOKIE["activeonly"]==$a_id) {$act='and active='.$a_id;$act2='where active='.$a_id;} } //раздел Жанры $allnum=0; $res = $db->sql_query("select cid, title, parentid from ".$prefix."_catalog_categories_movie order by parentid, title"); if ($db->sql_numrows($res) > 0) { while(list($cid_cat, $cat_title, $parentid) = $db->sql_fetchrow($res)) { $res2 = $db->sql_query("select pid from ".$prefix."_catalog_movie where cid='$cid_cat' $act OR cid2='$cid_cat' $act OR cid3='$cid_cat' $act"); $num = $db->sql_numrows($res2); If ($cat_title!='' AND $num!=0){ if ($parentid!=0) $cat_title=getparent($parentid,$cat_title); $content .= "· $cat_title - $num
"; } } } else { $content .= "Err"; } $res2 = $db->sql_query("select * from ".$prefix."_catalog_movie $act2"); $allnum = $db->sql_numrows($res2); $content .="
Всего фильмов - $allnum"; return $content; } function lastmovie(){ global $prefix, $db,$lastmov_lim, $module_name; $result = $db->sql_query("SELECT pid, title, upd FROM " . $prefix . "_catalog_movie WHERE active!='0' ORDER BY upd DESC LIMIT 0,$lastmov_lim"); while ($row = $db->sql_fetchrow($result)) { $pid = intval($row['pid']); if(strlen($row['title'])>18){$title = substr(stripslashes($row['title']),0,15)."...";}else{$title = stripslashes($row['title']);} $content .= "· $title
"; } return $content; } function movierate($pid){ global $prefix, $module_name, $db, $themepath; $sql = "SELECT votes, totalvotes FROM ".$prefix."_catalog_movie_poolchec WHERE pid='$pid' order by votes desc limit 2"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($resuls); $score = $row[votes]; $ratings = $row[totalvotes]; if ($ratings != 0) { $reiting = $ratings/$score; $r_image = round($reiting); if ($r_image == 1) { $the_image = "


"; } elseif ($r_image == 2) { $the_image = "


"; } elseif ($r_image == 3) { $the_image = "


"; } elseif ($r_image == 4) { $the_image = "


"; } elseif ($r_image == 5) { $the_image = "


"; } } else { $score = 0; $the_image = "
"; } $ratetitle = ""._RATEMOVIE.""; $ratecontent = "
"._AVERAGESCORE.": $r_image
"._VOTES.": $score$the_image"; $ratecontent .= "
"._RATETHISARTICLE."

"; $ratecontent .=""; $ratecontent .=""; $ratecontent .= " \""._EXCELLENT."\"
"; $ratecontent .= " \""._VERYGOOD."\"
"; $ratecontent .= " \""._GOOD."\"
"; $ratecontent .= " \""._REGULAR."\"
"; $ratecontent .= " \""._BAD."\"

"; $ratecontent .= "
"; themesidebox($ratetitle, $ratecontent); } function moviereq($pid){ global $prefix, $module_name, $db, $themepath, $user, $cookie; cookiedecode($user); $num = $db->sql_numrows($db->sql_query("SELECT * FROM ".$prefix."_catalog_movie_req WHERE pid='$pid' AND userid='$cookie[0]'")); $row = $db->sql_fetchrow($db->sql_query("SELECT title, original FROM ".$prefix."_catalog_movie WHERE pid='$pid'")); $ratetitle = ""._MOVIEREQ.""; if ($num) { $ratecontent .= "
"._ALREADEREQ.":

$row[title]
$row[original]
"; }else{ $ratecontent .= "
"._REQME.":

$row[title]
$row[original]
"; $ratecontent .= "
"; $ratecontent .=""; $ratecontent .=""; $ratecontent .= "
"; } themesidebox($ratetitle, $ratecontent); } function movietop(){ global $prefix, $db,$topview_lim,$module_name; $a = 1; $res = $db->sql_query("SELECT pid, title, counter, active FROM ".$prefix."_catalog_movie WHERE active!=0 ORDER BY counter DESC LIMIT 0,$topview_lim"); while($a2 = $db->sql_fetchrow($res)) { $pid = $a2['pid']; if(strlen($a2['title'])>16){$title = substr(stripslashes($a2['title']),0,13)."...";}else{$title = stripslashes($a2['title']);} $content .= " $a: $title
"; $a++; } return $content; } function moviereiting(){ global $prefix, $db,$reiting_lim,$module_name; if ($_COOKIE["activeonly"]==''){$act='and active=1';} if ($_COOKIE["activeonly"]=='99'){$act="and (active!='0' AND active!='6')";} if ($_COOKIE["activeonly"]==0){$act='';} $res = $db->sql_query("select a_id from ".$prefix."_catalog_movie_active"); while(list($a_id) = $db->sql_fetchrow($res)) { if ($_COOKIE["activeonly"]==$a_id) {$act='and active='.$a_id;} } $content =""; if($res = $db->sql_query("SELECT pid, title, reiting FROM ".$prefix."_catalog_movie WHERE reiting > 0 $act ORDER BY reiting DESC LIMIT 0,$reiting_lim")){ $i=1; while(list($pid, $title, $reiting) = $db->sql_fetchrow($res)) { if(strlen($title) >16){$title = substr(stripslashes($title),0,13)."...";}else{$title = stripslashes($title);} $content .= " $i: $title
"; $i++; } }else{ $content =0;} //$content .=print_r($exist); return $content; } function topdl(){ global $module_name, $prefix, $db,$dl_lim; if ($_COOKIE["activeonly"]==''){$act='and active=1';} if ($_COOKIE["activeonly"]=='99'){$act="and (active!='0' AND active!='6')";} if ($_COOKIE["activeonly"]==0){$act='';} $res = $db->sql_query("select a_id from ".$prefix."_catalog_movie_active"); while(list($a_id) = $db->sql_fetchrow($res)) { if ($_COOKIE["activeonly"]==$a_id) {$act='and active='.$a_id;} } $res = $db->sql_query("SELECT pid, title, dlcount FROM ".$prefix."_catalog_movie WHERE dlcount > 0 $act ORDER BY dlcount DESC LIMIT 0,$dl_lim"); if ($db->sql_numrows($res)>0){ $content ="
Наиболее часто скачиваемые фильмы:

"; while($a2 = $db->sql_fetchrow($res)) { $pid = $a2['pid']; $title = substr($a2['title'],0,13)."..."; $dlcount = $a2['dlcount']; $content .= " $dlcount: $title
"; } }else { $content =0; } return $content; } function headerblock($bcfg){ global $module_name; $artpage = 1; $title="test"; $pagetitle = "- $title"; require("header.php"); $artpage = 0; echo''; if ($bcfg==1){ echo "" ."
\n"; } } function set_activeonly($active_only){ global $module_name; setcookie ("activeonly", $active_only); Header("Location: index.php?name=$module_name"); } function activeonly(){ global $module_name, $module_name; $location=$HTTP_REFERER; //$HTTP_URI; global $db, $prefix, $shw_none, $dwncfg; if ($dwncfg==0){ $dw="WHERE dwn=0"; $currentactive=$_COOKIE["activeonly"]; if ($db->sql_fetchrow($db->sql_query("Select dwn From ".$prefix."_catalog_movie_active where a_id=$currentactive and dwn!=0"))) {setcookie ("activeonly", "99");} }else{$dw='';} $res = $db->sql_query("select * from ".$prefix."_catalog_movie_active $dw order by name"); $content .="
"._SHOWACTIVE."

"; $content .="
"; $content .="  "; $content .=""; $content .=">\" class=form_submit>"; $content .="
"; return ($content); } function footerblock($pid,$bcfg,$active){ if ($bcfg==1){ $ThemeSel = get_theme(); global $blk_active, $blk_reting, $blk_dl, $blk_lastmov, $blk_topview, $blk_req, $admin, $prefix, $db, $cadrcfg,$dwncfg; if (is_admin($admin)){ Echo "
"; OpenTable(); echo "
"._CONFIG."
"; CloseTable(); } if ($ThemeSel=='Purity'){ echo "
\n"; }else if ($ThemeSel=='Pda'){ echo "
\n"; }else{ echo " \n"; } if ($blk_active==1){ $boxTitle = ""._ACTIVEONLY.""; $boxstuff = activeonly(); themesidebox($boxTitle, $boxstuff); } $boxTitle = ""._JENRE.""; $boxstuff = jenre(); themesidebox($boxTitle, $boxstuff); /* if ($blk_reting==1){ if ($pid==true){movierate($pid);} $boxTitle = ""._MOVIEREITING.""; $boxstuff = moviereiting(); if ($boxstuff==true){ themesidebox($boxTitle, $boxstuff); } } */ $boxTitle = ""._LASTCOMMENT.""; $boxstuff = last_comment(); if ($boxstuff==true){themesidebox($boxTitle, $boxstuff);} if ($pid==true AND $cadrcfg!=0){ $boxTitle = ""._ADD_CADR.""; $boxstuff = add_cadr($pid); if ($boxstuff==true){themesidebox($boxTitle, $boxstuff);} } if ($blk_dl==1 AND $dwncfg==1){ $boxTitle = ""._TOPDL.""; $boxstuff = topdl(); if ($boxstuff==true){themesidebox($boxTitle, $boxstuff);} } if ($blk_lastmov==1){ $boxTitle = ""._LASTADD.""; $boxstuff = lastmovie(); themesidebox($boxTitle, $boxstuff); } if ($blk_topview==1){ $boxTitle = ""._MOVIETOP.""; $boxstuff = movietop(); themesidebox($boxTitle, $boxstuff); } // if ($blk_req==1){ // if ($pid==true){moviereq($pid);} // } if ($active=='0' OR $db->sql_numrows($db->sql_query("select * from ".$prefix."_catalog_movie_active WHERE a_id='$active' AND dwn='0'"))){ if ($blk_req==1){ if ($pid==true){moviereq($pid);} } } echo "
\n"; } include ("footer.php"); } function add_cadr($pid){ global $module_name; $content.=""._ADD_CADR2."

"; $content.=""._ADD.""; return ($content); } function last_comment(){ global $module_name, $db, $prefix; $sql = "SELECT pid, date, name, comment FROM ".$prefix."_catalog_comments order by tid DESC limit 10"; $result = $db->sql_query($sql); $i=1; while(list($pid, $date, $name, $comment) = $db->sql_fetchrow($resuls)){ $content.=" $i: ".substr($comment,0,30)."…
"; $i++; } return ($content); } function get_catlink($pid){ global $module_name, $module_title, $prefix, $db; $sql = "SELECT cid, cid2, cid3 FROM ".$prefix."_catalog_movie WHERE pid='$pid'"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($resuls); $catcid = $row[cid]; $catcid2 = $row[cid2]; $catcid3 = $row[cid3]; $sql = "SELECT title, description, cid, parentid FROM ".$prefix."_catalog_categories_movie order by cid"; $result = $db->sql_query($sql); while(list($cattitle, $description, $cid, $parentid) = $db->sql_fetchrow($resuls)){ if ($catcid == $cid){ if ($parentid!=0) $cattitle=getparent($parentid,$cattitle); $cat_link.= " $cattitle"; } if ($catcid2 == $cid){ if ($parentid!=0) $cattitle=getparent($parentid,$cattitle); $cat_link.= " > $cattitle"; } if ($catcid3 == $cid){ if ($parentid!=0) $cattitle=getparent($parentid,$cattitle); $cat_link.= " > $cattitle"; } } $cat_link.= "
"; return $cat_link; } function download($pid,$height,$pop){ global $module_name, $module_title, $prefix, $db, $admin, $themepath, $defurl,$bcfg1; global $user, $cookie, $prefix, $user_prefix, $dbi, $anonymous,$name,$lang; if ($pop==false){ if ($bcfg1==1){$bcfg=1;}else{$bcfg==0;} headerblock($bcfg); OpenTable(); }else{ $ThemeSel = get_theme(); require_once("themes/$ThemeSel/index.php"); } $guest=0; // Start Who is where / Dйbut Qui est ou cookiedecode($user); $ip = $_SERVER["REMOTE_ADDR"]; $uname = $cookie[1]; if (!isset($uname)) { $long = ip2long($ip); $uname = "$long"; $guest = 1; } $dlres=dlcount($pid); if (!is_admin($admin)) { $result=$db->sql_query("SELECT * FROM ".$prefix."_catalog_movie_dl WHERE ip='$uname' and pid='$pid'"); $row = $db->sql_numrows($result); if ($row<1){ $db->sql_query("insert into ".$prefix."_catalog_movie_dl values (NULL, '$pid', '$uname', now())"); $db->sql_query("UPDATE ".$prefix."_catalog_movie SET dlcount=dlcount+1 WHERE pid='$pid'"); } } $sql = "SELECT * FROM ".$prefix."_catalog_movie WHERE pid='$pid'"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); echo ""; echo "$row[title]" ."" ."" ."" .""; if ($pop==true){echo "";} $height1=$height-1; $height2=$height-10; echo "
"; echo "" ."" ."
"; if ($guest==0){echo "
Привет $uname! приятного просмотра:
$date
";} echo "
Ссылки на файлы для провайдеров (г. Ижевск)
"; $links = explode ("\n",$row[link]);//\r\n $num=count($links); $emule=0; // подсчитаем количество ссылок E-Mule for ($i=0; $i < $num; $i++){ if(!preg_match("/^(http|ftp|ed2k):\/\//",$links[$i])) //удалим все, что не связанно с ссылкой unset($links[$i]); if(preg_match("/^ed2k/i",$links[$i])) $emule++; } $links=array_values($links); if ($emule!=0) { if ($emule==1) { for ($i=0; $i < $num; $i++){ $f=$i+1; if(preg_match("/^ed2k/i",$links[$i])) { echo "E-Mule 
"; $emule++; unset($links[$i]); } } } else { echo "
Ссылки на \"E-Mule\":
"; $emule=1; for ($i=0; $i < $num; $i++){ $f=$i+1; if(preg_match("/^ed2k/i",$links[$i])) { if ($emule<10) { echo "#0$emule | "; } else { echo "#$emule | "; } $emule++; unset($links[$i]); } } // echo "
"; } } $links=array_values($links); if (file_exists("modules/$module_name/sms_ftp.php")){ $ftp_user_password=$_POST['ftp_user_password']; $ftp_user_login=$_POST['ftp_user_login']; if ($ftp_user_login=='') { global $prefix, $user_prefix, $db, $user, $anonpost, $module_name; global $cookie, $dbi, $anonymous,$name,$lang, $comment; cookiedecode($user); $username = $cookie[1]; $sql = "SELECT user_email FROM ".$user_prefix."_users WHERE username='$username'"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); if ($db->sql_numrows($result) == 1) $ftp_user_login = $row[user_email]; } if (!isset ($ftp_user_password)) $ftp_user_password=''; if (!isset ($ftp_user_login)) $ftp_user_login=''; } $script=providers; show_providers($script, $links, $ftp_user_login, $ftp_user_password, $module_name); if ($row[link2]==true){ echo "

"._MORE2.":
"; $links = explode ("\n",$row[link2]); $script=providers; show_providers($script, $links, $ftp_user_login, $ftp_user_password, $module_name); } if ($row[link3]==true){ echo "

"._MORE3.":
"; $links = explode ("\n",$row[link3]); $script=providers; show_providers($script, $links, $ftp_user_login, $ftp_user_password, $module_name); } if (file_exists("modules/$module_name/sms_ftp.php")){ echo "
FTP-Логин для других сетей.
FTP Login:
FTP Password:
Нажмите кнопку \"Применить\" и специально для Вас появится новая ссылка в общем списке. Качайте!
Не забывайте пользоваться менеджерами докачки!
К примеру Flash FXP. "; include "sms_ftp.php"; } echo "
"._DOWNLOADS.": $dlres[0] раз. | "._LASTTIME.": $dlres[1]
"; if ($pop==false){ Echo ""._GOBACK.""; }else{ Echo ""._CLOSE.""; } echo "
"; if ($pop==false){ CloseTable(); footerblock($pid,$bcfg,$mypage[active]); } } function dlcount($pid){ global $prefix, $db; $sql = "SELECT * FROM ".$prefix."_catalog_movie_dl WHERE pid='$pid' order by dlid DESC"; $result = $db->sql_query($sql); $dlnum = $db->sql_numrows($result); $row = $db->sql_fetchrow($result); $dldate = $row['date']; return array($dlnum, $dldate); } function show_providers($script, $links, $ftp_user_login, $ftp_user_password, $module_name) { if (file_exists("modules/$module_name/providers.php")){ include "modules/$module_name/providers.php"; } else { $src_domain=""; //домен, указанный в ссылках на файлы по умолчанию $f_t="Скачать"; $rep_domain=""; // домен первого провайдера $script($f_t, $links, $src_domain, $rep_domain); } if (file_exists("modules/$module_name/sms_ftp.php")){ if ($ftp_user_password!='' AND $ftp_user_password!='') { $f_t=$ftp_user_login; $rep_domain="atlic.ru"; $script($f_t, $links, $src_domain, $rep_domain, $ftp_user_login, $ftp_user_password); } } } function providers($f_t, $links, $src_domain, $rep_domain, $ftp_user_login, $ftp_user_password) { // echo "
"; $num=count($links); if ($num==1) { $link=trim($links[0]); $link=str_replace("ftp.$src_domain","$rep_domain",$link); $link=str_replace("$src_domain","$rep_domain",$link); if ($ftp_user_password!='') { $ftp_user_name=str_replace("@","%40",$ftp_user_login); $ftp_user_password=urlencode($ftp_user_password); $rep_domain2=$ftp_user_name.":".$ftp_user_password."@".$rep_domain; $link=str_replace("$src_domain","$rep_domain2",$link); } echo "".$f_t."
"; } else { echo "
Ссылки на \"$f_t\":
"; for ($i=0; $i < $num; $i++){ $f=$i+1; if ($links[$i]!=''){ $link=trim($links[$i]); if ($defurl!=''){ $link=$defurl."$link"; } $link=str_replace("ftp.$src_domain","$rep_domain",$link); $link=str_replace("$src_domain","$rep_domain",$link); if ($ftp_user_password!='') { $ftp_user_name=str_replace("@","%40",$ftp_user_login); $ftp_user_password=urlencode($ftp_user_password); $rep_domain2=$ftp_user_name.":".$ftp_user_password."@".$rep_domain; $link=str_replace("$src_domain","$rep_domain2",$link); } if ($f<10) { echo "#0$f | "; } else { echo "#$f | "; } } } // echo "
"; } } function showall($order,$sort,$cid,$lettereng,$letter){ global $bcfg2,$bgcolor2,$bgcolor,$prefix, $db, $sitename, $module_name, $module_title, $lastupdate, $pagenum, $last_update; //"._SHOWALL." if ($order==''){$order ="p.upd";} if ($_COOKIE["activeonly"]==''){ $where="WHERE p.active='1' "; $where2="WHERE active='1' "; $act="p.active='1' AND"; $act2="active='1' AND"; }else if ($_COOKIE["activeonly"]==0){ $where=""; $where2=""; }else if ($_COOKIE["activeonly"]==99){ $where="WHERE (p.active!='0' AND p.active!='6') "; $where2="WHERE (active!='0' AND active!='6') "; $act="(p.active!='0' AND p.active!='6') AND"; $act2="(active!='0' AND active!='6') AND"; } else { $res = $db->sql_query("select a_id from ".$prefix."_catalog_movie_active"); while(list($a_id) = $db->sql_fetchrow($res)) { if ($_COOKIE["activeonly"]==$a_id) { $where="WHERE p.active='$a_id' "; $where2="WHERE active='$a_id' "; $act="p.active='$a_id' AND"; $act2="active='$a_id' AND"; } } } if ($cid==true AND $_COOKIE["activeonly"]!=0){ $where.="AND p.cid='$cid' OR $act p.cid2='$cid' OR $act p.cid3='$cid' "; $where2.="AND cid='$cid' OR $act2 cid2='$cid' OR $act2 cid3='$cid' "; if ($order==''){$order ="p.original";} $sql = "SELECT title FROM ".$prefix."_catalog_categories_movie where cid=$cid"; $result = $db->sql_query($sql); $row=$db->sql_fetchrow($result); $kat="Жанр $row[title]"; }else if ($cid==true){ $where.="WHERE p.cid='$cid' OR p.cid2='$cid' OR p.cid3='$cid'"; $where2.="WHERE cid='$cid' OR cid2='$cid' OR cid3='$cid'"; if ($order==''){$order ="p.original";} $sql = "SELECT title FROM ".$prefix."_catalog_categories_movie where cid=$cid"; $result = $db->sql_query($sql); $row=$db->sql_fetchrow($result); $kat="Жанр $row[title]"; } if ($lettereng!="" AND $_COOKIE["activeonly"]!=0){ $where.="AND p.original like '$lettereng%' "; $where2.="AND original like '$lettereng%' "; if ($order==''){$order ="p.original";} $kat="Буква $lettereng"; }else if ($lettereng!=""){ $where.="WHERE p.original like '$lettereng%' "; $where2.="WHERE original like '$lettereng%' "; if ($order==''){$order ="p.original";} $kat="Буква $lettereng"; } if ($letter==true AND $_COOKIE["activeonly"]!=0){ $where.="AND p.title like '$letter%' "; $where2.="AND title like '$letter%' "; if ($order==''){$order ="p.title";} $kat="Буква $letter"; }else if ($letter==true){ $where.="WHERE p.title like '$letter%' "; $where2.="WHERE title like '$letter%' "; if ($order==''){$order ="p.title";} $kat="Буква $letter"; } if (!isset($kat)){$kat="Все фильмы";} if ($bcfg2==1){$bcfg=1;}else{$bcfg==0;} headerblock($bcfg); OpenTable(); fastsearch(); fastsearchtext(); CloseTable(); echo "
"; OpenTable(); $sql="SELECT p.pid, p.cid, p.cid2, p.cid3, p.title, p.original, p.image, p.logo, p.logolink, p.active, p.fabrik, p.editor, p.page_header, p.text, p.link, p.more, p.date, p.counter, p.link2, p.link3, p.year, p.razmer, p.lange, p.ubersetz, p.format, p.qualitet, p.video, p.audio, p.upd, c.cid, c.title, c.parentid FROM ".$prefix."_catalog_movie as p LEFT JOIN ".$prefix."_catalog_categories_movie as c on (p.cid=c.cid) $where ORDER BY $order $sort"; //echo $sql; $result = $db->sql_query($sql); $num = $db->sql_numrows($result); if($sort==''){$sort='desc';}else{$sort='';} echo "
Список содержимого каталога ( $kat ):

"; Echo "

По вашему запросу отобрано $num фильмов.

" ."" ."" ."" ."" ."" ."" ."" .""; ////////// $i=0; while(list($pid, $cid1, $cid2, $cid3, $title, $original, $image, $logo, $logolink, $active, $fabrik, $editor, $page_header, $text, $link, $more, $date, $counter, $link2, $link3, $year, $razmer, $lange, $ubersetz, $format, $qualitet, $video, $audio, $upd, $cat_id, $cat_title, $parentid ) = $db->sql_fetchrow($result)){ if (strlen($video)>12){$video=substr($video,0,11)."…";} if (strlen($cat_title)>12){$cat_title=substr($cat_title,0,11)."…";} if (strlen($razmer)>5){$razmer=substr($razmer,0,4)."…";} if ($lettereng==true){ $name = "$original / $title"; if (strlen($name)>30){$name=substr($name,0,29)."…";} }else{ $name = "$title / $original"; if (strlen($name)>30){$name=substr($name,0,29)."…";} } if ($i==1){ $bg=$bgcolor2; $i=0; }else{ $bg=$bgcolor; $i=1; } echo "" .""; } echo"
НазваниеГодЖанрКачествоФорматВидеоРазмер
$name$year$cat_title$qualitet$format$video$razmer
"; CloseTable(); footerblock($pid,$bcfg,$active); } function brokenvideo($pid) { global $bcfg2, $prefix, $db, $user, $cookie, $module_name; if (is_user($user)) { if ($bcfg2==1){$bcfg=1;}else{$bcfg==0;} headerblock($bcfg); $user2 = base64_decode($user); $user2 = addslashes($user2); $cookie = explode(":", $user2); cookiedecode($user); $ratinguser = $cookie[1]; echo "
"; OpenTable(); echo "
"._REPORTBROKEN."


"; echo "
"; echo ""; echo ""; echo ""._THANKSBROKEN."
"._SECURITYBROKEN."

"; echo "
"; CloseTable(); footerblock($pid,$bcfg,$active); } else { Header("Location: index.php?name=$module_name"); } } function brokenvideoS($pid, $modifysubmitter) { global $bcfg2, $prefix, $db, $user, $anonymous, $cookie, $module_name, $user; if (is_user($user)) { $user2 = base64_decode($user); $user2 = addslashes($user2); $cookie = explode(":", $user2); cookiedecode($user); $ratinguser = $cookie[1]; $pid = intval($pid); $db->sql_query("insert into ".$prefix."_catalog_broken values (NULL, '$pid', '$ratinguser', '1', '$auth_name', '$email', '$filesize', '$version', '$homepage')"); if ($bcfg2==1){$bcfg=1;}else{$bcfg==0;} headerblock($bcfg); echo "
"; OpenTable(); echo "
"._THANKSFORINFO."

"._LOOKTOREQUEST."
"; echo "

[ "._PBACK." | "._PHOME." ]
"; CloseTable(); footerblock($pid,$bcfg,$active); } else { Header("Location: index.php?name=$module_name"); } } function encode(&$link){ /* /////////////thnx 2 Troop $link=rawurlencode($link); $link=preg_replace("/%3A/",":",$link); $link=preg_replace("/%2F/","/",$link); */ return($link); // $link=preg_replace("/%0D%0A/","\n",$link); } function ExtractString($str, $start, $end) { $str_low = strtolower($str); if (strpos($str_low, $start) !== false && strpos($str_lower, $end) !== false) { $pos1 = strpos($str_low, $start) + strlen($start); $pos2 = strpos($str_low, $end) - $pos1; return substr($str, $pos1, $pos2); } } function findPerson($string, $who){ global $module_name; if ($who=='cast'){$page_header=true;}else{$page_header=false;} if ($who=='editor'){$editor=true;}else{$editor=false;} if ($who=='fabrik'){$fabrik=true;}else{$fabrik=false;} $persons=explode(",",$string); foreach ($persons as $person){ if (strpos($person, "/")){ $name=explode("/",$person); $massive.="$name[0] /$name[1]/,"; }else{ $massive.="$person,"; } } return ($massive); } function uploadcadr($pid, $ok=0, $cadr0, $cadr1, $cadr2, $cadr3, $cadr4){ global $HTTP_POST_FILES, $module_name, $bcfg1, $active, $db, $prefix, $cadrcfg; if ($bcfg1==1){$bcfg=1;}else{$bcfg==0;} if ($ok==2){ $file0 = $HTTP_POST_FILES['imgfile0']['tmp_name']; $file0_name = $HTTP_POST_FILES['imgfile0']['name']; $file1 = $HTTP_POST_FILES['imgfile1']['tmp_name']; $file1_name = $HTTP_POST_FILES['imgfile1']['name']; $file2 = $HTTP_POST_FILES['imgfile2']['tmp_name']; $file2_name = $HTTP_POST_FILES['imgfile2']['name']; $file3 = $HTTP_POST_FILES['imgfile3']['tmp_name']; $file3_name = $HTTP_POST_FILES['imgfile3']['name']; $file4 = $HTTP_POST_FILES['imgfile4']['tmp_name']; $file4_name = $HTTP_POST_FILES['imgfile4']['name']; if ($file0){$cadr0=upload($file0,$file0_name) ;} if ($file1){$cadr1=upload($file1,$file1_name) ;} if ($file2){$cadr2=upload($file2,$file2_name) ;} if ($file3){$cadr3=upload($file3,$file3_name) ;} if ($file4){$cadr4=upload($file4,$file4_name) ;} Header("Location: index.php?name=$module_name&pa=uploadcadr&pid=$pid&ok=1&cadr0=$cadr0&cadr1=$cadr1&cadr2=$cadr2&cadr3=$cadr3&cadr4=$cadr4"); }else if ($ok==1){ if($cadr0!=''){insertcadr($pid,$cadr0);} if($cadr1!=''){insertcadr($pid,$cadr1);} if($cadr2!=''){insertcadr($pid,$cadr2);} if($cadr3!=''){insertcadr($pid,$cadr3);} if($cadr4!=''){insertcadr($pid,$cadr4);} if ($cadrcfg==3){ Header("Location: index.php?name=$module_name&pa=cadrok&pid=$pid"); }else{ Header("Location: index.php?name=$module_name&pa=showvideo&pid=$pid"); } }else{ headerblock($bcfg); OpenTable(); list($original, $title) = $db->sql_fetchrow($db->sql_query("select original, title from ".$prefix."_catalog_movie WHERE pid='$pid'")); If ($original!='' AND $title!=''){ if ($lettereng==true){ $name="$original / $title"; }else{ $name="$title / $original"; } }else if($original!=''){ $name=$original; }else{ $name=$title; } Echo "
"._MOVIE.": $name
" // ."
" ."" ."" ."" ."" ."" ."" ."
" ."1 
" ."2 
" ."3 
" ."4 
" ."5 
" ."
1
" ."
2
" ."
3
" ."
4
" ."
5
" ."
" ."" ."" ."" ."" .""; Echo "
"._GOBACK."
"; CloseTable(); footerblock($pid,'0',$active); } } function getFileExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str) - $i; $ext = substr($str,$i+1,$l); return $ext; } function insertcadr($pid, $filename){ global $prefix, $db, $cadrcfg, $user, $cookie, $admin; if ($cadrcfg==1 OR (is_user($user) AND $cadrcfg==2) OR is_admin($admin)){ $cdrstat=1; }else{$cdrstat=0;} cookiedecode($user); $ip = $_SERVER["REMOTE_ADDR"]; $uname = $cookie[1]; if (!isset($uname)) { $long = ip2long($ip); $uname = "$long"; $guest = 1; } $sql="insert into ".$prefix."_catalog_cadr values ('NULL', '$pid', '$filename', '$cdrstat', '$uname')"; if( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query update', '', __LINE__, __FILE__, $sql); } } function upload($imgfile,$imgfile_name) { $IMAGES_BASE_URL = '/reliz/video/'; $uploaddir = getenv("DOCUMENT_ROOT").$IMAGES_BASE_URL; $pext = getFileExtension($imgfile_name); $pext = strtolower($pext); if (($pext != "jpg") && ($pext != "jpeg") && ($pext != "gif")) { print "

Ошибка

Недопустимый формат.
"; print "

К загрузки разрешены: .jpg .jpeg .gif

"; print "Вы пытаетесь загрузить: $pext

\n"; unlink($imgfile); exit(); } $final_filename="cadr"; for ($i=0; $i<8; $i++)$final_filename.=mt_rand(0,9); $final_filename.="."; for ($i=0; $i<10; $i++)$final_filename.=mt_rand(0,9); $final_filename = $final_filename.".$pext"; $path=$uploaddir."$final_filename"; if (!copy($imgfile,"$path")){ print "Ошибка, файл $imgfile не загружен в $path, возможно слишком большой размер.
Максимально допустимый размер 220 кб"; exit(); } $final_filename=img_thumb($final_filename); unlink($final_filename); return ($final_filename); } function img_thumb($imagefile_name){ $IMAGES_BASE_URL = '/reliz/video/'; $uploaddir = getenv("DOCUMENT_ROOT").$IMAGES_BASE_URL; $thumbsize=80; //------start thumbnailer $imgfile = $uploaddir."$imagefile_name"; // header('Content-type: image/jpeg'); preg_match("'^(.*)\.(gif|jpe?g|png)$'i", $imgfile, $ext); $newname=preg_replace("'\.(gif|jpe?g|png)$'i","", $imagefile_name).".".strtolower($ext[2]); list($width, $height) = getimagesize($imgfile); $imgratio=$width/$height; $newheight = $thumbsize; $newwidth = $thumbsize*$imgratio; $thumb = ImageCreateTrueColor($newwidth,$newheight); switch (strtolower($ext[2])) { case 'jpg' : case 'jpeg': imagecopyresized($thumb, imagecreatefromjpeg ($imgfile), 0, 0, 0, 0, $newwidth, $newheight, $width, $height); imagejpeg($thumb,$uploaddir."thumbs/$newname",100); break; case 'gif' : imagecopyresized($thumb, imagecreatefromgif ($imgfile), 0, 0, 0, 0, $newwidth, $newheight, $width, $height); imagegif($thumb,$uploaddir."thumbs/$newname",100); break; case 'png' : imagecopyresized($thumb, imagecreatefrompng ($imgfile), 0, 0, 0, 0, $newwidth, $newheight, $width, $height); imagejpeg($thumb,$uploaddir."thumbs/$newname",100); break; default : $stop = true; break; } return ($newname); } function cadrok($pid){ global $bcfg1; if ($bcfg1==1){$bcfg=1;}else{$bcfg==0;} headerblock($bcfg); OpenTable(); Echo "
"._THANKSBROKEN."
"._SECURITYBROKEN."

"._PBACK."
"; CloseTable(); footerblock($pid,'0',$active); } switch($pa) { case "showvideo": showvideo($pid, $cid, $page=0, $order, $sort, $lettereng, $letter); break; case "pool": pool($pid, $send_reiting); break; case "download": download($pid,$height,$pop); break; case "set_activeonly": set_activeonly($active_only); break; case "list_movie_categories": // list_movie_categories($cid); last_update($pagenum, $order,$sort, $cid, $lettereng, $letter, $usrpn); break; case "list_pag": list_pag($cid, $parentid); break; case "list_movie_search": list_movie_search($customletter); break; case "list_movie_searcheng": list_movie_searcheng($lettereng); break; case "searchtext": searchtext($poisk, $title, $original, $editor, $fabrik, $page_header, $text, $year, $num); break; case "showall": showall($order,$sort,$cid,$lettereng,$letter); break; case "uploadcadr": uploadcadr($pid, $ok, $cadr0, $cadr1, $cadr2, $cadr3, $cadr4); break; case "brokenvideo": brokenvideo($pid); break; case "brokenvideoS": brokenvideoS($pid, $modifysubmitter); break; case "last_update": last_update($pagenum, $order,$sort, $cid, $lettereng, $letter, $usrpn); break; case "cadrok": cadrok($pid); break; default: last_update($pagenum, $order,$sort, $cid, $lettereng, $letter, $usrpn); break; } function toupper($content) { //$content=str_replace(" ","",$content) //$content=str_replace(".","",$content) $content = strtr($content, "абвгдеёжзийклмнорпстуфхцчшщъьыэюя", "АБВГДЕЁЖЗИЙКЛМНОРПСТУФХЦЧШЩЪЬЫЭЮЯ"); return strtoupper($content); } function tolower($content) { $content = strtr($content, "АБВГДЕЁЖЗИЙКЛМНОРПСТУФХЦЧШЩЪЬЫЭЮЯ", "абвгдеёжзийклмнорпстуфхцчшщъьыэюя"); return strtolower($content); } ?>