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

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) function parse_bb_code($text)
{ {
$bbCodes = array( $bbCodes = [
// Стандартные BB коды // Стандартные BB коды
'/\[(\/?)(b|i|u|s)\s*\]/' => "<$1$2>", '/\[(\/?)(b|i|u|s)\s*\]/' => "<$1$2>",
'/\[(left|center|right)\]/' => '<p style="text-align:$1;">', '/\[(left|center|right)\]/' => '<p style="text-align:$1;">',
@ -175,7 +175,7 @@ function parse_bb_code($text)
'/\:pal\:/' => '<img src="i/smile/pal.gif" />', '/\:pal\:/' => '<img src="i/smile/pal.gif" />',
'/\:nun\:/' => '<img src="i/smile/nun.gif" />', '/\:nun\:/' => '<img src="i/smile/nun.gif" />',
'/\:ura\:/' => '<img src="i/smile/ura.gif" />', '/\:ura\:/' => '<img src="i/smile/ura.gif" />',
); ];
$text = preg_replace(array_keys($bbCodes), array_values($bbCodes), $text); $text = preg_replace(array_keys($bbCodes), array_values($bbCodes), $text);
$text = close_dangling_tags($text); $text = close_dangling_tags($text);
@ -335,18 +335,10 @@ if (isset($_GET['do']) && $isModerator == true) {
exit(); 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"/> <link rel="stylesheet" href="css/wysibb/theme/default/wbbtheme.css"/>
<script type="text/javascript" language="JavaScript" src='js/forum.js'></script> <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"> <tr valign="top">
<td width="200"> <td width="200">
@ -449,7 +441,7 @@ if (isset($_GET['do']) && $isModerator == true) {
</a> </a>
<?php endif; ?> <?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'] ?>"> <a href="?topic=<?= $_GET['topic'] ?>&konftop=<?= htmlspecialchars($_GET['conf']) ?>&page=<?= $_GET['page'] ?>&dp=<?= $row['id'] ?>">
<small>Удалить</small> <small>Удалить</small>
</a> | </a> |
@ -473,8 +465,9 @@ if (isset($_GET['do']) && $isModerator == true) {
<table width="100%"> <table width="100%">
<tr> <tr>
<td> <td>
<?= $row['author'] ?> <span class="date">(<?= $row['date'] ?>)</span> <?= $row['author'] ?> <span
<?php if ($isModerator AND isset($_GET['conf']) AND isset($_GET['page'])): ?> 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'] ?>"> <a href="?topic=<?= $_GET['topic'] ?>&konftop=<?= htmlspecialchars($_GET['conf']) ?>&page=<?= $_GET['page'] ?>&dp=<?= $row['id'] ?>">
<small>Удалить</small> <small>Удалить</small>
</a> </a>
@ -692,9 +685,11 @@ if (isset($_GET['do']) && $isModerator == true) {
<input type="hidden" name="icon" value="13"> <input type="hidden" name="icon" value="13">
</td> </td>
<td align="right"> <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" 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> </td>
</tr> </tr>
</table> </table>
@ -708,7 +703,9 @@ 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 --> <!-- End of text -->
@ -722,5 +719,3 @@ if (isset($_GET['do']) && $isModerator == true) {
<input type='hidden' id='numt' name='numt'/> <input type='hidden' id='numt' name='numt'/>
</form> </form>
<? endif; ?> <? endif; ?>
</body>
</html>