Index: /extensions/Evil_Blog/blog.php
===================================================================
--- /extensions/Evil_Blog/blog.php	(revision 19050)
+++ /extensions/Evil_Blog/blog.php	(revision 19050)
@@ -0,0 +1,76 @@
+<?php
+// Chech whether we are indeed included by Piwigo.
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+		$post_per_page = $page['evil_blog']['posts_per_page'];
+		//óçíàåì êîëè÷åñòâî çàïèñåé â áëîãå
+		$row = pwg_db_fetch_assoc(pwg_query("SELECT COUNT(*) FROM `".Evil_Blog_Table."`"));
+
+		if ($row["COUNT(*)"] % $post_per_page != 0) {
+			$pages = floor($row["COUNT(*)"] / $post_per_page)+1;
+			} else {$pages = floor($row["COUNT(*)"] / $post_per_page);}
+		if ((empty($tokens[1])) or ($tokens[1]<=1)) {
+			$number = 0;
+			$npage = 1;
+			} else {
+				$npage = $tokens[1];
+				if ($npage<=$pages) {
+					$number=($npage-1)*$post_per_page;
+					} else {
+					$number=($pages-1)*$post_per_page;
+					$npage=$pages;
+					}
+			}
+	
+		$query = 	"SELECT id, UNIX_TIMESTAMP(date) AS date, header, text
+					FROM `".Evil_Blog_Table."`
+					WHERE 1
+					ORDER BY `date` DESC
+					LIMIT ".$number.",".$post_per_page;
+		$result = pwg_query($query);
+		$qwe = 0;
+		while ($row = pwg_db_fetch_assoc($result)) {//áîëåå âìåíÿåìàÿ îáðàáîòêà ðåçóëüòàòà èç áàçû, íóæíî äëÿ íîðìàëüíîé ðàáîòû SMARTY
+			$row1[$qwe] = $row;
+			$row1[$qwe]['date'] = date($page['evil_blog']['date_format'], $row['date']); 
+			if($ExDesc['state'] == 'active') {
+				$row1[$qwe]['text'] = get_extended_desc($row['text']);
+				$row1[$qwe]['header'] = get_user_language_desc($row['header']);
+				}
+			$qwe++;
+			}
+		if (!empty($row1)) {
+			$template->assign('row', $row1);
+			}
+		$template->assign('npage', $npage);
+		$template->assign('pages', $pages);
+		for ($it=1; $it<=$pages; $it++) {
+			$pagi[$it] = $it;
+			}
+		if (!empty($pagi)) { 
+			$template->assign('pagi', $pagi);
+			}
+		//îïðåäåëÿåì çàãîëîâîê
+		if (($page['evil_blog']['show_on_main_page']) and ($tokens[0]!='blog')) {
+			$place = 'PLUGIN_INDEX_CONTENT_BEFORE';
+			$template->assign('TITLE', '<div id="content" class="content contentWithMenu"><h2>'.$page['evil_blog']['blog_name'].'</h2>');
+			$template->assign('TITLE_END', '</div>');
+			}else{//õëåáíûå êðîøêè
+			$place = 'PLUGIN_INDEX_CONTENT_END';
+			$page['title'] = '<a href="'.get_gallery_home_url().'">'.l10n('Home').'</a>'.$conf['level_separator'].$page['evil_blog']['blog_name'];
+			$template->assign('TITLE_END', ' ');
+			}
+		//îòñûëàåì â ÑÌÀÐÒÈ íàñòðîéêè âíåøíåãî âèäà
+		$template->assign('show_number', $page['evil_blog']['show_number']);
+		$template->assign('show_date', $page['evil_blog']['show_date']);
+		$template->assign('show_on_main_page', $page['evil_blog']['show_on_main_page']);
+		
+		//îïðåäåëÿåì àäðåñ øàáëîíà ïëàãèíà
+		$template->set_template_dir(Evil_Blog_PATH);
+		$template->set_filename('blog', 'blog.tpl');
+		//ïîäêëþ÷åíèå ñòèëÿ
+		$template->func_combine_css(array('path' => Evil_Blog_PATH.'posts.css',));
+		
+		//îáúÿâëÿåì ãäå êîíêðåòíî íà ñòðàíèöå äîëæåí âûâåñòèñü íàø øàáëîí ïëàãèíà. Âñÿ ñóòü â 'PLUGIN_INDEX_CONTENT_BEFORE'.
+		$template->concat($place,  $template->parse('blog', true));
+	
+?>
Index: /extensions/Evil_Blog/post.php
===================================================================
--- /extensions/Evil_Blog/post.php	(revision 19050)
+++ /extensions/Evil_Blog/post.php	(revision 19050)
@@ -0,0 +1,47 @@
+<?php
+// Chech whether we are indeed included by Piwigo.
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+	//óçíàåì íîìåð ñòðàíèöû íà êîòîðîé íàõîäèò ïîñò, ÷òîáû ïîëüçîâàòåëü ìîã ê íåé âåðíóòñÿ ÷åðåç ññûëêó
+	$row = pwg_db_fetch_assoc(pwg_query("SELECT COUNT(*) FROM `".Evil_Blog_Table."`"));
+		if ($row["COUNT(*)"] % $page['evil_blog']['posts_per_page'] != 0) {
+			$pages = floor($row["COUNT(*)"] / $page['evil_blog']['posts_per_page'])+1;
+			} else {$pages = floor($row["COUNT(*)"] / $page['evil_blog']['posts_per_page']);}
+			
+	$npage = floor($tokens[2] / $page['evil_blog']['posts_per_page'])+1;
+	$npage = $pages-$npage+1;
+	/////
+	$query = "SELECT id, UNIX_TIMESTAMP(date) AS date, header, text
+				FROM `".Evil_Blog_Table."`
+				WHERE `id`=".$tokens[2];
+	$row = pwg_db_fetch_assoc(pwg_query($query));
+	if (!empty($row)){
+		$row['date'] = date($page['evil_blog']['date_format'], $row['date']); 
+		if($ExDesc['state'] == 'active') {
+			$row['text'] = get_extended_desc($row['text']);
+			$row['header'] = get_user_language_desc($row['header']);
+			}
+		$template->assign('row', $row);
+		$template->assign('npage', $npage);
+		//îòñûëàåì â ÑÌÀÐÒÈ íàñòðîéêè âíåøíåãî âèäà
+		$template->assign('show_number', $page['evil_blog']['show_number']);
+		$template->assign('show_date', $page['evil_blog']['show_date']);
+		$template->assign('show_on_main_page', $page['evil_blog']['show_on_main_page']);
+		$page['title'] = '<a href="'.get_gallery_home_url().'">'.l10n('Home').'</a>'.$conf['level_separator'];
+		if ( ($npage==1) and ($page['evil_blog']['show_on_main_page']) ) {
+				$page['title'] .= '<a href="'.get_gallery_home_url().'">'.$page['evil_blog']['blog_name'].'</a>';
+			}else{
+				$page['title'] .= '<a href="'.get_root_url().'?/blog/'.$npage.'">'.$page['evil_blog']['blog_name'].'</a>';
+			}
+		$page['title'] .= $conf['level_separator'].'<a href="'.get_root_url().'?/blog/id/'.$row['id'].'">'.$row['header'].'</a>';
+		
+		//îïðåäåëÿåì àäðåñ øàáëîíà ïëàãèíà
+		$template->set_template_dir(Evil_Blog_PATH);
+		$template->set_filename('post', 'post.tpl');
+		//ïîäêëþ÷åíèå ñòèëÿ
+		$template->func_combine_css(array('path' => Evil_Blog_PATH.'posts.css',));
+		
+		//îáúÿâëÿåì ãäå êîíêðåòíî íà ñòðàíèöå äîëæåí âûâåñòèñü íàø øàáëîí ïëàãèíà. Âñÿ ñóòü â 'PLUGIN_INDEX_CONTENT_BEFORE'.
+		$template->concat('PLUGIN_INDEX_CONTENT_END',  $template->parse('post', true));
+	}
+?>
Index: /extensions/Evil_Blog/post.tpl
===================================================================
--- /extensions/Evil_Blog/post.tpl	(revision 19050)
+++ /extensions/Evil_Blog/post.tpl	(revision 19050)
@@ -0,0 +1,26 @@
+<ul class="evil_blog_posts">
+	<li class="thumbnailCategory">
+		<span class="post_title">
+			<span class="post_number">
+				{if isset($show_number) and $show_number}{$row.id} * {/if} 
+			</span>
+			<span class="post_header">
+				<a href="{$ROOT_URL}?/blog/id/{$row.id}">{$row.header}</a>
+			</span>
+			<span class="post_date">
+				{if isset($show_date) and $show_date}{$row.date}{/if}
+			</span>
+		</span>
+		<div class="post_description">
+			{$row.text}
+		</div>
+	</li>
+</ul>
+<h2>
+	{if $npage==1 and $show_on_main_page}
+		<a href="{$ROOT_URL}?/">
+		{else}
+		<a href="{$ROOT_URL}?/blog/{$npage}">
+		{/if}
+		{'back'|@translate}</a>
+</h2>
