Создать доп поле date_for_block одна строка, заполнять по желанию.@kild что то у меня не один сериал в блоке не отображается... или должна быть включена опция "Поднимать новость?"??? Если да то можно как то поправить чтоб сериал не поднимался... по факту нужен БЛОК...
$myNewDate = ( $moonserials_options['allow_news_update'] != 0 ) ? ", `date` = '" . date('Y-m-d H:i:s') . "'" : false;
$xfields_n['date_for_block'] = date('Y-m-d H:i:s');
$db->query("SELECT id, title, category, date, alt_name, short_story, xfields FROM ".PREFIX."_post WHERE date >= DATE_SUB(CURRENT_DATE, INTERVAL {$moonserials_options['ms_block_day']} DAY) $where_date AND approve='1' and category {$sqlcat}{$sqlnotcat}{$sqlower} GROUP BY date ORDER BY date DESC LIMIT 0 , {$moonserials_options['ms_block_limit']}");
$db->query("SELECT id, title, category, date, STR_TO_DATE(SUBSTRING_INDEX( SUBSTRING_INDEX( xfields, 'date_for_block|', -1 ) , '||', 1 ), '%Y-%m-%d') as datex, alt_name, short_story, xfields FROM ".PREFIX."_post WHERE STR_TO_DATE(SUBSTRING_INDEX( SUBSTRING_INDEX( xfields, 'date_for_block|', -1 ) , '||', 1 ), '%Y-%m-%d') > CURDATE() - INTERVAL 7 DAYS $where_date AND approve='1' and CHARACTER_LENGTH(SUBSTRING_INDEX( SUBSTRING_INDEX( xfields, 'date_for_block|', -1 ) , '||', 1 )) > 0 AND SUBSTRING_INDEX( SUBSTRING_INDEX( xfields, 'date_for_block|', -1 ) , '||', 1 ) NOT LIKE '%|%' and category {$sqlcat}{$sqlnotcat}{$sqlower} GROUP BY datex ORDER BY datex DESC LIMIT 0 , {$moonserials_options['ms_block_limit']}");
$lastnews[substr($row['date'], 0, 10)][$row['id']] = $row;
$lastnews[substr($row['datex'], 0, 10)][$row['id']] = $row;
странно. ладн, буду разбираться. где-то ошибка у меня висит значит.женский доктор, улицы разбитых фонарей все работает
пацанки без ид кп
хдлайт, когда новость добавляешь.Какой модуль не находит? Хдлайт или мунсериалс?
Потому что нужно модуль сделать на ajax а автор этого не делает. Есть аналог - Serial Block, не создает нагрузку на страницу.Заметил как поставил модуль возросла нагрузка на страницу с сериалами. У кого еще такая беда??? Может кто то готов оптимизировать за деньги его???
Посмотреть вложение 2078
PunPun да только я тебе не раз писал помочь за деньги поправить его... он просто перестал у меня корректно работать не буду же тебя постоянно бомбить с вопросом о помощи... поэтому и решил ставить обратно данный модуль...Потому что нужно модуль сделать на ajax а автор этого не делает. Есть аналог - Serial Block, не создает нагрузку на страницу.
Он прекрасно работает если его настроить нормально.PunPun да только я тебе не раз писал помочь за деньги поправить его... он просто перестал у меня корректно работать не буду же тебя постоянно бомбить с вопросом о помощи... поэтому и решил ставить обратно данный модуль...
Всем привет. Везде читаю и везде пишут про этот кастыль . Но проблема в том что у меня например нет такого файла engine/modules/main.php Версия DLE 10.3 Как быть в таком случаи ?в engine/modules/main.php можно запилить такой костыль
найти
выше вставитьКод:echo $tpl->result['main'];
Таким образом все ссылки мунвалк будут через их https домен.Код:$tpl->result['main'] = str_replace("http://moonwalk.cc/",'//streamguard.cc/',$tpl->result['main']);
Ну, а лучше всего купить новую версию модуля там вроде как есть https.
<?php
if ( !defined('DATALIFEENGINE'))
die("Go fuck yourself!");
include ( 'engine/data/moonserials_options.php' );
global $row;
$myConfig = array( 'cachePrefix' => $moonserials_options['cashe_prefix_dle'], 'cacheSuffix' => !empty( $cacheSuffix ) ? $cacheSuffix : false, 'id' => $row['id'], );
if ( $config['charset'] == 'windows-1251' )
{
function encoding(& $data, $in, $to)
{
if ( is_array($data))
{
foreach ( $data as $key => $value )
{
if ( is_array($data[$key]))
{
encoding($data[$key], $in, $to);
}
else
{
$data[$key] = iconv($in, $to, $value);
}
}
}
else
{
$data = iconv($in, $to, $data);
}
}
}
if ( $moonserials_options['allow_module_on'] != 0 )
{
$cacheName = md5(implode('_', $myConfig));
$myModule = false;
$allow_cache = ( $config['version_id'] >= '10.2' ) ? $config['allow_cache'] == '1' : $config['allow_cache'] == "yes";
if ( !$allow_cache )
{
if ( $config['version_id'] >= '10.2' )
$config['allow_cache'] = '1';
else
$config['allow_cache'] = "yes";
$is_change = true;
}
$myModule = dle_cache($myConfig['cachePrefix'], $cacheName . $config['skin'], $myConfig['cacheSuffix']);
if ( $myModule === false )
{
$post_id = $row['id'];
$xfieldsdata = xfieldsdataload($row['xfields']);
$kinopoisk_id = $xfieldsdata[$moonserials_options['field_kpid']];
if ( $xfieldsdata[$moonserials_options['field_season']] AND $xfieldsdata[$moonserials_options['field_series']] AND $xfieldsdata[$moonserials_options['field_season']] !== $moonserials_options['if_series_ower'] )
{
$str = strpos($xfieldsdata[$moonserials_options['field_season']], " ");
$seasonTemp = substr($xfieldsdata[$moonserials_options['field_season']], 0, $str);
$str = strpos($xfieldsdata[$moonserials_options['field_series']], " ");
$seriesTemp = substr($xfieldsdata[$moonserials_options['field_series']], 0, $str);
}
else
{
$seasonTemp = false;
$seriesTemp = false;
}
if ( $moonserials_options['allow_module_new'] )
{
$tpl1 = new dle_template();
$tpl1->dir = TEMPLATE_DIR;
$tpl1->load_template('/moonserials/moonserials_iframe.tpl');
}
$xfields = array( );
foreach ( ( array ) $xfieldsdata as $key => $value )
$xfields[] = $key . "|" . str_replace('|', '|', $value);
$xfields = implode('||', $xfields);
$xfields = $db->safesql($xfields);
if ( $xfieldsdata[$moonserials_options['field_status_name']] == $moonserials_options['field_status'] )
{
if ( $moonserials_options['allow_fields_spy'] )
{
if ( !$xfieldsdata[$moonserials_options['field_season']] )
{
$xfields = $xfields . '||' . $moonserials_options['field_season'] . '|' . $moonserials_options['if_series_ower'] . '';
}
else
{
$s = '||' . $moonserials_options['field_season'] . '|' . $xfieldsdata[$moonserials_options['field_season']] . '';
$r = '||' . $moonserials_options['field_season'] . '|' . $moonserials_options['if_series_ower'] . '';
$xfields = str_replace($s, $r, $xfields);
}
if ( $xfieldsdata[$moonserials_options['field_series']] )
{
$s = '||' . $moonserials_options['field_series'] . '|' . $xfieldsdata[$moonserials_options['field_series']] . '';
$r = '';
$xfields = str_replace($s, $r, $xfields);
}
$db->query("UPDATE " . PREFIX . "_post SET `xfields` = '$xfields' WHERE id = {$post_id}");
}
if ( $moonserials_options['allow_module_new'] )
{
$tpl1->set('[ower]', "");
$tpl1->set('[/ower]', "");
$tpl1->set_block("'\\[not-ower\\](.*?)\\[/not-ower\\]'si", "");
}
}
else
{
if ( $moonserials_options['allow_module_new'] )
{
$tpl1->set_block("'\\[ower\\](.*?)\\[/ower\\]'si", "");
$tpl1->set_block("'\\[not-ower\\](.*?)\\[/not-ower\\]'si", "\\1");
}
}
if ( $curl = curl_init())
{
curl_setopt($curl, CURLOPT_URL, 'https://streamguard.cc/api/videos.json?kinopoisk_id=' . $kinopoisk_id . '&api_token=' . $moonserials_options['api_token'] . '');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($curl);
$output_tr = json_decode($out, true);
curl_close($curl);
}
if ( $config['charset'] == 'windows-1251' )
{
encoding($output_tr, "UTF-8", "WINDOWS-1251");
}
if ( !$output_tr or $output_tr['error'] == 'videos_not_found' )
{
if ( $moonserials_options['allow_module_new'] )
{
if ( !$xfieldsdata[$moonserials_options['field_season_iframe']] )
{
$tpl1->set('[error]', "");
$tpl1->set('[/error]', "");
$tpl1->set_block("'\\[not-error\\](.*?)\\[/not-error\\]'si", "");
$tpl1->set_block("'\\[soon\\](.*?)\\[/soon\\]'si", "");
$tpl1->set_block("'\\[not-soon\\](.*?)\\[/not-soon\\]'si", "\\1");
}
else
{
$tpl1->set_block("'\\[error\\](.*?)\\[/error\\]'si", "");
$tpl1->set_block("'\\[not-error\\](.*?)\\[/not-error\\]'si", "\\1");
$tpl1->set('[soon]', "");
$tpl1->set('[/soon]', "");
$tpl1->set_block("'\\[not-soon\\](.*?)\\[/not-soon\\]'si", "");
}
$tpl1->set_block("'\\[studios\\](.*?)\\[/studios\\]'si", "");
$tpl1->set_block("'\\[not-studios\\](.*?)\\[/not-studios\\]'si", "\\1");
}
}
else
{
if ( $moonserials_options['allow_module_new'] )
{
$tpl1->set_block("'\\[error\\](.*?)\\[/error\\]'si", "");
$tpl1->set_block("'\\[not-error\\](.*?)\\[/not-error\\]'si", "\\1");
$tpl1->set('{title}', $output_tr[0]['title_ru']);
if ( count($output_tr) == 1 )
{
$tpl1->set_block("'\\[studios\\](.*?)\\[/studios\\]'si", "");
$tpl1->set_block("'\\[not-studios\\](.*?)\\[/not-studios\\]'si", "\\1");
}
else
{
$tpl1->set('[studios]', "");
$tpl1->set('[/studios]', "");
$tpl1->set_block("'\\[not-studios\\](.*?)\\[/not-studios\\]'si", "");
}
$tpl2 = new dle_template();
$tpl2->dir = TEMPLATE_DIR;
$tpl2->load_template('/moonserials/moonserials_iframe_title.tpl');
$tpl3 = new dle_template();
$tpl3->dir = TEMPLATE_DIR;
$tpl3->load_template('/moonserials/moonserials_iframe_content.tpl');
}
foreach ( ( array ) $output_tr as $kk => $vv )
{
$seasonfound = 0;
$seriesfound = 0;
if ( $curl = curl_init())
{
curl_setopt($curl, CURLOPT_URL, 'https://streamguard.cc/api/serial_episodes.json?kinopoisk_id=' . $kinopoisk_id . '&api_token=' . $moonserials_options['api_token'] . '&translator_id=' . $vv['translator_id'] . '');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$out = curl_exec($curl);
$output_sr = json_decode($out, true);
curl_close($curl);
}
if ( $moonserials_options['disable_sub'] > 0 AND $vv['translator'] == 'Субтитры' )
continue;
if ( $config['charset'] == 'windows-1251' )
{
encoding($output_sr, "UTF-8", "WINDOWS-1251");
}
$title_ru = $vv['title_ru'];
if ( !$vv['translator'] )
{
$vv['translator'] = 'Неизвестно';
}
elseif ( $vv['translator'] == 'двухголосый закадровый' )
{
$vv['translator'] = 'Двухголосый';
}
elseif ( $vv['translator'] == 'многоголосый закадровый' )
{
$vv['translator'] = 'Многоголосый';
}
elseif ( $vv['translator'] == 'одноголосый закадровый' )
{
$vv['translator'] = 'Одноголосый';
}
if ( $moonserials_options['field_studios_sp'] )
{
$studios_sp = !$studios_sp ? $vv['translator'] : $studios_sp . ", " . $vv['translator'];
}
foreach ( ( array ) $output_sr["season_episodes_count"] as $kkk => $vvv )
{
if ( $vvv["season_number"] > $season )
{
$season = $vvv["season_number"];
$seriesA = $vvv["episodes"];
$seriesC = $vvv["episodes_count"];
}
if ( $moonserials_options['allow_module_new'] )
{
if ( $xfieldsdata[$moonserials_options['field_season_iframe']] )
{
if ( $vvv["season_number"] == $xfieldsdata[$moonserials_options['field_season_iframe']] )
{
$seasonfound = 1;
if ( $xfieldsdata[$moonserials_options['field_series_iframe']] )
{
foreach ( ( array ) $vvv["episodes"] as $vvvvv )
{
if ( $vvvvv == $xfieldsdata[$moonserials_options['field_series_iframe']] )
{
$seriesfound = 1;
break;
}
}
}
}
}
}
foreach ( ( array ) $seriesA as $vvvv )
{
if ( $vvvv == 0 )
{
$seriesT = - 1;
}
}
if ( $seriesT == - 1 AND $seriesC == 1 )
{
$series = $moonserials_options['if_pilot_series'];
}
else
{
$series = max($seriesA);
}
}
$tabs[] = array( 'translator' => $vv['translator'], 'iframe_url' => $vv['iframe_url'], 'season' => $season, 'series' => $series, 'seasonfound' => $seasonfound, 'seriesfound' => $seriesfound );
unset( $season );
unset( $series );
usleep(100000);
}
foreach ( ( array ) $tabs as $k => $v )
{
if ( $v['series'] == $moonserials_options['if_pilot_series'] )
$v['series'] = 0;
if ( $v['translator'] == "Субтитры" )
$v['series'] = $v['series'] - 0.5;
$se[$k] = $v['season'];
$ep[$k] = $v['series'];
}
array_multisort($se, SORT_NUMERIC, SORT_DESC, $ep, SORT_NUMERIC, SORT_DESC, $tabs);
if ( $moonserials_options['allow_module_new'] )
{
foreach ( ( array ) $tabs as $tabskey => $tabsvalue )
{
if ( $xfieldsdata[$moonserials_options['field_season_iframe']] AND $xfieldsdata[$moonserials_options['field_series_iframe']] )
{
if ( $tabsvalue['seasonfound'] > 0 AND $tabsvalue['seriesfound'] > 0 )
{
$tpl2->set('{ms-title}', $tabsvalue['translator']);
$tpl2->compile('tabs-title');
$ifrm = '' . $tabsvalue['iframe_url'] . '?season=' . $xfieldsdata[$moonserials_options['field_season_iframe']] . '&episode=' . $xfieldsdata[$moonserials_options['field_series_iframe']] . '&nocontrols=1';
$tpl3->set('{ms-content}',$ifrm);
$tpl3->compile('tabs-content');
}
}
elseif ( $xfieldsdata[$moonserials_options['field_season_iframe']] AND !$xfieldsdata[$moonserials_options['field_series_iframe']] )
{
if ( $tabsvalue['seasonfound'] > 0 )
{
$tpl2->set('{ms-title}', $tabsvalue['translator']);
$tpl2->compile('tabs-title');
$ifrm = '' . $tabsvalue['iframe_url'] . '?season=' . $xfieldsdata[$moonserials_options['field_season_iframe']] . '';
$tpl3->set('{ms-content}', $ifrm);
$tpl3->compile('tabs-content');
}
}
elseif ( !$xfieldsdata[$moonserials_options['field_season_iframe']] AND !$xfieldsdata[$moonserials_options['field_series_iframe']] )
{
$tpl2->set('{ms-title}', $tabsvalue['translator']);
$tpl2->compile('tabs-title');
$tpl3->set('{ms-content}', $tabsvalue['iframe_url']);
$tpl3->compile('tabs-content');
}
}
$tpl1->set('{season}', $tabs[0]['season']);
$tpl1->set('{studios}', $tabs[0]['translator']);
if ( $moonserials_options['add_series_one_tpl'] )
{
$tpl1->set('{series}', $tabs[0]['series'] + 1);
}
else
{
$tpl1->set('{series}', $tabs[0]['series']);
}
}
$season = $tabs[0]['season'];
$studios = $tabs[0]['translator'];
$series = $tabs[0]['series'];
$series1 = $moonserials_options['add_series_one'] > 0 ? $tabs[0]['series'] + 1 . " серия" : false;
$series2 = $tabs[0]['series'] + 1 . " серия";
if ( $moonserials_options['allow_module_new'] )
{
if ( $season < $xfieldsdata[$moonserials_options['field_season_iframe']] OR ( $xfieldsdata[$moonserials_options['field_season_iframe']] == $season AND $series < $xfieldsdata[$moonserials_options['field_series_iframe']] ))
{
$tpl1->set('[soon]', "");
$tpl1->set('[/soon]', "");
$tpl1->set_block("'\\[not-soon\\](.*?)\\[/not-soon\\]'si", "");
}
else
{
$tpl1->set_block("'\\[soon\\](.*?)\\[/soon\\]'si", "");
$tpl1->set_block("'\\[not-soon\\](.*?)\\[/not-soon\\]'si", "\\1");
}
}
if ( $xfieldsdata[$moonserials_options['field_season_iframe']] )
{
$season = $xfieldsdata[$moonserials_options['field_season_iframe']];
if ( $moonserials_options['allow_module_new'] )
{
$tpl1->set('{season}', $xfieldsdata[$moonserials_options['field_season_iframe']]);
}
}
if ( $xfieldsdata[$moonserials_options['field_series_iframe']] )
{
$series = $xfieldsdata[$moonserials_options['field_series_iframe']];
if ( $moonserials_options['allow_module_new'] )
{
$tpl1->set('{series}', $xfieldsdata[$moonserials_options['field_series_iframe']]);
}
}
if ( $season AND !$seasonTemp AND $series AND !$seriesTemp AND $xfieldsdata[$moonserials_options['field_status_name']] !== $moonserials_options['field_status'] )
{
$season = $season . " сезон";
$series = $series . " серия";
if ( !$xfieldsdata[$moonserials_options['field_season']] OR !$xfieldsdata[$moonserials_options['field_series']] )
{
if ( !$xfieldsdata[$moonserials_options['field_season']] )
{
$xfields = $xfields . '||' . $moonserials_options['field_season'] . '|' . $season . '';
}
if ( !$xfieldsdata[$moonserials_options['field_series']] AND $series1 )
{
$xfields = $xfields . '||' . $moonserials_options['field_series'] . '|' . $series1 . '';
}
elseif ( !$xfieldsdata[$moonserials_options['field_series']] AND !$series1 )
{
$xfields = $xfields . '||' . $moonserials_options['field_series'] . '|' . $series . '';
}
if ( !$xfieldsdata[$moonserials_options['field_studios']] AND $studios AND $studios !== "Неизвестно" AND $moonserials_options['field_studios'] )
{
$xfields = $xfields . '||' . $moonserials_options['field_studios'] . '|' . $studios . '';
}
if ( !$xfieldsdata[$moonserials_options['field_title_ru']] AND $moonserials_options['field_title_ru'] AND $title_ru )
{
$xfields = $xfields . '||' . $moonserials_options['field_title_ru'] . '|' . $title_ru . '';
}
if ( !$xfieldsdata[$moonserials_options['field_studios_sp']] AND $studios_sp AND $moonserials_options['field_studios_sp'] )
{
$xfields = $xfields . '||' . $moonserials_options['field_studios_sp'] . '|' . $studios_sp . '';
}
$db->query("UPDATE " . PREFIX . "_post SET `xfields` = '$xfields' WHERE id = {$post_id}");
}
}
elseif ( $seasonTemp AND $seriesTemp AND $season > $seasonTemp OR $series > $seriesTemp AND $xfieldsdata[$moonserials_options['field_status_name']] !== $moonserials_options['field_status'] )
{
$season = $season . " сезон";
$series = $series . " серия";
$s = '||' . $moonserials_options['field_season'] . '|' . $xfieldsdata[$moonserials_options['field_season']] . '';
$r = '||' . $moonserials_options['field_season'] . '|' . $season . '';
$xfields = str_replace($s, $r, $xfields);
if ( $series1 )
{
$s = '||' . $moonserials_options['field_series'] . '|' . $xfieldsdata[$moonserials_options['field_series']] . '';
$r = '||' . $moonserials_options['field_series'] . '|' . $series1 . '';
$xfields = str_replace($s, $r, $xfields);
}
else
{
$s = '||' . $moonserials_options['field_series'] . '|' . $xfieldsdata[$moonserials_options['field_series']] . '';
$r = '||' . $moonserials_options['field_series'] . '|' . $series . '';
$xfields = str_replace($s, $r, $xfields);
}
if ( $studios AND $studios !== "Неизвестно" AND $moonserials_options['field_studios'] )
{
$xfields = $xfields . '||' . $moonserials_options['field_studios'] . '|' . $studios . '';
}
elseif ( $studios AND $studios !== "Неизвестно" AND $moonserials_options['field_studios'] )
{
$s = '||' . $moonserials_options['field_studios'] . '|' . $xfieldsdata[$moonserials_options['field_studios']] . '';
$r = '||' . $moonserials_options['field_studios'] . '|' . $studios . '';
$xfields = str_replace($s, $r, $xfields);
}
if ( !$xfieldsdata[$moonserials_options['field_title_ru']] AND $moonserials_options['field_title_ru'] AND $title_ru )
{
$xfields = $xfields . '||' . $moonserials_options['field_title_ru'] . '|' . $title_ru . '';
}
if ( !$xfieldsdata[$moonserials_options['field_studios_sp']] AND $studios_sp AND $moonserials_options['field_studios_sp'] )
{
$xfields = $xfields . '||' . $moonserials_options['field_studios_sp'] . '|' . $studios_sp . '';
}
elseif ( $studios_sp AND $moonserials_options['field_studios_sp'] )
{
$s = '||' . $moonserials_options['field_studios_sp'] . '|' . $xfieldsdata[$moonserials_options['field_studios_sp']] . '';
$r = '||' . $moonserials_options['field_studios_sp'] . '|' . $studios_sp . '';
$xfields = str_replace($s, $r, $xfields);
}
if ( $moonserials_options['allow_news_update'] )
{
$myNewDate = ( $moonserials_options['allow_news_update'] != 0 ) ? ", `date` = '" . date('Y-m-d H:i:s') . "'" : false;
}
if ( $moonserials_options['allow_news_title_update'] )
{
$ms_title_date = !empty( $moonserials_options['ms_title_date'] ) ? langdate($moonserials_options['ms_title_date']) : false;
$ms_title_preffix = !empty( $moonserials_options['ms_title_preffix'] ) ? $db->safesql(trim(strip_tags(stripslashes($moonserials_options['ms_title_preffix'])))) . " " : false;
$ms_title_year = !empty( $moonserials_options['ms_title_year'] ) ? trim(strip_tags(stripslashes($xfieldsdata[$moonserials_options['ms_title_year']]))) . " " : false;
$ms_title_t1 = !empty( $moonserials_options['ms_title_t1'] ) ? $db->safesql(trim(strip_tags(stripslashes($moonserials_options['ms_title_t1'])))) . " " : false;
$ms_title_t2 = !empty( $moonserials_options['ms_title_t2'] ) ? $db->safesql(trim(strip_tags(stripslashes($moonserials_options['ms_title_t2'])))) . " " : false;
$ms_title_field = !empty( $moonserials_options['ms_title_field'] ) ? $db->safesql(trim(strip_tags(stripslashes($xfieldsdata[$moonserials_options['ms_title_field']])))) . " " : false;
if ( $moonserials_options['ms_title_series_add'] > 0 )
{
if ( $moonserials_options['ms_title_season'] AND $moonserials_options['ms_title_series'] )
{
if ( $moonserials_options['ms_title_season_one'] AND $season == "1 сезон" )
{
$myModule_title = $series2 . " ";
}
else
{
$myModule_title = $season . " " . $series2 . " ";
}
}
elseif ( !$moonserials_options['ms_title_season'] AND $moonserials_options['ms_title_series'] )
{
$myModule_title = $series2 . " ";
}
elseif ( $moonserials_options['ms_title_season'] AND !$moonserials_options['ms_title_series'] )
{
if ( $moonserials_options['ms_title_season_one'] AND $season == "1 сезон" )
{
$myModule_title = '';
}
else
{
$myModule_title = $series2 . " ";
}
}
}
else
{
if ( $moonserials_options['ms_title_season'] AND $moonserials_options['ms_title_series'] )
{
if ( $moonserials_options['ms_title_season_one'] AND $season == "1 сезон" )
{
$myModule_title = $series . " ";
}
else
{
$myModule_title = $season . " " . $series . " ";
}
}
elseif ( !$moonserials_options['ms_title_season'] AND $moonserials_options['ms_title_series'] )
{
$myModule_title = $series . " ";
}
elseif ( $moonserials_options['ms_title_season'] AND !$moonserials_options['ms_title_series'] )
{
if ( $moonserials_options['ms_title_season_one'] AND $season == "1 сезон" )
{
$myModule_title = '';
}
else
{
$myModule_title = $series . " ";
}
}
}
$ms_title_up = ", `metatitle`='" . $ms_title_preffix . $title_ru . " " . $ms_title_year . $ms_title_t1 . $myModule_title . $ms_title_t2 . $ms_title_field . $ms_title_date . "'";
}
if ( $moonserials_options['allow_news_cpu_update'] )
{
$ms_cpu_date = !empty( $moonserials_options['ms_cpu_date'] ) ? totranslit(langdate($moonserials_options['ms_cpu_date'])) : false;
$ms_cpu_preffix = !empty( $moonserials_options['ms_cpu_preffix'] ) ? totranslit($moonserials_options['ms_cpu_preffix']) . '-' : false;
$ms_cpu_year = !empty( $moonserials_options['ms_cpu_year'] ) ? totranslit($xfieldsdata[$moonserials_options['ms_cpu_year']]) . '-' : false;
$ms_cpu_t1 = !empty( $moonserials_options['ms_cpu_t1'] ) ? totranslit($moonserials_options['ms_cpu_t1']) . '-' : false;
$ms_cpu_t2 = !empty( $moonserials_options['ms_cpu_t2'] ) ? totranslit($moonserials_options['ms_cpu_t2']) . '-' : false;
$ms_cpu_field = !empty( $moonserials_options['ms_cpu_field'] ) ? totranslit($xfieldsdata[$moonserials_options['ms_cpu_field']]) . "_" : false;
$title_ru_cpu = totranslit($title_ru) . '-';
if ( $moonserials_options['ms_cpu_series_add'] > 0 )
{
if ( $moonserials_options['ms_cpu_season'] AND $moonserials_options['ms_cpu_series'] )
{
if ( $moonserials_options['ms_cpu_season_one'] AND $season == "1 сезон" )
{
$myModule_cpu = $series2;
}
else
{
$myModule_cpu = $season . "-" . $series2;
}
}
elseif ( !$moonserials_options['ms_cpu_season'] AND $moonserials_options['ms_cpu_series'] )
{
$myModule_cpu = $series2;
}
elseif ( $moonserials_options['ms_cpu_season'] AND !$moonserials_options['ms_cpu_series'] )
{
if ( $moonserials_options['ms_cpu_season_one'] AND $season == "1 сезон" )
{
$myModule_cpu = '';
}
else
{
$myModule_cpu = $season;
}
}
}
else
{
if ( $moonserials_options['ms_cpu_season'] AND $moonserials_options['ms_cpu_series'] )
{
if ( $moonserials_options['ms_cpu_season_one'] AND $season == "1 сезон" )
{
$myModule_cpu = $series;
}
else
{
$myModule_cpu = $season . "-" . $series;
}
}
elseif ( !$moonserials_options['ms_cpu_season'] AND $moonserials_options['ms_cpu_series'] )
{
$myModule_cpu = $series;
}
elseif ( $moonserials_options['ms_cpu_season'] AND !$moonserials_options['ms_cpu_series'] )
{
if ( $moonserials_options['ms_cpu_season_one'] AND $season == "1 сезон" )
{
$myModule_cpu = '';
}
else
{
$myModule_cpu = $season;
}
}
}
$myModule_cpu = totranslit($myModule_cpu);
$myModule_cpu = $myModule_cpu . '-';
$ms_cpu_up = $ms_cpu_preffix . $title_ru_cpu . $ms_cpu_year . $ms_cpu_t1 . $myModule_cpu . $ms_cpu_t2 . $ms_cpu_field . $ms_cpu_date;
if ( substr($ms_cpu_up, - 1) == "-" )
{
$ms_cpu_up = substr($ms_cpu_up, 0, - 1);
}
$ms_cpu_up = ", `alt_name`='" . $ms_cpu_up . "'";
}
if ( $moonserials_options['allow_news_title2_update'] )
{
$ms_title2_date = !empty( $moonserials_options['ms_title2_date'] ) ? langdate($moonserials_options['ms_title2_date']) . " " : false;
$ms_title2_preffix = !empty( $moonserials_options['ms_title2_preffix'] ) ? $db->safesql(trim(strip_tags(stripslashes($moonserials_options['ms_title2_preffix'])))) . " " : false;
$ms_title2_year = !empty( $moonserials_options['ms_title2_year'] ) ? trim(strip_tags(stripslashes($xfieldsdata[$moonserials_options['ms_title2_year']]))) . " " : false;
$ms_title2_t1 = !empty( $moonserials_options['ms_title2_t1'] ) ? $db->safesql(trim(strip_tags(stripslashes($moonserials_options['ms_title2_t1'])))) . " " : false;
$ms_title2_t2 = !empty( $moonserials_options['ms_title2_t2'] ) ? $db->safesql(trim(strip_tags(stripslashes($moonserials_options['ms_title2_t2'])))) . " " : false;
$ms_title2_field = !empty( $moonserials_options['ms_title2_field'] ) ? $db->safesql(trim(strip_tags(stripslashes($xfieldsdata[$moonserials_options['ms_title2_field']])))) . " " : false;
if ( $moonserials_options['ms_title2_series_add'] > 0 )
{
if ( $moonserials_options['ms_title2_season'] AND $moonserials_options['ms_title2_series'] )
{
if ( $moonserials_options['ms_title2_season_one'] AND $season == "1 сезон" )
{
$myModule_title2 = $series2 . " ";
}
else
{
$myModule_title2 = $season . " " . $series2 . " ";
}
}
elseif ( !$moonserials_options['ms_title2_season'] AND $moonserials_options['ms_title2_series'] )
{
$myModule_title2 = $series2 . " ";
}
elseif ( $moonserials_options['ms_title2_season'] AND !$moonserials_options['ms_title2_series'] )
{
if ( $moonserials_options['ms_title2_season_one'] AND $season == "1 сезон" )
{
$myModule_title2 = '';
}
else
{
$myModule_title2 = $season . " ";
}
}
}
else
{
if ( $moonserials_options['ms_title2_season'] AND $moonserials_options['ms_title2_series'] )
{
if ( $moonserials_options['ms_title2_season_one'] AND $season == "1 сезон" )
{
$myModule_title2 = $series . " ";
}
else
{
$myModule_title2 = $season . " " . $series . " ";
}
}
elseif ( !$moonserials_options['ms_title2_season'] AND $moonserials_options['ms_title2_series'] )
{
$myModule_title2 = $series . " ";
}
elseif ( $moonserials_options['ms_title2_season'] AND !$moonserials_options['ms_title2_series'] )
{
if ( $moonserials_options['ms_title2_season_one'] AND $season == "1 сезон" )
{
$myModule_title2 = '';
}
else
{
$myModule_title2 = $season . " ";
}
}
}
$ms_title2_up = ", `title`='" . $ms_title2_preffix . $title_ru . " " . $ms_title2_year . $ms_title2_t1 . $myModule_title2 . $ms_title2_t2 . $ms_title2_field . $ms_title2_date . "'";
}
$db->query("UPDATE " . PREFIX . "_post SET `xfields` = '$xfields' {$myNewDate} {$ms_title_up} {$ms_title2_up} {$ms_cpu_up} WHERE id = {$post_id}");
if ( $moonserials_options['sendpm'] AND !$xfieldsdata[$moonserials_options['field_season_iframe']] )
{
$user_id = '1';
$user_id = ( int ) $user_id;
$now = time();
$subject = 'Вышла ' . $series . ' сериала ' . $title_ru . '';
$subject = $db->safesql($subject);
$from = 'MoonSerials';
$from = $db->safesql($from);
$text = '<h3>Вышла ' . $series . ' сериала ' . $title_ru . '</h3>';
$text .= '<p><b>Теперь можно:</b></p>';
$text .= '<ul><li><a href="' . $config['http_home_url'] . 'index.php?newsid=' . $post_id . '" target="_blank">Открыть новость на сайте</a></li>';
$text .= '<li><a href="' . $config['admin_path'] . '?mod=editnews&action=editnews&id=' . $post_id . '" target="_blank">Редактировать в админпанели</a></li>';
$text .= '<li><a href="' . $config['admin_path'] . '?mod=addnews&action=addnews" target="_blank">Добавить новую новость в админпанели</a></li></ul>';
$text = $db->safesql($text);
$db->query("INSERT into " . PREFIX . "_pm (subj, text, user, user_from, date, pm_read, folder) VALUES ('$subject', '$text', '$user_id', '$from', '$now', '0', 'inbox')");
$db->query("UPDATE " . USERPREFIX . "_users set pm_unread = pm_unread + 1, pm_all = pm_all+1 where user_id = '$user_id'");
}
}
}
if ( $moonserials_options['allow_module_new'] )
{
$tpl1->set("{tabs-title}", $tpl2->result['tabs-title']);
unset( $tpl2 );
$tpl1->set("{tabs-content}", $tpl3->result['tabs-content']);
unset( $tpl3 );
$tpl1->compile('myModule');
$myModule = $tpl1->result['myModule'];
}
elseif ( $xfieldsdata[$moonserials_options['field_status_name']] !== $moonserials_options['field_status'] )
{
if ( $moonserials_options['allow_module_new_season'] AND $moonserials_options['allow_module_new_series'] )
{
$myModule = $season . " сезон " . $series . " серия";
}
elseif ( $moonserials_options['allow_module_new_season'] AND !$moonserials_options['allow_module_new_series'] )
{
$myModule = $season . " сезон";
}
elseif ( !$moonserials_options['allow_module_new_season'] AND $moonserials_options['allow_module_new_series'] )
$myModule = $series . " серия";
}
else
{
$myModule = $moonserials_options['if_series_ower'];
}
create_cache($myConfig['cachePrefix'], $myModule, $cacheName . $config['skin'], $myConfig['cacheSuffix']);
if ( $is_change )
$config['allow_cache'] = false;
if ( $moonserials_options['allow_module_new'] )
{
$tpl1->clear();
}
}
echo $myModule;
}
?>
@kild можешь чем то помочь? Можно и за $...Заметил как поставил модуль возросла нагрузка на страницу с сериалами. У кого еще такая беда??? Может кто то готов оптимизировать за деньги его???
Посмотреть вложение 2078