Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- $vars_znatoki="351";
- $vars_book="1284";
- $vars_znatokimax="20";
- $vars_znatokimaxmovie="Трансформеры";
- $vars_znatokimaxznatok="75";
- $vars_znatokimaxznatokname="Алекс Экслер";
- $vars_opinion="1656";
- $bigmovies_codename[7]="fastfurious7";
- $bigmovies_russian[7]="Форсаж-7";
- $bigmovies_codename[8]="hobbit3";
- $bigmovies_russian[6]="Пятьдесят оттенков серого";
- $bigmovies_codename[6]="50shadesofgrey";
- $vars_money="1764";
- $bigmovies_codename[5]="penguinsofmadagascar";
- $bigmovies_russian[5]="Пингвины Мадагаскара";
- $bigmovies_codename[4]="avengers2";
- $bigmovies_russian[4]="Мстители: Эра Альтрона";
- $bigmovies_russian[2]="Исход: Цари и боги";
- $bigmovies_codename[3]="minionsproject";
- $bigmovies_russian[3]="Миньоны";
- $bigmovies_codename[2]="exodus";
- $bigmovies_russian[1]="Интерстеллар";
- $bigmovies_codename[1]="interstellar";
- $bigmovies_russian[0]="Голодные игры: Сойка-пересмешница. Часть - 1";
- $bigmovies_codename[0]="hungergames3";
- $bigmovies_russian[8]="Хоббит: Битва пяти воинств";
- $bigmovies_codename[9]="intothewoods";
- $bigmovies_russian[9]="Чем дальше в лес...";
- ?><?
- $compare_const=13;
- $compareall_const=10;
- function boxworld_tr ($page, $date, $russian, $gross, $class='')
- {
- global $lang;
- echo '<tr'.($class!=''?' class="'.$class.'"':'').'>
- <td width="20%" class="boxmain_date"><a href="/'.$page.'/'.$date.($lang=='en'?'/en':'').'/">'.boxdate($date,0,($page=='box'?3:($page=='boxrussia' || $page=='boxworld'?4:7)),$lang).'</a></td>
- <td width="65%" class="boxmain_movies"><a href="/'.$page.'/'.$date.($lang=='en'?'/en':'').'/">'.$russian.'</a></td>
- <td width="15%" class="boxmain_gross">'.number_format($gross,0,',',' ').'</td>
- </tr>';
- }
- function box_modify ($b, $field, $page)
- {
- global $do,$i,$compare_const,$compareall_const;
- $var=$b[$field];
- if ($field=='average' || $field=='cost')
- $var='$ '.number_format($var,0,',',' ');
- if ($field=='weekend')
- $var='$ '.$var;
- if ($field=='gross' || $field=='allgross' || $field=='world' || $field=='usa' || $field=='international')
- if (($page=='boxanimedvd' || $page=='boxanimebluray' || $page=='boxanime'))
- {
- $var=number_format($var,0,',',' ');
- if ($page=='boxanime' || $page=='boxanimedvd' || $page=='boxanimebluray')
- {
- if ($field=='gross' && $b['chvol']!=0)
- $subvar=$b['chvol'];
- else
- if ($field=='allgross' && $b['chvolall']!=0)
- $subvar=$b['chvolall'];
- else
- $subvar='';
- if ($subvar!='')
- $var.='<br><span style="color: #'.($subvar>0?'0000FF':'f40000').'; font-size: 10px;">'.($subvar>0?'+'.number_format($subvar,1,',',''):'−'.number_format(-$subvar,1,',','')).'%</span>';
- }
- }
- else
- if ($page=='boxrussia' || $page=='boxdayrussia' )
- $var='$ '.number_format($var,0,',',' ');
- else
- $var=($var!=0?'$ ':'').number_format($var/1000000,1,',',' ');
- if ($field=='ch' || $field=='chweek' || $field=='chtheaters' || $field=='chterritories') {
- if ($var==0)
- $var=' ';
- else
- if ($var>0)
- $var='<span style="color: #0000FF;">+'.($field=='ch' || $field=='chweek'?number_format($var,1,',','').'%':$var).'</span>';
- else
- $var='<span style="color: #f40000;">−'.($field=='ch' || $field=='chweek'?number_format(-$var,1,',','').'%':-$var).'</span>';
- }
- if ($field=='place')
- {
- if ($b['lastplace']==0 || $b['lastplace']==999 || $var==999) $chplace=''; else {
- $chplace=$var-$b['lastplace'];
- if ($chplace>0) $chplace='<br><span style="color: #f40000;">↓'.$chplace.'</span>'; else
- if ($chplace<0) $chplace='<br><span style="color: #0000FF;">↑'.-$chplace.'</span>'; else
- $chplace='';
- }
- $var=($var==999?'-':$var).$chplace;
- }
- if ($field=='compare')
- {
- if ($b['compare_gross']==0 && $b['compare_allgross']==0) $compare='';
- else {
- $compare='';
- if ($b['compare_gross']>=$compare_const) $compare.='<span style="color: #0000FF;">'.number_format($b['compare_gross'],1,',','').'%'.'</span>';
- else if ($b['compare_gross']<$compare_const) $compare.='<span style="color: #f40000;">'.number_format($b['compare_gross'],1,',','').'%'.'</span>';
- else $compare.='-';
- if ($b['compare_allgross']!=$b['compare_gross'])
- {
- if ($b['compare_allgross']>=$compareall_const) $compare.='<br><span style="color: #0000FF;">'.number_format($b['compare_allgross'],1,',','').'%'.'</span>';
- else if ($b['compare_allgross']<$compareall_const) $compare.='<br><span style="color: #f40000;">'.number_format($b['compare_allgross'],1,',','').'%'.'</span>';
- else $compare.='<br>-';
- }
- }
- $var=$compare;
- }
- return $var;
- }
- function boxtables_new ($page, $table, $date, $fields, $fields_info, $fields_width, $fields_align, $limit, $sort='place', $select='', $newsrows=10)
- {
- // $table = таблица: boxoffice, boxrussia, boxworld
- // $date = дата в формате '230308' (23 марта 2008 года) или '230308_4' (если надо взять 4-дневный уик-энд)
- // ...пустая только в случае с boxalltime
- // $sort = сортировка по одному из параметров
- // $fields = array ('place','codename','ch...')
- // $fields_info = array ('Место', 'Фильм', '±');
- global $do;
- global $compare_const,$compareall_const;
- $zerogross=0;
- if ($sort=='') $sort='place';
- if ($sort!='place') $sort.=' DESC';
- if ($sort=='place') $sort.=' ASC, gross DESC';
- if ($page=='boxalltime')
- $box=q("select * from ".$table." ORDER BY $sort LIMIT ".$limit);
- else
- if ($page!='boxday' && $page!='boxdayrussia')
- $box=q("select * from ".$table." where date='$date' ORDER BY $sort LIMIT ".$limit);
- else
- {
- $ts=mktime(0,0,0,mb_substr($date,2,2),mb_substr($date,0,2),mb_substr($date,4,2));
- $box=q("select * from boxdaily where type=".($page=='boxday'?0:'').($page=='boxdayrussia'?1:'')." AND timestamp=".$ts." ORDER BY $sort LIMIT ".$limit);
- }
- $i=0;
- $text='';
- $newstext='';
- $text.='
- <ul class="box_office">
- <li class="head">';
- $newstext.='
- <ul class="box_office">
- <li class="head">';
- $intxt='';
- $ntxt='';
- if (($page=='boxday' || $page=='boxdayrussia') && fq("select weekend from boxdaily where type=".($page=='boxday'?0:'').($page=='boxdayrussia'?1:'')." AND timestamp=".$ts." AND weekend!=''"))
- $dailyprophet=true;
- else
- $dailyprophet=false;
- if ($dailyprophet)
- {
- array_push ($fields,'weekend');
- array_push ($fields_info,'Прогноз<br>млн.');
- array_push ($fields_width,'10%');
- array_push ($fields_align,'center');
- }
- //while ($page=='boxday' || $page=='boxdayrussia'?list($keyb, $b) = each($table):$b=mysql_fetch_array($box))
- while ($b=mysql_fetch_array($box))
- {
- $i++;
- $textarray=boxrow_new ($b, $page, $fields, $fields_width, $fields_align, $i, $newsrows);
- $ntxt.=$textarray['newstext'];
- $intxt.=$textarray['text'];
- if ($page=='boxanime' && $b['subs_num']>1)
- {
- $subs=explode (' ',mb_trim($b['ids']));
- foreach ($subs as $sb)
- {
- $s=explode ('/',$sb);
- $subq=fq ("SELECT * FROM boxofficeanime".$s[0]." WHERE id=".$s[1]);
- $subq['type']=' '.$s[0].' ';
- $subq['place']='';
- $br=boxrow_new ($subq, $page, $fields, $fields_width, $fields_align, 1, 0, $b['place']);
- $intxt.=$br['text'];
- }
- }
- }
- $ti=0;
- foreach ($fields as $key => $f)
- {
- $ti++;
- $text.='
- <div'.($fields_width[$key]!=''?' style="width: '.$fields_width[$key].';"':'').'>'.$fields_info[$key].'</div>';
- if ($f!='chtheaters' && $f!='average' && $f!='days') {
- $newstext.='
- <div'.($fields_width[$key]!=''?' style="width: '.$fields_width[$key].';"':'').'>'.$fields_info[$key].'</div>';
- }
- }
- if ($limit!=10 && $page=='boxanime') {
- $text.='<div>Формат</div>';
- }
- if ($do && ($page=='boxanimedvd' || $page=='boxanimebluray' || $page=='boxanime')) $text.='<div style="width: 20px;">Ист.</div>';
- $text.='
- </li>';
- $newstext.='
- </li>';
- $text.=$intxt;
- $newstext.=$ntxt;
- $text.='
- </ul>';
- $newstext.='
- </ul>';
- return array ('text'=>$text, 'newstext'=>$newstext);
- }
- function boxtables ($page, $table, $date, $fields, $fields_info, $fields_width, $fields_align, $limit, $sort='place', $select='', $newsrows=10)
- {
- // $table = таблица: box, boxrussia, boxworld
- // $date = дата в формате '230308' (23 марта 2008 года) или '230308_4' (если надо взять 4-дневный уик-энд)
- // ...пустая только в случае с boxalltime
- // $sort = сортировка по одному из параметров
- // $fields = array ('place','codename','ch...')
- // $fields_info = array ('Место', 'Фильм', '±');
- global $do;
- global $newstext, $newsmark;
- global $compare_const,$compareall_const;
- $zerogross=0;
- if ($sort=='') $sort='place';
- if ($sort!='place') $sort.=' DESC';
- if ($sort=='place') $sort.=' ASC, gross DESC';
- if ($page=='boxalltime')
- $box=q("select * from ".$table." ORDER BY $sort LIMIT ".$limit);
- else if ($page!='boxday' && $page!='boxdayrussia') $box=q("select * from ".$table." where date='$date' ORDER BY $sort LIMIT ".$limit);
- $i=0;
- $text='';
- $text.='
- <table id="boxtable" class="percent100" style="color: #333333; background-color: #dadada; border: 1px solid #d9d9d9; border-style: none none solid none;">
- <thead><tr>';
- $newstext.='
- <table class="percent100" style="color: #333333; background-color: #dadada; border: 1px solid #d9d9d9; border-style: none none solid solid;">';
- $newsmark.="[boxoffice=".$page."]\n";
- $ti=0;
- foreach ($fields as $key => $f)
- {
- $ti++;
- $sort_js='';
- if ($f=='gross' || $f=='allgross' || $f=='average' || $f=='cost' || $f=='theaters' || $f=='chtheaters' || $f=='ch' || $f=='chweek' || $f=='days') $sort_js.='child: \'nobr\', sortType: \'numeric\', sortDesc: true, ';
- else if ($f=='place') $sort_js.='child: \'nobr\', sortType: \'numeric\', sortDesc: false, ';
- else if ($f=='codename') $sort_js.='child: \'a\', sortType: \'ascii\', sortDesc: false, ';
- else $sort_js.='child: \'nobr\', ';
- $text.='
- <th'.($fields_width[$key]!=''?' style="width: '.$fields_width[$key].';"':'').'><div class="box1_hd'.($sort==$f?'_sel">'.$fields_info[$key]:'">'.($page=='boxalltime'?($f=='world' || $f=='internatinal' || $f=='usa'?'<a href="javascript:$(\'#boxtable\').sortTable({onCol: '.$ti.', '.$sort_js.'keepRelationships: true})">'.$fields_info[$key].'</a>':$fields_info[$key]):'<a href="javascript:$(\'#boxtable\').sortTable({onCol: '.$ti.', '.$sort_js.'keepRelationships: true})">'.$fields_info[$key].'</a>')).'</div></th>';
- if ($f!='chtheaters' && $f!='average' && $f!='days') {
- $newstext.='
- <th'.($fields_width[$key]!=''?' style="text-align: center; width: '.$fields_width[$key].';"':'').'><div class="box1_hd">'.$fields_info[$key].'</div></th>';
- $newsmark.=$fields_info[$key].($fields_width[$key]!=""?"#".$fields_width[$key]:"").($ti<sizeof($fields)?" | ":"");
- }
- }
- if ($i<=$newsrows && $page=='boxanime') {
- $newstext.='<th style="text-align: center;"><div class="box1_hd">Формат</div></th>';
- $newsmark.=" | Формат";
- }
- if ($do && ($page=='boxanimedvd' || $page=='boxanimebluray' || $page=='boxanime')) $text.='<td style="width: 20px;">Ист.</td>';
- $text.='</tr></thead>
- <tbody>
- ';
- $newstext.='</tr>
- ';
- $newsmark.="\n";
- // НАЧАЛИ ВЫВОДИТЬ ОДНУ СТРОКУ
- while ($page=='boxday' || $page=='boxdayrussia'?list($keyb, $b) = each($table):$b=mysql_fetch_array($box))
- {
- $i++;
- $textarray=boxrow ($b, $page, $fields, $fields_width, $fields_align, $i, $newsrows);
- $newstext.=$textarray['newstext'];
- $newsmark.=$textarray['newsmark'];
- $text.=$textarray['text'];
- if ($page=='boxanime' && $b['subs_num']>1)
- {
- $subs=explode (' ',mb_trim($b['ids']));
- foreach ($subs as $sb)
- {
- $s=explode ('/',$sb);
- $subq=fq ("SELECT * FROM boxofficeanime".$s[0]." WHERE id=".$s[1]);
- $subq['type']=' '.$s[0].' ';
- $subq['place']='';
- if ($subq['date']!=$date)
- $subq['gross']=0;
- $br=boxrow ($subq, $page, $fields, $fields_width, $fields_align, 1, 0, $b['place']);
- $text.=$br['text'];
- }
- }
- }
- // ЗАКОНЧИЛИ ВЫВОДИТЬ ОДНУ СТРОКУ
- $text.='</tbody></table>';
- $newstext.='</table>';
- // $newstext.='</ol></div>';
- return $text;
- }
- function boxrow ($b, $page, $fields, $fields_width, $fields_align, $i, $newsrows=10, $sub=0, $select='')
- {
- // $table = таблица: box, boxrussia, boxworld
- // $date = дата в формате '230308' (23 марта 2008 года) или '230308_4' (если надо взять 4-дневный уик-энд)
- // ...пустая только в случае с boxalltime
- // $sort = сортировка по одному из параметров
- // $fields = array ('place','codename','ch...')
- // $fields_info = array ('Место', 'Фильм', '±');
- global $do;
- global $compare_const,$compareall_const;
- $newstext='';
- // НАЧАЛИ ВЫВОДИТЬ ОДНУ СТРОКУ
- if ($b['gross']==0) $zerogross=$i; // Значит, начиная с этого места - сборы не указаны
- if ($page=='boxanimedvd' || $page=='boxanimebluray' || $page=='boxanime')
- {
- if ($b['codename']!='')
- {
- if (mb_substr($b['codename'],0,1)=='_')
- {
- $code='<span style="'.($b['image']!=''?' onmouseover="this.style.cursor=\'help\'; Tip(\'<img src='.$b['image'].' width='.$b['width'].' height='.$b['height'].'>\')" onmouseout="UnTip()"':'').'>'.mb_substr($b['codename'],1).'</span>';
- } else
- if (mb_substr($b['codename'],0,8)=='/movies/')
- {
- $movie = mysql_fetch_array (q ("select russian, english, original from movies where codename='".mb_substr($b['codename'],8)."';"));
- $code='<a href="/movies/'.mb_substr($b['codename'],8).'/" style="text-decoration: none;"'.($b['image']!=''?' onmouseover="this.style.cursor=\'help\'; Tip(\'<img src='.$b['image'].' width='.$b['width'].' height='.$b['height'].'>\')" onmouseout="UnTip()"':'').'>«'.$movie['russian'].'»</a>';
- $codemark="[«".$movie['russian']."»](/movies/".mb_substr($b['codename'],8).")";
- } else
- if (mb_substr($b['codename'],0,4)=='/tv/')
- {
- $movie = mysql_fetch_array (q ("select russian, english from tv where codename='".mb_substr($b['codename'],4)."';"));
- $code='<a href="/tv/'.mb_substr($b['codename'],4).'/" style="text-decoration: none;"'.($b['image']!=''?' onmouseover="this.style.cursor=\'help\'; Tip(\'<img src='.$b['image'].' width='.$b['width'].' height='.$b['height'].'>\')" onmouseout="UnTip()"':'').'>«'.$movie['russian'].'»</a>';
- $codemark="[«".$movie['russian']."»](/tv/".mb_substr($b['codename'],4).")";
- } else
- {
- $anime = mysql_fetch_array (q ("select * from anime where codename='$b[codename]';"));
- if ($b['image']=='' && $anime['mainpicture']!='')
- {
- $b['image']=$anime['mainpicture'];
- if (mb_substr($anime['mainpicturelink'],0,32)=='/anime/' || mb_substr($anime['mainpicturelink'],0,7)=='/anime/')
- {
- if (mb_substr($anime['mainpicturelink'],0,32)=='/anime/') $anime['mainpicturelink']=mb_substr($anime['mainpicturelink'],32);
- else if (mb_substr($anime['mainpicturelink'],0,7)=='/anime/') $anime['mainpicturelink']=mb_substr($anime['mainpicturelink'],7);
- $exp=explode ('/',$anime['mainpicturelink']);
- $picinfo=explode(',',$anime[$exp[2].'info']);
- $b['width']=$picinfo[($exp[3]-1)*IMG_CONST+4];
- $b['height']=$picinfo[($exp[3]-1)*IMG_CONST+5];
- } else
- {
- $b['width']=240;
- $b['height']=240;
- }
- }
- $code='<a href="/anime/'.$b['codename'].'/" style="text-decoration: none;"'.($b['image']!=''?' onmouseover="this.style.cursor=\'help\'; Tip(\'<img src='.$b['image'].' width='.$b['width'].' height='.$b['height'].'>\')" onmouseout="UnTip()"':'').'>«'.$anime['russian'].'»</a>';
- $codemark="[«".$anime['russian']."»](/anime/".$b['codename'].")";
- }
- if ($b['addinfo']!='') $code.=' '.str_replace('<a href=','<a style="text-decoration: none;" href=',stripslashes(brackets($b['addinfo'])));
- if ($b['vol']!='' || $b['extra']!='') $code.='<br />';
- if ($b['vol']!='') $code.='<span class="box_bold">Том '.$b['vol'].'</span>';
- if ($b['subs_num']<2)
- {
- if ($b['vol']!='' && $b['extra']!='') $code.=' | ';
- if ($b['extra']!='') $code.=$b['extra'];
- }
- } else
- if ($b['words']>0)
- {
- $cc=explode (' ',$b['english']);
- if ($b['codename']!='') {
- if (mb_substr($b['codename'],0,8)=='/movies/')
- {
- $movie = mysql_fetch_array (q ("select russian, english, original from movies where codename='".mb_substr($b['codename'],8)."';"));
- $code='<a href="/movies/'.mb_substr($b['codename'],8).'/" style="text-decoration: none;">«'.$movie['russian'].'»</a> ';
- $codemark="[«".$movie['russian']."»](/movies/".mb_substr($b['codename'],8).")";
- } else
- {
- $anime = mysql_fetch_array (q ("select russian, english, original from anime where codename='$b[codename]';"));
- $code='<a href="/anime/'.$b['codename'].'/" style="text-decoration: none;">«'.$anime['russian'].'»</a> ';
- $codemark="[«".$anime['russian']."»](/anime/".$b['codename'].")";
- }
- for ($ci=$b['words']; $ci<sizeof($cc); $ci++)
- {
- $code.=$cc[$ci].' ';
- $codemark.=$cc[$ci].' ';
- }
- $code=substr($code,0,-1);
- $codemark=substr($codemark,0,-1);
- }
- else {
- $code='<span style="color: #1A64B5;"'.($b['image']!=''?' onmouseover="this.style.cursor=\'help\'; Tip(\'<img src='.$b['image'].' width='.$b['width'].' height='.$b['height'].'>\')" onmouseout="UnTip()"':'').'>';
- foreach ($cc as $key=>$c)
- {
- $code.=$c;
- if ($key==$b['words']-1) $code.='</span>';
- $code.=' ';
- $codemark.=$c;
- if ($key==$b['words']-1) $codemark.='</span>';
- $codemark.=' ';
- }
- $code=substr($code,0,-1);
- $codemark=substr($codemark,0,-1);
- }
- } else {
- $code=$b['english'];
- $codemark=$b['english'];
- }
- $movie=$code;
- $patt[0]='/(Vol|VOL|vol|Note|Shoot|take )(\.|\:)[0-9]+/';
- $patt[1]='/\([0-9]+\)/';
- $patt[2]='/\(Limited Edition\)/';
- $patt[3]='/\<Limited Edition\>/';
- $patt[4]='/(Blu-ray |DVD | |BD-|BD)BOX [IVX0-9]+/';
- $patt[5]='/(Blu-ray |DVD | |BD-|BD)BOX/';
- $newsmovie=$movie;
- $newsmoviemark=$codemark;
- if ($do && $page!='boxanime') $movie.=($b['codename']==''?$b['original']:'').'<input type="hidden" value="'.$b['id'].'" name=ids['.$i.']><br><input style="font-size: 11px;" type=text size="30" value="'.$b['codename'].'" name=codename['.$i.']><br><input style="font-size: 11px;" type=text size="1" value="'.$b['vol'].'" name=vol['.$i.']><textarea style="font-size: 11px; height: 19px; margin: 0 0 -5 0; padding: 0 0 0 0;" cols="30" name="addinfo['.$i.']">'.$b['addinfo'].'</textarea><br><input style="font-size: 11px;" type=text size="25" value="'.$b['extra'].'" name=extra['.$i.']><a href="http://www.animenewsnetwork.com/search?cx=016604166282602569737%3Aznd1ysjewre&q='.trim(preg_replace($patt,'',$b['original'])).'&sa=Search&cof=FORID%3A11" target="_blank">[A]</a> <a href="http://www.cdjapan.co.jp/detailview.html?KEY='.between(mb_strrchr($b['image'],'/'),'/','.jpg').'" target="_blank">[CD]</a>';
- } else
- {
- $code=$b['codename'];
- if (mb_substr($code,-1)=='_')
- {
- $movie=mb_substr($code,0,-1).'<br>';
- $m=array();
- }
- else
- if (mb_substr($code,0,7)=='/anime/')
- {
- $anime = mysql_fetch_array (q ("select russian, english, original from anime where codename='".mb_substr($code,7)."';"));
- $movie='<a href="/anime/'.mb_substr($code,7).'/">«'.$anime['russian'].'»</a><br>';
- $newsmovie=$movie;
- if ($anime['original']!='')
- {
- if (!$do || $page=='boxanime') $movie.=$anime['original'];
- //$newsmovie=$movie;
- }
- }
- else {
- $movies = q ("select russian, english, budget, posters, postersinfo from movies where codename='$code';");
- if ($movies) $m=mysql_fetch_array ($movies);
- if ($m['posters']!=0)
- {
- $post_arr=explode (',',$m['postersinfo']);
- $post_width=$post_arr[$m['posters']*IMG_CONST-4];
- $post_height=$post_arr[$m['posters']*IMG_CONST-3];
- $post_num=$post_arr[$m['posters']*IMG_CONST-8];
- $pst=' onmouseover="this.style.cursor=\'help\'; Tip(\'<img src=http://media.kino-govno.com/movies/'.substr($code,0,1).'/'.$code.'/posters/'.$code.'_'.$post_num.'s.jpg width='.$post_width.' height='.$post_height.'>\')" onmouseout="UnTip()"';
- } else $pst='';
- $movie='';
- $movie.='«<a href="/movies/'.$code.'/"'.$pst.'>'.$m['russian'].'</a>»<br>';
- $newsmovie=$movie;
- if ($m['english']!='')
- {
- if (!$do || $page=='boxanime') $movie.=$m['english'];
- $newsmovie=$movie;
- }
- }
- if ($do && $page!='boxanime') $movie.='<input type="hidden" value="'.$b['id'].'" name="ids['.$i.']" id="ids['.$i.']"><input class="txt" type=text width=30 value="'.$code.'" name="name['.$i.']" id="name['.$i.']">'.($page=='boxworld' && mb_substr($code,-1)=='_'?'<img src="/i/magnifying_glass_icon.png" onClick="window.open(\'/admin/movies_ad.php?id=\' + lowerit($(\'#name\\\['.$i.'\\\]\').val().substring(0,$(\'#name\\\['.$i.'\\\]\').val().length-1)) + \'&eng=\'+$(\'#name\\\['.$i.'\\\]\').val().substring(0,$(\'#name\\\['.$i.'\\\]\').val().length-1) + \'&gallerycode='.$i.'\', \'movie_search\', \'width=1150,height=500\');">':'');
- }
- if ($b['ch']==0) $ch=' '; else
- if ($b['ch']>0) $ch='<span style="color: #0000FF;">+'.number_format($b['ch'],1,',','').'%</span>';
- else $ch='<span style="color: #f40000;">−'.number_format(-$b['ch'],1,',','').'%</span>';
- if ($b['chweek']==0) $chweek=' '; else
- if ($b['chweek']>0) $chweek='<span style="color: #0000FF;">+'.number_format($b['chweek'],1,',','').'%</span>';
- else $chweek='<span style="color: #f40000;">−'.number_format(-$b['chweek'],1,',','').'%</span>';
- $text.='
- <tr style="text-align: center;'.($sub!=0?' display: none;" id="sub'.$sub.'_'.$b['id']:'').'">';
- if ($i<=$newsrows) {
- $newstext.='
- <tr style="text-align: center;">';
- $newsmark.="\n";
- }
- foreach ($fields as $key => $f) {
- if ($page=='boxday' || $page=='boxdayrussia')
- {
- if (($b['gross']==$b['allgross'] && $b['gross']!=0) || ($b['days']<6 && $b['days']!=0)) $r=3; else if ($i%2==0) $r=1; else $r=2;
- }
- else
- if (($b['week']==1 && $b['week']!=0) || ($b['days']<8 && $b['days']!=0 && $page!='boxdate') || ($b['days']<6 && $b['days']!=0 && $page=='boxdate') || ($page=='boxalltime' && $select==$b['codename']) || ($b['gross']==$b['allgross'] && $b['gross']!=0)) $r=3; else if ($i%2==0) $r=1; else $r=2;
- if ($do && $b['codename']=='' && $f=='english') $r=4;
- if ($sub!=0) $r=5;
- $text.='
- <td class="box1_row'.$r.'"'.
- ($f=='english' && ($page=='boxanimedvd' || $page=='boxanimebluray' || $page=='boxanime')?' id="td'.$b['place'].'"':'').
- ($fields_align[$key]!=''?' style="text-align: '.$fields_align[$key].';"':'').
- '>'.
- ($f!='codename' && $f!='english'?'<span class="nobr">':'').
- ($f=='codename' || $f=='english'?$movie:'').
- ($f=='studio'?$b[$f]:'').
- ($f=='compare'?box_modify($b,$f,$page):'').
- (($f=='gross' || $f=='allgross') && ($page=='boxanimedvd' || $page=='boxanimebluray') && $do?'<input '.($f=='gross'?'onchange="if (document.getElementById(\'allgross['.$i.']\').value==\'0\' || document.getElementById(\'allgross['.$i.']\').value==\'\') document.getElementById(\'allgross['.$i.']\').value=document.getElementById(\'gross['.$i.']\').value" ':'').'style="width: 50px; font-size: 11px;" type=text value="'.($b[$f]==0?'':$b[$f]).'" name="'.$f.'['.$i.']" id="'.$f.'['.$i.']">':'').
- ($f!='codename' && $f!='english' && $f!='studio' && !(($f=='gross' || $f=='allgross') && ($page=='boxanimedvd' || $page=='boxanimebluray') && $do) && !($f=='place' && $page=='boxalltime') && $b[$f]!=0?box_modify($b,$f,$page):' ').
- ($f=='cost' && ($b['cost']==0 || $b['cost']=='-')?($m['budget']!=0?'$ '.number_format($m['budget'],0,',',' '):''):'').
- ($f=='place' && $page=='boxalltime'?$i:'').
- ($f=='place'?$chplace:'').
- ($f!='codename' && $f!='english'?'</span>':'').
- '</td>';
- //
- if ($i<=$newsrows && $f!='chtheaters' && $f!='average' && $f!='days')
- {
- $newstext.='
- <td class="box1_row'.$r.'"'.
- ($f=='english' && ($page=='boxanimedvd' || $page=='boxanimebluray' || $page=='boxanime')?' id="td'.$b['place'].'"':'').
- ($fields_align[$key]!=''?' style="text-align: '.$fields_align[$key].';"':'').
- '>'.
- ($f!='codename' && $f!='english'?'<span class="nobr">':'').
- ($f=='codename' || $f=='english'?$newsmovie:'').
- ($f=='studio'?$b[$f]:'').
- ($f=='compare'?box_modify($b,$f,$page):'').
- ($f!='codename' && $f!='english' && $f!='studio' && !($f=='place' && $page=='boxalltime') && $b[$f]!=0?box_modify($b,$f,$page):'').
- ($f=='cost' && $b['cost']==0 && $m['budget']!=0?'$ '.number_format($m['budget'],0,',',' '):'').
- ($f=='place' && $page=='boxalltime'?$i:'').
- ($f=='place'?$chplace:'').
- ($f!='codename' && $f!='english'?'</span>':'').
- '</td>';
- $newsmark.=
- ($f=='codename' || $f=='english'?$newsmovie:'').
- ($f=='studio'?$b[$f]:'').
- ($f=='compare'?$b[$f]:'').
- ($f!='codename' && $f!='english' && $f!='studio' && !($f=='place' && $page=='boxalltime') && $b[$f]!=0?$b[$f]:'').
- ($f=='cost' && $b['cost']==0 && $m['budget']!=0?'$ '.number_format($m['budget'],0,',',' '):'').
- ($f=='place' && $page=='boxalltime'?$i:'').
- ($f=='place'?$chplace:'').
- " | ";
- }
- //
- }
- if ($limit!=10 && $page=='boxanime') {
- $newstext.='<td class="box1_row'.$r.'">'.($b['type']==' bluray dvd '?'Blu-ray<br>DVD':'').($b['type']==' bluray '?'Blu-ray':'').($b['type']==' dvd '?'DVD':'').'</td>';
- $newsmark.=" | ".($b['type']==' bluray dvd '?'Blu-ray#DVD':'').($b['type']==' bluray '?'Blu-ray':'').($b['type']==' dvd '?'DVD':'');
- }
- if ($do && ($page=='boxanimedvd' || $page=='boxanimebluray')) $text.='<td class="box1_row'.$r.'"><a href="/admin/animeflowers.php?action=showsales&type=bluray&name='.$b['codename'].'" target="_blank" style="text-decoration: none;">BD</a><br><a href="/admin/animeflowers.php?action=showsales&type=dvd&name='.$b['codename'].'" target="_blank" style="text-decoration: none;">DVD</a>'.($b['temp']!=''?'<br><span class="dashed_link" onClick="$(\'#admininfo'.$b['place'].'\').toggle();">инфо</span>':'').'</td><input type="hidden" id="english'.$b['place'].'" value="'.$b['english'].'">
- <input type="hidden" id="words'.$b['place'].'" value="'.$b['words'].'">';
- else if ($limit!=10 && $page=='boxanime') $text.='<td class="box1_row'.$r.'">'.($b['subs_num']>1?'<span class="dashed_link" onClick="$(\'tr[id*=sub'.$b['place'].']\').toggle();">':'').($b['type']==' bluray dvd '?'Blu-ray<br>DVD':'').($b['type']==' bluray '?'Blu-ray':'').($b['type']==' dvd '?'DVD':'').($b['subs_num']>1?'</span>':'').'</td>';
- $text.='
- </tr>';
- // if ($b['temp']!='') $text.='<tr id="admininfo'.$b['place'].'" style="background: #FFFFFF;" class="hidden"><td colspan="6" style="padding-left: 15px; padding-top:5px; padding-bottom: 5px; border-top: 1px solid grey;border-bottom: 1px solid grey;"><span style="color: grey; cursor: hand; cursor: ponter; margin-right: 20px;" onClick="$(\'#admininfo'.$b['place'].'\').toggle();">×</span>'.$b['temp'].'</td></tr>';
- if ($i<=$newsrows) {
- $newstext.='
- </tr>';
- $newsmark.="\n";
- }
- if ($i%2==0) $color='white'; else $color='black';
- // ЗАКОНЧИЛИ ВЫВОДИТЬ ОДНУ СТРОКУ
- return array ('text'=>$text, 'newstext'=>$newstext, 'newsmark'=>$newsmark);
- }
- function boxrow_new ($b, $page, $fields, $fields_width, $fields_align, $i, $newsrows=10, $sub=0, $select='')
- {
- // $table = таблица: box, boxrussia, boxworld
- // $date = дата в формате '230308' (23 марта 2008 года) или '230308_4' (если надо взять 4-дневный уик-энд)
- // ...пустая только в случае с boxalltime
- // $sort = сортировка по одному из параметров
- // $fields = array ('place','codename','ch...')
- // $fields_info = array ('Место', 'Фильм', '±');
- global $do;
- global $compare_const,$compareall_const;
- $newstext='';
- $newsmark="";
- // НАЧАЛИ ВЫВОДИТЬ ОДНУ СТРОКУ
- if ($b['gross']==0) $zerogross=$i; // Значит, начиная с этого места - сборы не указаны
- if ($page=='boxanimedvd' || $page=='boxanimebluray' || $page=='boxanime')
- {
- if ($b['codename']!='')
- {
- if (mb_substr($b['codename'],0,1)=='_')
- {
- $code='<span style="color: #1A64B5;"'.($b['image']!=''?' onmouseover="this.style.cursor=\'help\'; Tip(\'<img src='.$b['image'].' width='.$b['width'].' height='.$b['height'].'>\')" onmouseout="UnTip()"':'').'>'.mb_substr($b['codename'],1).'</span>';
- } else
- if (mb_substr($b['codename'],0,8)=='/movies/')
- {
- $movie = mysql_fetch_array (q ("select russian, english, original from movies where codename='".mb_substr($b['codename'],8)."';"));
- $code='<a href="/movies/'.mb_substr($b['codename'],8).'/" style="text-decoration: none;"'.($b['image']!=''?' onmouseover="this.style.cursor=\'help\'; Tip(\'<img src='.$b['image'].' width='.$b['width'].' height='.$b['height'].'>\')" onmouseout="UnTip()"':'').'>«'.$movie['russian'].'»</a>';
- $codemark="[«".$movie['russian']."»](/movies/".mb_substr($b['codename'],8).")";
- } else
- if (mb_substr($b['codename'],0,4)=='/tv/')
- {
- $movie = mysql_fetch_array (q ("select russian, english from tv where codename='".mb_substr($b['codename'],4)."';"));
- $code='<a href="/tv/'.mb_substr($b['codename'],4).'/" style="text-decoration: none;"'.($b['image']!=''?' onmouseover="this.style.cursor=\'help\'; Tip(\'<img src='.$b['image'].' width='.$b['width'].' height='.$b['height'].'>\')" onmouseout="UnTip()"':'').'>«'.$movie['russian'].'»</a>';
- $codemark="[«".$movie['russian']."»](/tv/".mb_substr($b['codename'],4).")";
- } else
- {
- $anime = mysql_fetch_array (q ("select * from anime where codename='$b[codename]';"));
- if ($b['image']=='' && $anime['mainpicture']!='')
- {
- $b['image']=$anime['mainpicture'];
- if (mb_substr($anime['mainpicturelink'],0,32)=='/anime/' || mb_substr($anime['mainpicturelink'],0,7)=='/anime/')
- {
- if (mb_substr($anime['mainpicturelink'],0,32)=='/anime/') $anime['mainpicturelink']=mb_substr($anime['mainpicturelink'],32);
- else if (mb_substr($anime['mainpicturelink'],0,7)=='/anime/') $anime['mainpicturelink']=mb_substr($anime['mainpicturelink'],7);
- $exp=explode ('/',$anime['mainpicturelink']);
- $picinfo=explode(',',$anime[$exp[2].'info']);
- $b['width']=$picinfo[($exp[3]-1)*IMG_CONST+4];
- $b['height']=$picinfo[($exp[3]-1)*IMG_CONST+5];
- } else
- {
- $b['width']=240;
- $b['height']=240;
- }
- }
- $code='<a href="/anime/'.$b['codename'].'/" style="text-decoration: none;"'.($b['image']!=''?' onmouseover="this.style.cursor=\'help\'; Tip(\'<img src='.$b['image'].' width='.$b['width'].' height='.$b['height'].'>\')" onmouseout="UnTip()"':'').'>«'.$anime['russian'].'»</a>';
- $codemark="[«".$anime['russian']."»](/anime/".$b['codename'].")";
- }
- if ($b['addinfo']!='') $code.=' '.str_replace('<a href=','<a style="text-decoration: none;" href=',stripslashes(brackets($b['addinfo'])));
- if (($b['vol']!='' && $b['vol']!=0) || ($b['extra']!='' && $page!='boxanime')) $code.='<br />';
- if ($b['vol']!='' && $b['vol']!=0) $code.='<span class="box_bold">Том '.$b['vol'].'</span>';
- if ($b['subs_num']<2)
- {
- if ($b['vol']!='' && $b['extra']!='') $code.=' | ';
- if ($b['extra']!='') $code.=$b['extra'];
- }
- } else
- if ($b['words']>0)
- {
- $cc=explode (' ',$b['english']);
- if ($b['codename']!='') {
- if (mb_substr($b['codename'],0,8)=='/movies/')
- {
- $movie = mysql_fetch_array (q ("select russian, english, original from movies where codename='".mb_substr($b['codename'],8)."';"));
- $code='<a href="/movies/'.mb_substr($b['codename'],8).'/" style="text-decoration: none;">«'.$movie['russian'].'»</a> ';
- $codemark="[«".$movie['russian']."»](/movies/".mb_substr($b['codename'],8).")";
- } else
- {
- $anime = mysql_fetch_array (q ("select russian, english, original from anime where codename='$b[codename]';"));
- $code='<a href="/anime/'.$b['codename'].'/" style="text-decoration: none;">«'.$anime['russian'].'»</a> ';
- $codemark="[«".$anime['russian']."»](/anime/".$b['codename'].")";
- }
- for ($ci=$b['words']; $ci<sizeof($cc); $ci++)
- {
- $code.=$cc[$ci].' ';
- $codemark.=$cc[$ci].' ';
- }
- $code=substr($code,0,-1);
- $codemark=substr($codemark,0,-1);
- }
- else {
- $code='<span style="color: #1A64B5;"'.($b['image']!=''?' onmouseover="this.style.cursor=\'help\'; Tip(\'<img src='.$b['image'].' width='.$b['width'].' height='.$b['height'].'>\')" onmouseout="UnTip()"':'').'>';
- foreach ($cc as $key=>$c)
- {
- $code.=$c;
- if ($key==$b['words']-1) $code.='</span>';
- $code.=' ';
- $codemark.=$c;
- if ($key==$b['words']-1) $codemark.='</span>';
- $codemark.=' ';
- }
- $code=substr($code,0,-1);
- $codemark=substr($codemark,0,-1);
- }
- } else {
- $code=$b['english'];
- $codemark=$b['english'];
- }
- $movie=$code;
- $patt[0]='/(Vol|VOL|vol|Note|Shoot|take )(\.|\:)[0-9]+/';
- $patt[1]='/\([0-9]+\)/';
- $patt[2]='/\(Limited Edition\)/';
- $patt[3]='/\<Limited Edition\>/';
- $patt[4]='/(Blu-ray |DVD | |BD-|BD)BOX [IVX0-9]+/';
- $patt[5]='/(Blu-ray |DVD | |BD-|BD)BOX/';
- $newsmovie=$movie;
- $newsmoviemark=$codemark;
- if ($do && $page!='boxanime') $movie.='<input type="hidden" value="'.$b['id'].'" name=ids['.$i.']><br><input style="font-size: 11px;" type=text size="30" value="'.$b['codename'].'" name=codename['.$i.']><br><input style="font-size: 11px;" type=text size="1" value="'.$b['vol'].'" name=vol['.$i.']><textarea style="font-size: 11px; height: 19px; margin: 0 0 -5 0; padding: 0 0 0 0;" cols="30" name="addinfo['.$i.']">'.$b['addinfo'].'</textarea><br><input style="font-size: 11px;" type=text size="25" value="'.$b['extra'].'" name=extra['.$i.']><a href="http://www.animenewsnetwork.com/search?cx=016604166282602569737%3Aznd1ysjewre&q='.trim(preg_replace($patt,'',$b['original'])).'&sa=Search&cof=FORID%3A11" target="_blank">[A]</a> <a href="http://www.cdjapan.co.jp/detailview.html?KEY='.between(mb_strrchr($b['image'],'/'),'/','.jpg').'" target="_blank">[CD]</a>';
- } else
- {
- $code=$b['codename'];
- if (mb_substr($code,-1)=='_')
- {
- $movie=mb_substr($code,0,-1).'<br>';
- $m=array();
- }
- else
- if (mb_substr($code,0,7)=='/anime/')
- {
- $anime = mysql_fetch_array (q ("select russian, english, original from anime where codename='".mb_substr($code,7)."';"));
- $movie='<a href="/anime/'.mb_substr($code,7).'/">«'.$anime['russian'].'»</a><br>';
- $newsmovie=$movie;
- if ($anime['original']!='')
- {
- if (!$do || $page=='boxanime') $movie.=$anime['original'];
- //$newsmovie=$movie;
- }
- }
- else {
- $movies = q ("select russian, english, budget, posters, postersinfo from movies where codename='$code';");
- if ($movies) $m=mysql_fetch_array ($movies);
- if ($m['posters']!=0)
- {
- $post_arr=explode (',',$m['postersinfo']);
- $post_width=$post_arr[$m['posters']*IMG_CONST-4];
- $post_height=$post_arr[$m['posters']*IMG_CONST-3];
- $post_num=$post_arr[$m['posters']*IMG_CONST-8];
- $pst=' onmouseover="this.style.cursor=\'help\'; Tip(\'<img src=http://media.kino-govno.com/movies/'.substr($code,0,1).'/'.$code.'/posters/'.$code.'_'.$post_num.'s.jpg width='.$post_width.' height='.$post_height.'>\')" onmouseout="UnTip()"';
- } else $pst='';
- $movie='';
- $movie.='«<a href="/movies/'.$code.'/"'.$pst.'>'.$m['russian'].'</a>»<br>';
- $newsmovie=$movie;
- if ($m['english']!='')
- {
- if (!$do || $page=='boxanime') $movie.=$m['english'];
- $newsmovie=$movie;
- }
- }
- if ($do && $page!='boxanime') $movie.='<input type="hidden" value="'.$b['id'].'" name="ids['.$i.']" id="ids['.$i.']"><input class="txt" type=text width=30 value="'.$code.'" name="name['.$i.']" id="name['.$i.']">'.($page=='boxworld' && mb_substr($code,-1)=='_'?'<img src="/i/magnifying_glass_icon.png" onClick="window.open(\'/admin/movies_ad.php?id=\' + lowerit($(\'#name\\\['.$i.'\\\]\').val().substring(0,$(\'#name\\\['.$i.'\\\]\').val().length-1)) + \'&eng=\'+$(\'#name\\\['.$i.'\\\]\').val().substring(0,$(\'#name\\\['.$i.'\\\]\').val().length-1) + \'&gallerycode='.$i.'\', \'movie_search\', \'width=1150,height=500\');">':'');
- }
- if ($b['ch']==0) $ch=' '; else
- if ($b['ch']>0) $ch='+'.number_format($b['ch'],1,',','').'%';
- else $ch='−'.number_format(-$b['ch'],1,',','').'%';
- if ($b['chweek']==0) $chweek=' '; else
- if ($b['chweek']>0) $chweek='+'.number_format($b['chweek'],1,',','').'%';
- else $chweek='−'.number_format(-$b['chweek'],1,',','').'%';
- if ($page=='boxday' || $page=='boxdayrussia')
- {
- if (($b['gross']==$b['allgross'] && $b['gross']!=0) || ($b['days']<6 && $b['days']!=0)) $r=3; else if ($i%2==0) $r=1; else $r=2;
- }
- else
- if (($b['week']==1 && $b['week']!=0) || ($b['days']<8 && $b['days']!=0 && $page!='boxdate') || ($b['days']<6 && $b['days']!=0 && $page=='boxdate') || ($page=='boxalltime' && $select==$b['codename']) || ($b['gross']==$b['allgross'] && $b['gross']!=0)) $r=3; else if ($i%2==0) $r=1; else $r=2;
- if ($do && $b['codename']=='' && $f=='english') $r=4;
- if ($sub!=0) $r=5;
- $text.='
- <li'.($r==2?' class="row2"':"").($r==3?' class="new"':"").($sub!=0?' style=" display: none;" id="sub'.$sub.'_'.$b['id'].'"':'').'>';
- if ($i<=$newsrows) {
- $newstext.='
- <li'.($r==2?' class="row2"':"").($r==3?' class="new"':"").($sub!=0?' style=" display: none;" id="sub'.$sub.'_'.$b['id'].'"':'').'>';
- $newsmark.="\n";
- }
- foreach ($fields as $key => $f) {
- // if ($do) echo $f;
- $text.='
- <div class="'.
- ($f=='codename' || $f=='english'?'mov':'').
- ($f=='place'?'num':'').
- ($f=='days' || $f=='week' || $f=='territories' || $f=='weeks'?'days':'').
- ($f=='gross' || $f=='allgross'?'box':'').
- ($f=='theaters' || $f=='cost' || $f=='studio' || $f=='average' || $f=='weekend'?'cop':'').
- ($f=='compare'?'per':'').
- ($f=='ch'?'fal'.($b['ch']>0?' up':'').($b['ch']<0?' down':''):'').
- ($f=='chweek'?'fal'.($b['chweek']>0?' up':'').($b['chweek']<0?' down':''):'').
- '"'.
- ($f=='english' && ($page=='boxanimedvd' || $page=='boxanimebluray' || $page=='boxanime')?' id="td'.$b['place'].'"':'').
- '>'.
- ($f=='codename' || $f=='english'?$movie:'').
- ($f=='studio'?$b[$f]:'').
- ($f=='compare'?box_modify($b,$f,$page):'').
- (($f=='gross' || $f=='allgross') && ($page=='boxanimedvd' || $page=='boxanimebluray') && $do?'<input '.($f=='gross'?'onchange="if (document.getElementById(\'allgross['.$i.']\').value==\'0\' || document.getElementById(\'allgross['.$i.']\').value==\'\') document.getElementById(\'allgross['.$i.']\').value=document.getElementById(\'gross['.$i.']\').value" ':'').'style="width: 50px; font-size: 11px;" type=text value="'.($b[$f]==0?'':$b[$f]).'" name="'.$f.'['.$i.']" id="'.$f.'['.$i.']">'.'<br>'.box_modify($b,$f,$page):'').
- ($f!='codename' && $f!='english' && $f!='studio' && !(($f=='gross' || $f=='allgross') && ($page=='boxanimedvd' || $page=='boxanimebluray') && $do) && !($f=='place' && $page=='boxalltime') && $b[$f]!=0?box_modify($b,$f,$page):' ').
- ($f=='cost' && ($b['cost']==0 || $b['cost']=='-')?($m['budget']!=0?'$ '.number_format($m['budget'],0,',',' '):''):'').
- ($f=='place' && $page=='boxalltime'?$i:'').
- ($f=='place'?$chplace:'').
- '</div>';
- //
- if ($i<=$newsrows && $f!='chtheaters' && $f!='average' && $f!='days')
- {
- $newstext.='
- <div class="'.
- ($f=='codename' || $f=='english'?'mov':'').
- ($f=='place'?'num':'').
- ($f=='days' || $f=='week' || $f=='territories' || $f=='weeks'?'days':'').
- ($f=='gross' || $f=='allgross'?'box':'').
- ($f=='theaters' || $f=='cost' || $f=='studio' || $f=='average' || $f=='weekend'?'cop':'').
- ($f=='compare'?'per':'').
- ($f=='ch'?'fal'.($b['ch']>0?' up':'').($b['ch']<0?' down':''):'').
- ($f=='chweek'?'fal'.($b['chweek']>0?' up':'').($b['chweek']<0?' down':''):'').
- '"'.
- ($f=='english' && ($page=='boxanimedvd' || $page=='boxanimebluray' || $page=='boxanime')?' id="td'.$b['place'].'"':'').
- '>'.
- ($f=='codename' || $f=='english'?$newsmovie:'').
- ($f=='studio'?$b[$f]:'').
- ($f=='compare'?box_modify($b,$f,$page):'').
- ($f!='codename' && $f!='english' && $f!='studio' && !($f=='place' && $page=='boxalltime') && ($b[$f]!=0 || $b[$f]!='')?box_modify($b,$f,$page):'').
- ($f=='cost' && $b['cost']==0 && $m['budget']!=0?'$ '.number_format($m['budget'],0,',',' '):'').
- ($f=='place' && $page=='boxalltime'?$i:'').
- ($f=='place'?$chplace:'').
- '</div>';
- $newsmark.=
- ($f=='codename' || $f=='english'?$newsmovie:'').
- ($f=='studio'?$b[$f]:'').
- ($f=='compare'?$b[$f]:'').
- ($f!='codename' && $f!='english' && $f!='studio' && !($f=='place' && $page=='boxalltime') && $b[$f]!=0?$b[$f]:'').
- ($f=='cost' && $b['cost']==0 && $m['budget']!=0?'$ '.number_format($m['budget'],0,',',' '):'').
- ($f=='place' && $page=='boxalltime'?$i:'').
- ($f=='place'?$chplace:'').
- " | ";
- }
- //
- }
- if ($newsrows!=10 && $page=='boxanime') {
- $newstext.='<div class="cop">'.($b['type']==' bluray dvd '?'Blu-ray<br>DVD':'').($b['type']==' bluray '?'Blu-ray':'').($b['type']==' dvd '?'DVD':'').'</div>';
- $newsmark.=" | ".($b['type']==' bluray dvd '?'Blu-ray#DVD':'').($b['type']==' bluray '?'Blu-ray':'').($b['type']==' dvd '?'DVD':'');
- }
- if ($do && ($page=='boxanimedvd' || $page=='boxanimebluray'))
- $text.='<div class="cop"><a href="/admin/animeflowers.php?action=showsales&type=bluray&name='.$b['codename'].'" target="_blank" style="text-decoration: none;">BD</a><br><a href="/admin/animeflowers.php?action=showsales&type=dvd&name='.$b['codename'].'" target="_blank" style="text-decoration: none;">DVD</a>'.($b['temp']!=''?'<br><span class="dashed_link" onClick="$(\'#admininfo'.$b['place'].'\').toggle();">инфо</span>':'').'</td><input type="hidden" id="english'.$b['place'].'" value="'.$b['english'].'">
- <input type="hidden" id="words'.$b['place'].'" value="'.$b['words'].'">';
- else if ($page=='boxanime')
- $text.='<div class="cop">'.($b['subs_num']>1?'<span class="dotted blue" onClick="$(\'li[id*=sub'.$b['place'].']\').toggle();">':'').($b['type']==' bluray dvd '?'BD+DVD':'').($b['type']==' bluray '?'BD':'').($b['type']==' dvd '?'DVD':'').($b['subs_num']>1?'</span>':'').'</div>';
- $text.='
- </li>';
- // if ($b['temp']!='') $text.='<tr id="admininfo'.$b['place'].'" style="background: #FFFFFF;" class="hidden"><td colspan="6" style="padding-left: 15px; padding-top:5px; padding-bottom: 5px; border-top: 1px solid grey;border-bottom: 1px solid grey;"><span style="color: grey; cursor: hand; cursor: ponter; margin-right: 20px;" onClick="$(\'#admininfo'.$b['place'].'\').toggle();">×</span>'.$b['temp'].'</td></tr>';
- if ($i<=$newsrows) {
- $newstext.='
- </li>';
- $newsmark.="\n";
- }
- if ($i%2==0) $color='white'; else $color='black';
- // ЗАКОНЧИЛИ ВЫВОДИТЬ ОДНУ СТРОКУ
- return array ('text'=>$text, 'newstext'=>$newstext, 'newsmark'=>$newsmark);
- }
- function dodrop_anime ($date, $prev_date, $type)
- {
- // Сначала - изменения для каждого фильма по сравнению с предыдущей неделей
- $cur_gross=q("SELECT * FROM boxofficeanime".$type." WHERE date='$date'");
- while ($cg=mysql_fetch_array($cur_gross))
- {
- $prev_gross=q("SELECT * FROM boxofficeanime".$type." WHERE date='$prev_date' AND codename='".addslashes($cg['codename'])."' AND vol='$cg[vol]' AND extra='".addslashes($cg['extra'])."' AND addinfo='".addslashes($cg['addinfo'])."' AND codename!=''");
- if (mysql_num_rows($prev_gross)>0) {
- $prev_g=mysql_fetch_array($prev_gross);
- $pg=$prev_g['gross'];
- $pp=$prev_g['place'];
- $pw=$prev_g['words'];
- } else
- {
- $pg=0;
- $pp=0;
- $pw=0;
- }
- if ($pg!=0 && $cg['gross']!=0) $dr=($cg['gross']/$pg-1)*100;
- else $dr=0;
- $vol=intval($cg['vol'])-1;
- if ($vol>0 && $cg['weeks']!=0)
- {
- $p=fq("SELECT * FROM boxofficeanime".$type." WHERE codename='".mysql_real_escape_string($cg['codename'])."' AND vol='".$vol."' AND addinfo='".mysql_real_escape_string($cg['addinfo'])."' AND extra='".mysql_real_escape_string($cg['extra'])."' AND codename!='' AND weeks=$cg[weeks]");
- if ($p)
- {
- $chvol=($p['gross']!=0 && $cg['gross']!=0?($cg['gross']/$p['gross']-1)*100:0);
- $chvolall=($p['allgross']!=0 && $cg['allgross']!=0?($cg['allgross']/$p['allgross']-1)*100:0);
- } else
- {
- $chvol=0;
- $p=fq("SELECT * FROM boxofficeanime".$type." WHERE codename='".mysql_real_escape_string($cg['codename'])."' AND vol='".$vol."' AND addinfo='".mysql_real_escape_string($cg['addinfo'])."' AND extra='".mysql_real_escape_string($cg['extra'])."' AND codename!='' AND weeks<".intval($cg['weeks'])." ORDER BY weeks DESC LIMIT 1");
- if ($p)
- $chvolall=($p['allgross']!=0 && $cg['allgross']!=0?($cg['allgross']/$p['allgross']-1)*100:0);
- else
- $chvolall=0;
- }
- } else
- {
- $chvol=0;
- $chvolall=0;
- }
- q ("UPDATE boxofficeanime".$type." SET chvol=".floatval($chvol).", chvolall=".floatval($chvolall).", ch=$dr, lastplace='$pp'".($pw!=0?", words=$pw":"")." WHERE id=$cg[id]");
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement