Генератор серий сериалов

Генератор серий сериалов

Это хак, немного урезанный и основанный на платной версии Генератора серий сериалов. Разница в том, что добавлено доп.поле типа "несколько строк", в которое ручками следует добавлять ссылки, причем каждую с новой строчки. Каждая серия сериала имеет свою личную страницу, так что можно собирать по серийный трафик. Ссылки можно добавлять откуда угодно, будь то iframe или прямые на видео файлы. Тут главное как будет оформлена страница с сериями.


В generator.tpl доступны абсолютно все стандартные теги для полной новости и несколько новых. Ссылки на серии будут вида http:/сайт.ру/id-чпу/episode/1.html.



Установка:
1. Открыть в корне сайта .htaccess и найти:
RewriteRule ^page/([0-9]+)(/?)$ index.php?cstart=$1 [L]

Добавить ниже:
# Генератор серий by DomiTori
RewriteRule ^([^.]+)/([0-9]+)-(.*)/episode/([0-9]+).html$ index.php?newsid=$2&seourl=$3&seocat=$1&nomer=$4 [L]
RewriteRule ^([0-9]+)-(.*)/episode/([0-9]+).html$ index.php?newsid=$1&seourl=$2&nomer=$3 [L]

2. Открыть engine/modules/show.full.php и найти:
elseif( $category_id and $cat_info[$category_id]['full_tpl'] != '' ) $tpl->load_template( $cat_info[$category_id]['full_tpl'] . '.tpl' );

Добавить ниже:
elseif( isset($_GET["nomer"]) ) {
        $xf_data = xfieldsdataload( $row['xfields'] );
        $episode = $_GET['nomer'];
        $links = "";
        $video_links = explode("\n", $xf_data['video_links']);
        $vsego = count($video_links);
        foreach ($video_links as $nomer_cikla => $link) {
 
            $nomer = $nomer_cikla + 1;
            if ( $episode == $nomer ) {
 
                $links .= "<a class='BatcoH BatcoH-4'>" . $nomer . " серия</a>";
                $episode_link = $link;
 
                $pred = $nomer - 1;
                $sled = $nomer + 1;
                if ($pred >= 1) $series_navigation .= "<a href='" . $config['http_home_url'] . $row['id']."-".$row['alt_name'] . "/episode/" . $pred . ".html'  class='BatcoH-prevnext BatcoH-5'>Предыдущая " . $pred . " серия</a>";
                if ($sled <= $vsego) $series_navigation .= "<a href='" . $config['http_home_url'] . $row['id']."-".$row['alt_name'] . "/episode/" . $sled . ".html'  class='BatcoH-prevnext BatcoH-5'>Следующая " . $sled . " серия</a>";
 
 
            }
            else $links .= "<a href='" . $config['http_home_url'] . $row['id']."-".$row['alt_name'] . "/episode/" . $nomer . ".html'  class='BatcoH BatcoH-5'>" . $nomer . " серия</a>";
 
        }
 
        $tpl->set( '{all_links}', $links );
        $tpl->set( '{episode_link}', $episode_link );
        $tpl->set( '{series_navigation}', $series_navigation );
        $tpl->set( '{nomer}', $episode );
        $tpl->load_template( 'generator.tpl' );
        }

Найти:
$tpl->set( '{full-story}', $row['full_story'] );

Добавить ниже:
if ( $xfieldsdata['video_links'] AND !isset($_GET["nomer"]) ) {
 
            $links = "";
            $video_links = explode("\n", $xfieldsdata['video_links']);
            foreach ($video_links as $nomer_cikla => $link) {
 
                $nomer = $nomer_cikla + 1;
                $links .= "<a href='" . $config['http_home_url'] . $row['alt_name'] . "/episode/" . $nomer . ".html'  class='BatcoH BatcoH-5'>" . $nomer . " серия</a>";
 
            }
 
            $tpl->set( '{links}', $links );
 
        }

3. Добавить к стилям шаблона:
.buttttons {
  display: table;
  height: 100%;
  width: 100%;
}

.kontaiher {
  display: table-cell;
  padding: 1em;
  text-align: center;
  vertical-align: middle;
}

.BatcoH {
  color: black !important;
  cursor: pointer;
  display: block;
  font-size: 16px;
  font-weight: 400;
  line-height: 45px;
  margin: 0.5em 0.5em 0.5em;
  max-width: 90px;
  position: relative;
  text-decoration: none;
  vertical-align: middle;
  width: 100%;
}
@media (min-width: 400px) {
  .BatcoH {
    display: inline-block;
    margin-right: 0.4em;
  }
  .BatcoH:nth-of-type(even) {
    margin-right: 0.4em;
  }
}
@media (min-width: 600px) {
  .BatcoH:nth-of-type(even) {
    margin-right: 0.5em;
  }
  .BatcoH:nth-of-type(5) {
    margin-right: 0.5em;
  }
}
.BatcoH:hover {
  text-decoration: none !important;
}
 
