Внедрение шаблонизатора.

This commit is contained in:
Igor Barkov (iwork) 2020-09-30 17:53:03 +03:00
parent 885300ab05
commit 7e91ef21db

View File

@ -33,7 +33,7 @@ $replasepost = '';
function parse_bb_code($text)
{
$bbCodes = array(
$bbCodes = [
// Стандартные BB коды
'/\[(\/?)(b|i|u|s)\s*\]/' => "<$1$2>",
'/\[(left|center|right)\]/' => '<p style="text-align:$1;">',
@ -175,7 +175,7 @@ function parse_bb_code($text)
'/\:pal\:/' => '<img src="i/smile/pal.gif" />',
'/\:nun\:/' => '<img src="i/smile/nun.gif" />',
'/\:ura\:/' => '<img src="i/smile/ura.gif" />',
);
];
$text = preg_replace(array_keys($bbCodes), array_values($bbCodes), $text);
$text = close_dangling_tags($text);
@ -335,19 +335,11 @@ if (isset($_GET['do']) && $isModerator == true) {
exit();
}
}
Template::header('Форум');
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Форум</title>
<meta charset="utf-8">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/wysibb/theme/default/wbbtheme.css"/>
<script type="text/javascript" language="JavaScript" src='js/forum.js'></script>
</head>
<body>
<table width="100%" border="0">
<table width="100%" border="0">
<tr valign="top">
<td width="200">
<br/>
@ -449,7 +441,7 @@ if (isset($_GET['do']) && $isModerator == true) {
</a>
<?php endif; ?>
<?php if ($isModerator AND (isset($_GET['conf']) OR isset($_GET['page']))): ?>
<?php if ($isModerator and (isset($_GET['conf']) or isset($_GET['page']))): ?>
<a href="?topic=<?= $_GET['topic'] ?>&konftop=<?= htmlspecialchars($_GET['conf']) ?>&page=<?= $_GET['page'] ?>&dp=<?= $row['id'] ?>">
<small>Удалить</small>
</a> |
@ -473,8 +465,9 @@ if (isset($_GET['do']) && $isModerator == true) {
<table width="100%">
<tr>
<td>
<?= $row['author'] ?> <span class="date">(<?= $row['date'] ?>)</span>
<?php if ($isModerator AND isset($_GET['conf']) AND isset($_GET['page'])): ?>
<?= $row['author'] ?> <span
class="date">(<?= $row['date'] ?>)</span>
<?php if ($isModerator and isset($_GET['conf']) and isset($_GET['page'])): ?>
<a href="?topic=<?= $_GET['topic'] ?>&konftop=<?= htmlspecialchars($_GET['conf']) ?>&page=<?= $_GET['page'] ?>&dp=<?= $row['id'] ?>">
<small>Удалить</small>
</a>
@ -692,9 +685,11 @@ if (isset($_GET['do']) && $isModerator == true) {
<input type="hidden" name="icon" value="13">
</td>
<td align="right">
<input type="submit" class="btn" value="Добавить" name="add"/>
<input type="submit" class="btn" value="Добавить"
name="add"/>
<input type="hidden" name="n" value="klans">
<input type="hidden" id="act" name="act" value="add_branch"/>
<input type="hidden" id="act" name="act"
value="add_branch"/>
</td>
</tr>
</table>
@ -708,13 +703,15 @@ if (isset($_GET['do']) && $isModerator == true) {
<?
}
}
} else echo ' <div style="width: 300px; margin: auto; font-weight: bold;">Ничего не найдено!</div> ';
} else {
echo ' <div style="width: 300px; margin: auto; font-weight: bold;">Ничего не найдено!</div> ';
}
}
?>
<!-- End of text -->
</td>
</tr>
</table>
</table>
<?php if ($isModerator == true): ?>
<form name='repltopic' method='post'>
@ -722,5 +719,3 @@ if (isset($_GET['do']) && $isModerator == true) {
<input type='hidden' id='numt' name='numt'/>
</form>
<? endif; ?>
</body>
</html>