- PHP файл
- Создайте новый .php файл под названием rules.php и положите его в корень phpBB (там где config.php) с помощью следующего кода:
Инструкция для prosilver
Код: Выделить всё
<?php /** * * @package * @version $Id$ * @copyright (c) * @license http://opensource.org/licenses/gpl-license.php GNU Public License * */ /** * @ignore */ define('IN_PHPBB', true); $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); include($phpbb_root_path . 'common.' . $phpEx); // Start session management $user->session_begin(); $auth->acl($user->data); $user->setup(); page_header('Правила конференции'); $template->set_filenames(array( 'body' => 'rules.html', )); page_footer(); ?> - Создайте новый .css файл в папке /styles/prosilver/theme/ под названием rules.css с помощью следующего кода:
Код: Выделить всё
.activerule { background-color:#ECD5D8; color: #BC2A4D; font-weight: bold; } p.pages { font-size: 10pt; } ol.headers { margin-left: 19px; } ol.headers h3 { border-bottom: none; color: #BC2A4D; font-size: 9pt; list-style-type: decimal; margin-bottom: 2px; } ol.rulespage li { line-height: 1.2em; padding: 5px; font-size: 10pt; list-style-type: lower-alpha; margin-left: -10px; } #col1 { float: left; width: 69%; } #col2 { margin-left: 1%; float: right; width: 30%; } div.mini-panel { padding: 0 10px; background-color: #ebebeb; margin-bottom: 5px; } div.mini-panel h3 { font-family: Verdana, Helvetica, Arial, sans-serif; margin: 5px 0 0 0; font-weight: bold; color: #333333; } div.mini-panel span.corners-top, div.mini-panel span.corners-bottom { margin: 0 -10px; } ul.menu { border-top: 1px solid #FFFFFF; list-style: none; } ul.menu li { padding: 5px 0 4px 0; border-bottom: 1px solid #CCCCCC; margin: 0; } ul.menu li.last { border-bottom: none; } - Далее, откройте /styles/prosliver/theme/stylesheet.css
НайдитеДобавьте послеКод: Выделить всё
@import url("colours.css");Код: Выделить всё
@import url("rules.css"); - Создайте новый .html файл под названием rules.html в папке /styles/prosilver/template с помощью следующего кода:
Код: Выделить всё
<!-- INCLUDE overall_header.html --> <div id="col1"> <div class="panel" style="background-color: #FFFFFF;"> <div class="inner"><span class="corners-top"><span></span></span> <div class="content"> <ol class="headers"> <li><h3 id="rule1">Раздел 1</h3> <ol class="rulespage"> <li id="rule1a">Здесь текст ваших правил <a href="#rule1a" onclick="highlight('rule1a');"><span style="text-decoration: underline;">#</span></a></li> <li id="rule1b">Здесь текст ваших правил <a href="#rule1b" onclick="highlight('rule1b');"><span style="text-decoration: underline;">#</span></a></li> </ol> </li> <li><h3 id="rule2">Раздел 2</h3> <ol class="rulespage"> <li id="rule2a">Здесь текст ваших правил <a href="#rule2a" onclick="highlight('rule2a');"><span style="text-decoration: underline;">#</span></a></li> <li id="rule2b">Здесь текст ваших правил <a href="#rule2b" onclick="highlight('rule2b');"><span style="text-decoration: underline;">#</span></a></li> </ol> </li> </ol> </div> <span class="corners-bottom"><span></span></span></div> </div> </div> <div id="col2"> <div class="mini-panel"> <div class="inner"><span class="corners-top"><span></span></span> <h3>Разделы правил</h3> <ul class="menu"> <li><a href="#rule1" onclick="highlight('');">Раздел 1</a></li> <li class="last"><a href="#rule2" onclick="highlight('');">Раздел 2</a></li> </ul> <span class="corners-bottom"><span></span></span></div> </div> </div> <!-- INCLUDE overall_footer.html --> - Далее, откройте /styles/prosilver/template/overall_header.html
И найдитеДобавить послеКод: Выделить всё
<script type="text/javascript" src="{T_TEMPLATE_PATH}/styleswitcher.js"></script>Код: Выделить всё
<!-- IF SCRIPT_NAME eq 'rules' --> <script type="text/javascript"> // <![CDATA[ window.onload = function() { var pos = location.href.indexOf("#"); if(pos != -1) { highlight(location.href.slice(pos + 1)); } }; var oldID = false; function highlight(id) { if(oldID != false && oldID != id) { document.getElementById(oldID).className = ''; } document.getElementById(id).className = 'activerule'; oldID = id; } // ]]> </script> <!-- ENDIF -->
- Инструкция для subsilver2
- Откройте /styles/subsilver2/theme/stylesheet.css и найдите следующий код
Добавьте после
Код: Выделить всё
.username-coloured { font-weight: bold; }Код: Выделить всё
/* Rules ------------ */ .activerule { background-color: #F9CC79; color: #323D4F; font-weight: bold; } ol.headers li { list-style-type: decimal; } ol.headers h3 { font-size:1.1em; margin-top: 1em; font-weight: bold; color: #323D4F; } ol.rulespage li { line-height: 1.2em; padding: 5px; font-size: 10pt; list-style-type: lower-alpha; margin-left: 1.5em; } - Создайте новый .html файл под названием rules.html в папке /styles/subsilver2/template с помощью следующего кода:
Код: Выделить всё
<!-- INCLUDE overall_header.html --> <div id="pagecontent"> <table class="tablebg" width="100%" cellspacing="1"> <tr> <th>Правила</th> </tr> <tr> <td class="row1"> <span class="gen"><b>Разделы правил</b></span><br /> <span class="gen"><a class="postlink" href="#rule1" onclick="highlight('');">Раздел 1</a></span><br /> <span class="gen"><a class="postlink" href="#rule2" onclick="highlight('');">Раздел 2</a></span><br /> <br /> </td> </tr> <tr> <td class="cat"> </td> </tr> </table> <br clear="all" /> <table class="tablebg" width="100%" cellspacing="1"> <ol class="headers"> <tr> <td class="cat" align="center"></td> </tr> <tr> <td class="row1" valign="top"> <div class="postbody"> <li><h3 id="rule1">Раздел 1</h3> <ol class="rulespage"> <li id="rule1a">rule 1a <a href="#rule1a" onclick="highlight('rule1a');"><span style="text-decoration: underline;">#</span></a></li> <li id="rule1b">rule 1b <a href="#rule1b" onclick="highlight('rule1b');"><span style="text-decoration: underline;">#</span></a></li> </ol> </li> <li><h3 id="rule2">Раздел 2</h3> <ol class="rulespage"> <li id="rule2a">rule 2a <a href="#rule2a" onclick="highlight('rule2a');"><span style="text-decoration: underline;">#</span></a></li> <li id="rule2b">rule 2b <a href="#rule2b" onclick="highlight('rule2b');"><span style="text-decoration: underline;">#</span></a></li> </ol> </li> </div> </td> </tr> <tr> <td class="spacer" height="1"><img src="images/spacer.gif" alt="" width="1" height="1" /></td> </tr> </ol> </table> </div> <!-- INCLUDE breadcrumbs.html --> <br clear="all" /> <div align="{S_CONTENT_FLOW_END}"><!-- INCLUDE jumpbox.html --></div> <!-- INCLUDE overall_footer.html --> - Далее, откройте /styles/subsilver2/template/overall_header.html
И найдитеДобавить послеКод: Выделить всё
<script type="text/javascript"> // <![CDATA[ <!-- IF S_USER_PM_POPUP and S_NEW_PM --> popup('{UA_POPUP_PM}', 400, 225, '_phpbbprivmsg'); <!-- ENDIF -->Код: Выделить всё
<!-- IF SCRIPT_NAME eq 'rules' --> <script type="text/javascript"> // <![CDATA[ window.onload = function() { var pos = location.href.indexOf("#"); if(pos != -1) { highlight(location.href.slice(pos + 1)); } }; var oldID = false; function highlight(id) { if(oldID != false && oldID != id) { document.getElementById(oldID).className = ''; } document.getElementById(id).className = 'activerule'; oldID = id; } // ]]> </script> <!-- ENDIF -->
И так, мы закончили, теперь у нас есть отдельная страница с правилами конференции.
Теперь нужно зайти в
Администраторский раздел - стили - шаблоны - обновить
Администраторский раздел - стили - темы - обновить
Если все равно нет желаемого результата, нажмите CTRL+F5 или перезапустите браузер.
Оригинал статьи