.BatcoH-dub {
  color: black;
  cursor: pointer;
  display: block;
  font-size: 16px;
  font-weight: 400;
  line-height: 45px;
  margin: 0 auto 0.5em;
  max-width: 200px;
  position: relative;
  text-decoration: none;
  vertical-align: middle;
  width: 100%;
}
@media (min-width: 400px) {
  .BatcoH-dub {
    display: inline-block;
    margin-right: 0.4em;
  }
  .BatcoH-dub:nth-of-type(even) {
    margin-right: 0.4em;
  }
}
@media (min-width: 600px) {
  .BatcoH-dub:nth-of-type(even) {
    margin-right: 0.5em;
  }
  .BatcoH-dub:nth-of-type(5) {
    margin-right: 0.5em;
  }
}
.BatcoH-dub:hover {
  text-decoration: none;
}

.BatcoH-prevnext {
  color: black;
  cursor: pointer;
  display: block;
  font-size: 16px;
  font-weight: 400;
  line-height: 45px;
  margin: 0 auto 0.5em;
  max-width: 45%;
  position: relative;
  text-decoration: none;
  text-transform: uppercase;
  vertical-align: middle;
  width: 45%;
}
@media (min-width: 400px) {
  .BatcoH-prevnext {
    display: inline-block;
    margin-right: 0.5em;
  }
  .BatcoH-prevnext:nth-of-type(even) {
    margin-right: 0.5em;
  }
}
@media (min-width: 600px) {
  .BatcoH-prevnext:nth-of-type(even) {
    margin-right: 0.5em;
  }
  .BatcoH-prevnext:nth-of-type(5) {
    margin-right: 0.5em;
  }
}
.BatcoH-prevnext:hover {
  text-decoration: none;
}

.BatcoH-4 {
  border: 1px solid;
  overflow: hidden;
  position: relative;
  z-index: 20;
}
.BatcoH-4:after {
  background: #427388;
  content: "";
  height: 155px;
  left: -75px;
  opacity: .2;
  position: absolute;
  top: -50px;
  -webkit-transform: rotate(35deg);
          transform: rotate(35deg);
  -webkit-transition: all 550ms cubic-bezier(0.19, 1, 0.22, 1);
  transition: all 550ms cubic-bezier(0.19, 1, 0.22, 1);
  width: 50px;
  z-index: -10;
}

.BatcoH-4:hover:after {
  left: 120%;
  -webkit-transition: all 550ms cubic-bezier(0.19, 1, 0.22, 1);
  transition: all 550ms cubic-bezier(0.19, 1, 0.22, 1);
}

.BatcoH-5 {
  border: 0 solid;
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0);
  outline: 1px solid;
  outline-offset: 0px;
  text-shadow: none;
  -webkit-transition: all 1250ms cubic-bezier(0.19, 1, 0.22, 1);
  transition: all 1250ms cubic-bezier(0.19, 1, 0.22, 1);
}

.BatcoH-5:hover {
  border: 1px solid;
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.5), 0 0 20px rgba(255, 255, 255, 0.2);
  outline-color: rgba(255, 255, 255, 0);
  outline-offset: 15px;
  text-shadow: 1px 1px 2px #427388;
}

4. Для вывода списка доступных серий открыть fullstory.tpl и в нужное место добавить:
[xfgiven_video_links]
            <section class="buttttons">
                <div class="kontaiher">{links}</div>
            </section>
            [/xfgiven_video_links]

5. Или создать файл generator.tpl и скопировать в него содержимое fullstory.tpl. Для вывода списка серий, навигации и самого видео добавить в нужное место:
<iframe src="{episode_link}" width="100%" height="360" frameborder="0" allowfullscreen></iframe>
            <section class="buttttons">
                <div class="kontaiher">{series_navigation}</div>
            </section>
            <section class="buttttons">
                <div class="kontaiher">{all_links}</div>
            </section>

В этом шаблоне доступен тег {nomer}, который выведет номер серии, на странице которой находится пользователь.

6. В панели управления DLE создаем доп поле:
Название поля - video_links
Описание поля - Ссылки на видео
Подсказка для поля - Вставляем ссылки на видео, каждая с новой строчки
Категория - Категория с сериалами, где будете использовать модуль
Тип поля - Несколько строк
Поставить галочку "Использовать при желании (можно оставить поле пуcтым)"

Готово.

generator-serij-serialov.zip
Создайте аккаунт или авторизуйтесь для скачивания
 
Версия DLE: 10.x-13.x
Кодировка: utf-8
Автор: DomiTori
Источник
Информация
Посетители, находящиеся в группе Гость, не могут оставлять комментарии к данной публикации.