Подскажи, чей модуль подборки используешь?для количества просмотров.он оправляет юзера на подборки за счет этого просмотров на хост 4
Посмотрите видео ниже, чтобы узнать, как установить наш сайт как веб-приложение на главный экран.
Примечание: Эта функция может быть недоступна в некоторых браузерах.
Подскажи, чей модуль подборки используешь?для количества просмотров.он оправляет юзера на подборки за счет этого просмотров на хост 4
кинопрофи страницу. и хак этого человека domitori.ru разделение категорийПодскажи, чей модуль подборки используешь?

Что дает такой способ вывода плеера скриптом?чтоб колесики крутились так
<style>
#player {
background: #000 url(ссылка на колесики/load-player.gif) center center no-repeat
}
.embed-responsive {
position: relative;
display: block;
height: 0;
padding: 0;
overflow: hidden
}
.embed-responsive .embed-responsive-item, .embed-responsive iframe, .embed-responsive embed, .embed-responsive object, .embed-responsive video {
position: absolute;
top: 0;
left: 0;
bottom: 0;
height: 100%;
width: 100%;
border: 0
}
.embed-responsive-16by9 {
padding-bottom: 56.25%
}
.embed-responsive-4by3 {
padding-bottom: 75%
}
</style>
<div id="player"><div class="embed-responsive embed-responsive-16by9"><div id="kino"></div>
</div></div>
у меня плеер еще скриптом выводится
<script type="text/javascript">function createPlayer_kinoveb(){var t=document.createElement("IFRAME");t.setAttribute("src","[xfvalue_url_video][xfgiven_georu]?block_ru=1[/xfgiven_georu][xfgiven_geouk]?block_ua=1[/xfgiven_geouk][xfgiven_season1]?season=[xfvalue_season1][/xfgiven_season1]"),t.frameBorder=0,t.setAttribute("allowfullscreen","true"),t.setAttribute("scrolling","no"),document.getElementById("kino").appendChild(t)}function addLoadEvent(t){var e=window.onload;"function"!=typeof window.onload?window.onload=t:window.onload=function(){e&&e(),t()}}addLoadEvent(function(){createPlayer_kinoveb()});</script>
тоже скопировал с сайта
этот див выводит плеер <div id="kino"></div>
в исходном коде ссылка на плеер не кликабельная.Что дает такой способ вывода плеера скриптом?
@Romantv
какой хак ? на domitori.ru не нашел
Хак - Разделение категорий по типам при добавлении новостей.
Автор: DomiTori
1. Открываем /engine/inc/include/functions.inc.php
ищем в нем код
function CategoryNewsSelection($categoryid = 0, $parentid = 0, $nocat = TRUE, $sublevelmarker = '', $returnstring = '') {
global $cat, $cat_parentid, $member_id, $user_group, $mod;
if ($mod == "addnews" OR $mod == "editnews")
$allow_list = explode( ',', $user_group[$member_id['user_group']]['cat_allow_addnews'] );
else
$allow_list = explode( ',', $user_group[$member_id['user_group']]['allow_cats'] );
if( $mod != "usergroup" ) {
$not_allow_list = explode( ',', $user_group[$member_id['user_group']]['not_allow_cats'] );
} else $not_allow_list = array();
$spec_list = explode( ',', $user_group[$member_id['user_group']]['cat_add'] );
if( $parentid == 0 ) {
if( $nocat ) $returnstring .= '<option value="0"></option>';
} else {
$sublevelmarker .= ' ';
}
if( isset( $cat_parentid ) ) {
$root_category = @array_keys( $cat_parentid, $parentid );
if( is_array( $root_category ) ) {
foreach ( $root_category as $id ) {
$category_name = $cat[$id];
if( ( $allow_list[0] == "all" OR in_array( $id, $allow_list ) ) OR $mod == "usergroup" ) {
if( in_array( $id, $not_allow_list ) ) continue;
if( $spec_list[0] == "all" or in_array( $id, $spec_list ) ) $color = "black";
else $color = "red";
$returnstring .= "<option style=\"color: {$color}\" value=\"" . $id . '" ';
if( is_array( $categoryid ) ) {
foreach ( $categoryid as $element ) {
if( $element == $id ) $returnstring .= 'SELECTED';
}
} elseif( $categoryid == $id ) $returnstring .= 'SELECTED';
$returnstring .= '>' . $sublevelmarker . $category_name . '</option>';
}
$returnstring = CategoryNewsSelection( $categoryid, $id, $nocat, $sublevelmarker, $returnstring );
}
}
}
return $returnstring;
}
заменяем на код
function CategoryNewsSelection($categoryid = 0, $parentid = 0, $nocat = TRUE, $sublevelmarker = '', $returnstring = '') {
global $cat, $cat_parentid, $member_id, $user_group, $mod;
if ($mod == "addnews" OR $mod == "editnews")
$allow_list = explode( ',', $user_group[$member_id['user_group']]['cat_allow_addnews'] );
else
$allow_list = explode( ',', $user_group[$member_id['user_group']]['allow_cats'] );
if( $mod != "usergroup" ) {
$not_allow_list = explode( ',', $user_group[$member_id['user_group']]['not_allow_cats'] );
} else $not_allow_list = array();
$type_list = [1,2,3];
$spec_list = explode( ',', $user_group[$member_id['user_group']]['cat_add'] );
if( $parentid == 0 ) {
if( $nocat ) $returnstring .= '<option value="0"></option>';
} else {
$sublevelmarker .= ' ';
}
if( isset( $cat_parentid ) ) {
$root_category = @array_keys( $cat_parentid, $parentid );
if( is_array( $root_category ) ) {
foreach ( $root_category as $id ) {
$category_name = $cat[$id];
if( ( $allow_list[0] == "all" OR in_array( $id, $allow_list ) ) OR $mod == "usergroup" ) {
if( in_array( $id, $not_allow_list ) OR !in_array( $id, $type_list ) ) continue;
if( $spec_list[0] == "all" or in_array( $id, $spec_list ) ) $color = "black";
else $color = "red";
$returnstring .= "<option style=\"color: {$color}\" value=\"" . $id . '" ';
if( is_array( $categoryid ) ) {
foreach ( $categoryid as $element ) {
if( $element == $id ) $returnstring .= 'SELECTED';
}
} elseif( $categoryid == $id ) $returnstring .= 'SELECTED';
$returnstring .= '>' . $sublevelmarker . $category_name . '</option>';
}
$returnstring = CategoryNewsSelection( $categoryid, $id, $nocat, $sublevelmarker, $returnstring );
}
}
}
return $returnstring;
}
function YearNewsSelection($categoryid = 0, $parentid = 0, $nocat = TRUE, $sublevelmarker = '', $returnstring = '') {
global $cat, $cat_parentid, $member_id, $user_group, $mod;
if ($mod == "addnews" OR $mod == "editnews")
$allow_list = explode( ',', $user_group[$member_id['user_group']]['cat_allow_addnews'] );
else
$allow_list = explode( ',', $user_group[$member_id['user_group']]['allow_cats'] );
if( $mod != "usergroup" ) {
$not_allow_list = explode( ',', $user_group[$member_id['user_group']]['not_allow_cats'] );
} else $not_allow_list = array();
$year_list = [7,8];
$spec_list = explode( ',', $user_group[$member_id['user_group']]['cat_add'] );
if( $parentid == 0 ) {
if( $nocat ) $returnstring .= '<option value="0"></option>';
} else {
$sublevelmarker .= ' ';
}
if( isset( $cat_parentid ) ) {
$root_category = @array_keys( $cat_parentid, $parentid );
if( is_array( $root_category ) ) {
foreach ( $root_category as $id ) {
$category_name = $cat[$id];
if( ( $allow_list[0] == "all" OR in_array( $id, $allow_list ) ) OR $mod == "usergroup" ) {
if( in_array( $id, $not_allow_list ) OR !in_array( $id, $year_list ) ) continue;
if( $spec_list[0] == "all" or in_array( $id, $spec_list ) ) $color = "black";
else $color = "red";
$returnstring .= "<option style=\"color: {$color}\" value=\"" . $id . '" ';
if( is_array( $categoryid ) ) {
foreach ( $categoryid as $element ) {
if( $element == $id ) $returnstring .= 'SELECTED';
}
} elseif( $categoryid == $id ) $returnstring .= 'SELECTED';
$returnstring .= '>' . $sublevelmarker . $category_name . '</option>';
}
$returnstring = YearNewsSelection( $categoryid, $id, $nocat, $sublevelmarker, $returnstring );
}
}
}
return $returnstring;
}
function CountryNewsSelection($categoryid = 0, $parentid = 0, $nocat = TRUE, $sublevelmarker = '', $returnstring = '') {
global $cat, $cat_parentid, $member_id, $user_group, $mod;
if ($mod == "addnews" OR $mod == "editnews")
$allow_list = explode( ',', $user_group[$member_id['user_group']]['cat_allow_addnews'] );
else
$allow_list = explode( ',', $user_group[$member_id['user_group']]['allow_cats'] );
if( $mod != "usergroup" ) {
$not_allow_list = explode( ',', $user_group[$member_id['user_group']]['not_allow_cats'] );
} else $not_allow_list = array();
$country_list = [13,14];
$spec_list = explode( ',', $user_group[$member_id['user_group']]['cat_add'] );
if( $parentid == 0 ) {
if( $nocat ) $returnstring .= '<option value="0"></option>';
} else {
$sublevelmarker .= ' ';
}
if( isset( $cat_parentid ) ) {
$root_category = @array_keys( $cat_parentid, $parentid );
if( is_array( $root_category ) ) {
foreach ( $root_category as $id ) {
$category_name = $cat[$id];
if( ( $allow_list[0] == "all" OR in_array( $id, $allow_list ) ) OR $mod == "usergroup" ) {
if( in_array( $id, $not_allow_list ) OR !in_array( $id, $country_list ) ) continue;
if( $spec_list[0] == "all" or in_array( $id, $spec_list ) ) $color = "black";
else $color = "red";
$returnstring .= "<option style=\"color: {$color}\" value=\"" . $id . '" ';
if( is_array( $categoryid ) ) {
foreach ( $categoryid as $element ) {
if( $element == $id ) $returnstring .= 'SELECTED';
}
} elseif( $categoryid == $id ) $returnstring .= 'SELECTED';
$returnstring .= '>' . $sublevelmarker . $category_name . '</option>';
}
$returnstring = CountryNewsSelection( $categoryid, $id, $nocat, $sublevelmarker, $returnstring );
}
}
}
return $returnstring;
}
function GenreNewsSelection($categoryid = 0, $parentid = 0, $nocat = TRUE, $sublevelmarker = '', $returnstring = '') {
global $cat, $cat_parentid, $member_id, $user_group, $mod;
if ($mod == "addnews" OR $mod == "editnews")
$allow_list = explode( ',', $user_group[$member_id['user_group']]['cat_allow_addnews'] );
else
$allow_list = explode( ',', $user_group[$member_id['user_group']]['allow_cats'] );
if( $mod != "usergroup" ) {
$not_allow_list = explode( ',', $user_group[$member_id['user_group']]['not_allow_cats'] );
} else $not_allow_list = array();
$genre_list = [4,5,6];
$spec_list = explode( ',', $user_group[$member_id['user_group']]['cat_add'] );
if( $parentid == 0 ) {
if( $nocat ) $returnstring .= '<option value="0"></option>';
} else {
$sublevelmarker .= ' ';
}
if( isset( $cat_parentid ) ) {
$root_category = @array_keys( $cat_parentid, $parentid );
if( is_array( $root_category ) ) {
foreach ( $root_category as $id ) {
$category_name = $cat[$id];
if( ( $allow_list[0] == "all" OR in_array( $id, $allow_list ) ) OR $mod == "usergroup" ) {
if( in_array( $id, $not_allow_list ) OR !in_array( $id, $genre_list ) ) continue;
if( $spec_list[0] == "all" or in_array( $id, $spec_list ) ) $color = "black";
else $color = "red";
$returnstring .= "<option style=\"color: {$color}\" value=\"" . $id . '" ';
if( is_array( $categoryid ) ) {
foreach ( $categoryid as $element ) {
if( $element == $id ) $returnstring .= 'SELECTED';
}
} elseif( $categoryid == $id ) $returnstring .= 'SELECTED';
$returnstring .= '>' . $sublevelmarker . $category_name . '</option>';
}
$returnstring = GenreNewsSelection( $categoryid, $id, $nocat, $sublevelmarker, $returnstring );
}
}
}
return $returnstring;
}
Теперь в заменяемом коде выставим нужные нам id категорий, которые будут выводится в нужных нам полях, а именно
$type_list = [1,2,3]; - через запятую перечисляем id категорий, которые будут типом новости (например сериалы, фильмы, мультфильмы, аниме...)
$year_list = [7,8]; - через запятую перечисляем id категорий, которые будут нашими годами (например 2017,2016,2015...)
$country_list = [13,14]; - через запятую перечисляем id категорий, которые будут нашими странами (например сша, россия, китай....)
$genre_list = [4,5,6]; - через запятую перечисляем id категорий, которые будут нашими жанрами (например боевик, комедия, драма...)
2. Открываем /engine/inc/addnews.php
ищем в нем код
$categories_list = CategoryNewsSelection( 0, 0 );
НИЖЕ вставляем
$year_list = YearNewsSelection( 0, 0 );
$genre_list = GenreNewsSelection( 0, 0 );
$country_list = CountryNewsSelection( 0, 0 );
далее ищем код
<div class="form-group">
<label class="control-label col-md-2">{$lang['addnews_cat']}</label>
<div class="col-md-10">
<select data-placeholder="{$lang['addnews_cat_sel']}" name="category[]" id="category" onchange="onCategoryChange(this)" $category_multiple style="width:100%;max-width:350px;">{$categories_list}</select>
</div>
</div>
заменяем на код
<div class="form-group">
<label class="control-label col-md-2">Тип</label>
<div class="col-md-10">
<select data-placeholder="{$lang['addnews_cat_sel']}" name="category[]" id="category" onchange="onCategoryChange(this)" $category_multiple style="width:100%;max-width:350px;">{$categories_list}</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-2">Год</label>
<div class="col-md-10">
<select data-placeholder="{$lang['addnews_cat_sel']}" name="category[]" id="category2" onchange="onCategoryChange(this)" $category_multiple style="width:100%;max-width:350px;">{$year_list}</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-2">Жанр</label>
<div class="col-md-10">
<select data-placeholder="{$lang['addnews_cat_sel']}" name="category[]" id="category3" onchange="onCategoryChange(this)" $category_multiple style="width:100%;max-width:350px;">{$genre_list}</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-2">Страна</label>
<div class="col-md-10">
<select data-placeholder="{$lang['addnews_cat_sel']}" name="category[]" id="category4" onchange="onCategoryChange(this)" $category_multiple style="width:100%;max-width:350px;">{$country_list}</select>
</div>
</div>
3. Открываем /engine/inc/editnews.php
ищем в нем код
$categories_list = CategoryNewsSelection( $cat_list, 0 );
НИЖЕ вставляем
$year_list = YearNewsSelection( $cat_list, 0 );
$genre_list = GenreNewsSelection( $cat_list, 0 );
$country_list = CountryNewsSelection( $cat_list, 0 );
далее ищем код
<div class="form-group">
<label class="control-label col-md-2">{$lang['edit_cat']}</label>
<div class="col-md-10">
<select data-placeholder="{$lang['addnews_cat_sel']}" name="category[]" id="category" onchange="onCategoryChange(this)" {$category_multiple} style="width:350px;">{$categories_list}</select>
</div>
</div>
заменяем на код
<div class="form-group">
<label class="control-label col-md-2">Тип</label>
<div class="col-md-10">
<select data-placeholder="{$lang['addnews_cat_sel']}" name="category[]" id="category" onchange="onCategoryChange(this)" {$category_multiple} style="width:350px;">{$categories_list}</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-2">Год</label>
<div class="col-md-10">
<select data-placeholder="{$lang['addnews_cat_sel']}" name="category[]" id="category2" onchange="onCategoryChange(this)" {$category_multiple} style="width:350px;">{$year_list}</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-2">Жанр</label>
<div class="col-md-10">
<select data-placeholder="{$lang['addnews_cat_sel']}" name="category[]" id="category3" onchange="onCategoryChange(this)" {$category_multiple} style="width:350px;">{$genre_list}</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-2">Страна</label>
<div class="col-md-10">
<select data-placeholder="{$lang['addnews_cat_sel']}" name="category[]" id="category4" onchange="onCategoryChange(this)" {$category_multiple} style="width:350px;">{$country_list}</select>
</div>
</div>
Вот и все :)
Точнее если вы используете парсер с кинопоиска от parser-kino, нужно сделать правку в 1 файле для работы хака.
Открываем /engine/modules/parser-kinopoisk/js.php и ищем в нем код
function kinopoikcategory( categoryMINI ){
$('#category').val('').trigger('liszt:updated');
var Selectcat = document.getElementById('category');
for (var i=0; i<categoryMINI.length; i++) {
for (var j=0; j < Selectcat.options.length; j++) {
if (Selectcat.options[j].value == categoryMINI[i]) {
Selectcat.options[j].selected=true;
}
}
$('#category').trigger('liszt:updated');
}
return false;
}
заменяем на код
function kinopoikcategory( categoryMINI ){
$('#category').val('').trigger('liszt:updated');
var Selectcat = document.getElementById('category');
for (var i=0; i<categoryMINI.length; i++) {
for (var j=0; j < Selectcat.options.length; j++) {
if (Selectcat.options[j].value == categoryMINI[i]) {
Selectcat.options[j].selected=true;
}
}
$('#category').trigger('liszt:updated');
}
$('#category2').val('').trigger('liszt:updated');
var Selectcat = document.getElementById('category2');
for (var i=0; i<categoryMINI.length; i++) {
for (var j=0; j < Selectcat.options.length; j++) {
if (Selectcat.options[j].value == categoryMINI[i]) {
Selectcat.options[j].selected=true;
}
}
$('#category2').trigger('liszt:updated');
}
$('#category3').val('').trigger('liszt:updated');
var Selectcat = document.getElementById('category3');
for (var i=0; i<categoryMINI.length; i++) {
for (var j=0; j < Selectcat.options.length; j++) {
if (Selectcat.options[j].value == categoryMINI[i]) {
Selectcat.options[j].selected=true;
}
}
$('#category3').trigger('liszt:updated');
}
$('#category4').val('').trigger('liszt:updated');
var Selectcat = document.getElementById('category4');
for (var i=0; i<categoryMINI.length; i++) {
for (var j=0; j < Selectcat.options.length; j++) {
if (Selectcat.options[j].value == categoryMINI[i]) {
Selectcat.options[j].selected=true;
}
}
$('#category4').trigger('liszt:updated');
}
return false;
}
хак - разделение категорий при выводе в новости
Автор хака - Gameer
Открываем /engine/modules/functions.php найти
function get_url($id) {
Выше вставить:
function checkCatFunction($data, $cat_list)
{
$flag_checkCatFunction = false;
if(substr_count($data[1],","))
{
$cat_array = array();
$cat_array = explode(",", $data[1]);
foreach($cat_array as $value)
{
if(in_array($value, $cat_list))
$flag_checkCatFunction = true;
}
}
else
{
if(in_array($data[1], $cat_list))
$flag_checkCatFunction = true;
}
return ($flag_checkCatFunction == true) ? $data[2] : "";
}
function catFunction($data, $cat_list, $config)
{
$get_cat = array();
if(substr_count($data[1],","))
{
$cat_array = array();
$cat_array = explode(",", $data[1]);
foreach($cat_array as $value)
{
if(in_array($value, $cat_list))
$get_cat[] = getCatInfo($value, $config);
}
}
else
{
if(in_array($data[1], $cat_list))
$get_cat[] = getCatInfo($data[1], $config);
}
return implode($config['category_separator'] . ' ', $get_cat);
}
function getCatInfo($id, $config)
{
global $cat_info, $PHP_SELF;
if( $config['allow_alt_url'] ) $catInfo = "<a href=\"" . $config['http_home_url'] . get_url( $id ) . "/\">{$cat_info[$id]['name']}</a>";
else $catInfo = "<a href=\"$PHP_SELF?do=cat&category={$cat_info[$id]['alt_name']}\">{$cat_info[$id]['name']}</a>";
return $catInfo;
}
2. Открываем /engine/modules/show.short.php, show.full.php и show.custom.php находим первый
$tpl->compile( 'content' );
Выше вставляем:
$tpl->copy_template = preg_replace_callback( "#\[cat\:(.+?)\](.+?)\[/cat\]#is", function($data) use ($cat_list)
{
return checkCatFunction($data, $cat_list);
}, $tpl->copy_template );
$tpl->copy_template = preg_replace_callback( "#{cat\:(.+?)}#is", function($data) use ($cat_list, $config)
{
return catFunction($data, $cat_list, $config);
}, $tpl->copy_template );
Использование:
В шаблонах краткой новости, полной и шаблонах custom доступен теги:
{cat:1} или {cat:1,2,3} - выведет ссылку на эти категории которые указаны.
[cat:1] текст [/cat] или [cat:1,2,3] текст [/cat] - выведет текст внутри тегов если категория выбрана для новости.



