1<!DOCTYPE html> <?php // ver. 2023.01.15 23:34 GMT+9
2$NS = $INFO [ 'namespace' ]; $t2 = "\n\t\t"; $t3 = "\n\t\t\t"; $t4 = "\n\t\t\t\t"; $t5 = "\n\t\t\t\t\t"; $t6 = "\n\t\t\t\t\t\t";
3$comic = preg_match ( '/:(sci-fi|tlk|wolves|mlp|furry|gamer|other|interrobang):/', $NS );
4$bands  = preg_match ( '/:[dh]\d+$/', $ID );
5$index = preg_match ( '/:index$/', $ID );
6$dw_add = '';
7switch ( $conf [ "lang" ] ) {
8	case 'he' : $dfont = 'Frank+Ruhl+Libre:wght@700'; break;
9	case 'hi' : $dfont = 'Inknut+Antiqua'; break;
10	case 'ko' : $dfont = 'Jua'; break;
11	case 'ja' : $dfont = 'Kosugi+Maru'; break;
12	case 'zh' : $dfont = 'ZCOOL+KuaiLe'; break;
13	case 'ru' : case 'be' : case 'bg' : case 'uk' : $dw_add .= ' slav'; break;
14	default : break;
15};
16
17/* код страницы */
18header ( 'X-UA-Compatible: IE = edge' ); echo '
19<html xml:lang = "' . $conf [ "lang" ] . '" lang = "' . $conf [ "lang" ] . '" dir = "' . $lang [ "direction" ] . '" prefix="og: http://ogp.me/ns# article: http://ogp.me/ns/article# profile: http://ogp.me/ns/profile# fb: http://ogp.me/ns/fb#">' .
20// 1. HEAD
21"\n\t" . '<head>' .
22$t2 . '<meta charset = "utf-8" />' .
23$t2 . '<title>' . strtoupper ( $conf [ "lang" ] ) . ' / '; tpl_pagetitle ( ); echo '</title>' .
24$t2 . '<link rel = "alternate" type = "application/json+oembed" href = "https://app.comicslate.org/embed.json?id=' . $ID . ( $REV == false ? '' : '&amp;rev='. $REV ) . '" />' .
25$t2 . '<meta name = "viewport" content = "width = device-width, initial-scale = 1" />' .
26$t2 . tpl_favicon ( array ( 'favicon', 'mobile' ) ) .
27"\t\t" . '<link rel="icon" href="/lib/tpl/comicslate/images/logo/logo_back.svg" type="image/svg+xml">' .
28$t2 . '<link rel = "manifest" href = "/lib/tpl/comicslate/images/site.webmanifest">' .
29(
30	$ACT == 'show'
31	// Метрика
32	? (
33		$t2 . '<script src = "//mc.yandex.ru/metrika/tag.js" async></script>' . $t2 . '<script src = "/lib/tpl/comicslate/yscript.js" async></script>' .
34		// реклама РСИ
35		$t2 . '<script>window . yaContextCb = window . yaContextCb || [ ]</script>' .
36		$t2 . '<script src = "//yandex.ru/ads/system/context.js" async></script>'
37	)
38	: (
39		( $ACT == 'edit' || $ACT == 'preview' )
40		&&
41		( explode ( "&", $_SERVER [ "QUERY_STRING" ] ) [ 2 ] != 'nocotan' )
42		// CoTAN
43		? $t2 . '<script src = "/lib/plugins/cotan/neweditor.js?ver=' . date ( "y-m-d_H:i:s", filemtime ( 'lib/plugins/cotan/neweditor.js' ) ) . '" defer></script>'
44		: ''
45	)
46) .
47// шрифты
48$t2 . '<link rel = "preconnect" href = "https://fonts.gstatic.com" />';
49if ( preg_match ( '/(h[ei]|ko|ja|zh)/', $conf [ "lang" ] ) ) echo  $t2 . '<link rel = "preload" href = "https://fonts.googleapis.com/css2?family=' . $dfont . '&amp;display=swap" as = "style" crossorigin = "anonymous">';
50echo $t2 . '<link rel = "preload" href = "/lib/tpl/comicslate/fonts/dat_fest_comic.woff" as = "font" type = "font/woff" crossorigin = "anonymous">' .
51     $t2 . '<link rel = "preload" href = "/lib/tpl/comicslate/fonts/dat_fest_comic.ttf" as = "font" type = "font/ttf" crossorigin = "anonymous">' .
52// остальные мета-теги
53$t2; tpl_metaheaders ( );
54echo "\t" . '</head>' .
55// 2. BODY
56"\n\t" . '<body>' .
57$t2 .
58	'<div class = "dokuwiki lang-' .
59	str_replace ( ":", " ", $NS ) .
60	( $comic ? ' comic' : '') .
61	( $bands ? ' band' : '') .
62	( $index ? ' index' : '') .
63	$dw_add .
64	'">' .
65// 2.1. MENU
66$t3 . '<div id = "head">' .
67$t4 . '<div id = "logo">' . // Logo
68$t5 . '<a id = "inlogo" rnd = "' . rand ( 0, 6 ) . '"  href = "/'. $conf [ "lang" ] . '/start" title = "' . tpl_getLang ( 'start' ) . '"></a>' .
69$t4 . '</div>' .
70$t4 . '<div id = "menu">' .
71// Topline & search
72$t5 . '<header rnd = "' . rand ( 0, 6 ) . '">' .
73$t6 . '<span id = "upmenu">';
74$ilinks = array (
75	array ( '/'. $conf [ "lang" ] . '/menu',		tpl_getLang ( 'menu' ),		'_self' ),
76	array ( '/'. $conf [ "lang" ] . '/news/index',	tpl_getLang ( 'news' ),		'_self' ),
77	array ( '/'. $conf [ "lang" ] . '/wiki/index',	tpl_getLang ( 'helproom' ),	'_blank' ),
78	array ( '//discord.gg/T8p6M4Q',					tpl_getLang ( 'chat' ),		'_blank' ),
79);
80for ( $i = 0; $i <= count ( $ilinks ) - 1; $i++ ) { echo $t6 . "\t" . '<a href = "' . $ilinks [ $i ] [ 0 ] . '" target = ' . $ilinks [ $i ] [ 2 ] . '>' . $ilinks [ $i ] [ 1 ] . '</a>'; };
81echo $t6 . '</span>' .
82$t6 . '<div id = "search">' . $t6 . "\t" ; tpl_searchform ( ); echo $t6 . '</div>' .
83$t5 . '</header>' ;
84// Languages
85$translation = plugin_load ( 'helper', 'translation' );
86echo $t5 . '<nav>' . ( $translation ? $translation -> showTranslations ( ) : '' ) . $t5 . '</nav>' .
87$t4 . '</div>' . $t3 . '</div>' ;
88// Message
89if ( !empty ( html_msgarea ( ) ) ) { echo $t3 . '<div class = "meta">' . $t4; html_msgarea ( ); echo $t3 . '</div>'; };
90// 2.2. PAGE
91tpl_flush ( );
92echo $t3 . '<article class = "page">' .
93"\n";
94tpl_content ( );
95echo $t3 . '</article>';
96tpl_flush ( );
97
98echo $t3 . '<noindex>';
99// 2.3. SIDEBARS
100if ( // Design
101	( $ACT == 'edit' || $ACT == 'preview' || $ACT == 'show' )
102	&&
103	$comic
104	&&
105	preg_match ( '/((\d|vol|ch|part)\d+|(cover|pro(log)?)\d*)/', noNS ( $ID ) )
106) {
107echo '<aside id = "viewoptions">
108<label id="opt_fognavi"><input type="checkbox"><span class="l_ch"></span><span class="l_tx">' . tpl_getLang ( 'opt1' ) . '</span></label>
109<label id="opt_piczoom"><input type="checkbox"><span class="l_ch"></span><span class="l_tx">' . tpl_getLang ( 'opt2' ) . '</span></label>
110<label id="opt_picshot"><input type="checkbox"><span class="l_ch"></span><span idata="' . tpl_getLang ( 'opt3' ) . '" class="l_tx"></span></label>
111<label id="opt_translate" accesskey="t"><input type="checkbox"><span class="l_ch"></span><span idata="' . tpl_getLang ( 'opt4' ) . '" class="l_tx"></span></label>
112<label id="opt_decolor"><input type="checkbox"><span class="l_ch"></span><span class="l_tx">' . tpl_getLang ( 'opt5' ) . '</span></label>
113</aside>';
114};
115echo $t4 . '<aside id = "pagetools">' . // Wiki
116$t5 . '<ul id = "nomobile">' .
117$t6 . ( new \dokuwiki\Menu\PageMenu ( ) ) -> getListItems ( ) .
118$t5 . '</ul>' .
119$t5 . '<ul id = "mobile">' .
120$t6 . ( new \dokuwiki\Menu\MobileMenu ( ) ) -> getDropdown ( ) .
121$t5 . '</ul>' .
122$t4 . '</aside>' .
123// 2.4. FOOTER
124$t4 . '<footer>';
125if ( $conf [ 'breadcrumbs' ] ) { // Breadcrumbs
126	echo $t5 . '<div class = "breadcrumbs">';
127	tpl_breadcrumbs ( );
128	echo '</div>';
129};
130$socbut = array ( // Social
131	array ( '/feed.php', tpl_getLang ( 'RSS' ) . ' (' . tpl_getLang ( 'RSSall' ) . ')', 'rss' ),
132	array ( '/feed.php?onlynewpages=1', tpl_getLang ( 'RSS' ) . ' (' . tpl_getLang ( 'RSSnew' ) . ')', 'rss' ),
133	array ( '//patreon.com/comicslate', 'Patreon', 'patreon' ),
134	array ( '//discord.gg/T8p6M4Q', 'Discord', 'discord' ),
135	array ( '//www.reddit.com/r/Comicslate', 'Reddit', 'reddit' ),
136	array ( '//rainbow-spike.tumblr.com', 'Tumblr', 'tumblr' ),
137	array ( '//facebook.com/groups/comicslate', 'Facebook', 'facebook' ),
138	array ( '//twitter.com/Rainbow_Spike', 'Twitter', 'twitter' ),
139	array ( '//vk.com/comicslate', 'VKontakte', 'vkontakte' ),
140	array ( '/feed.php?ns=' . urlencode ( $NS ), tpl_getLang ( 'RSSpart' ) . ' (' . tpl_getLang ( 'RSSall' ) . ')', 'rss' ),
141	array ( '/feed.php?onlynewpages=1&amp;ns=' . urlencode ( $NS ), tpl_getLang ( 'RSSpart' ) . ' (' . tpl_getLang ( 'RSSnew' ) . ')', 'rss' )
142);
143echo $t5 . '<div class = "social">';
144for ( $i = 0; $i <= count ( $socbut ) - 1; $i++ ) {
145	echo $t6 . '<a href = "' . $socbut [ $i ] [ 0 ] . '" class = "media ' . $socbut [ $i ] [ 2 ] . '" title = "' . $socbut [ $i ] [ 1 ] . '" target = "_blank"></a>';
146};
147echo $t5 . '</div>';
148if ( $ACT == 'show' ) { // Yandex Counter
149	echo '<div class = "count">' .
150	$t6 . '<a href = "//metrika.yandex.ru/stat/?id=25500497&amp;from=informer" target = "_blank" rel = "nofollow">' .
151	$t6 . "\t" . '<img src = "//informer.yandex.ru/informer/25500497/3_0_7BC9F7FF_5BA9D7FF_0_pageviews" class = "ym-advanced-informer" alt = "Яндекс.Метрика" title = "Яндекс.Метрика: данные за 24 часа (просмотры, уник. посетители и визиты)" data-cid = "25500497" data-lang = "' . $conf [ "lang" ] .'" />' .
152	$t6 . '</a>' .
153	$t6 . '<noscript>' .
154	$t6 . "\t" . '<div>' .
155	$t6 . "\t\t" . '<img src = "//mc.yandex.ru/watch/25500497" alt = "" />' .
156	$t6 . "\t" . '</div>' .
157	$t6 . '</noscript>' .
158	$t5 . '</div>';
159};
160if ( $INFO [ 'ismanager' ] ) { // Pageinfo
161	echo $t5 . '<div class = "pageinfo">' .
162	$t6; tpl_pageinfo ( );
163	echo $t5 . '</div>';
164};
165if ( !empty ( $_SERVER['REMOTE_USER'] ) ) { // Userinfo
166	echo $t5 . '<div class = "user">' .
167	$t6; tpl_userinfo ( );
168	echo $t5 . '</div>';
169};
170echo $t4 . '</footer>' .
171$t3 . '</noindex>';
172// 2.5. РЕКЛАМА РСИ
173if ( $ACT == 'show' && $dw_add != '' && $comic ) echo $t3 . '<div id = "yandex_rtb_R-A-492328-1"></div>';
174echo $t2 . '</div>' .
175// 2.6. INDEXER
176$t2 . '<div class = "no">' . $t3; tpl_indexerWebBug ( ); echo $t2 . '</div>' .
177"\n\t" . '</body>
178</html>';
179