committed by
czaks
9 changed files with 328 additions and 6 deletions
@ -1,3 +1,9 @@ |
|||
[submodule "js/wPaint"] |
|||
path = js/wPaint |
|||
url = https://github.com/vichan-devel/wPaint.git |
|||
branch = master |
|||
|
|||
[submodule "inc/lib/parsedown"] |
|||
path = inc/lib/parsedown |
|||
url = https://github.com/vichan-devel/parsedown |
|||
branch = master |
|||
|
@ -0,0 +1,29 @@ |
|||
<div style="text-align:center"> |
|||
<form method="POST"> |
|||
<input name="token" value="{{ token }}" type="hidden"> |
|||
<table> |
|||
<tr> |
|||
<th>{% trans %}Markup method{% endtrans %} |
|||
{% set allowed_html = config.allowed_html %} |
|||
{% trans %}<p class="unimportant">"markdown" is provided by <a href="http://parsedown.org/">parsedown</a>. Note: images disabled.</p> |
|||
<p class="unimportant">"html" allows the following tags:<br/>{{ allowed_html }}</p> |
|||
<p class="unimportant">"infinity" is the same as what is used in posts.</p> |
|||
<p class="unimportant">This page will not convert between formats,<br/>choose it once or do the conversion yourself!</p>{% endtrans %} |
|||
</th> |
|||
<td> |
|||
<select name="method"> |
|||
{% for markup in ['markdown', 'html', 'infinity'] %} |
|||
<option value="{{ markup }}" {% if page.type == markup %}selected{% endif %}>{{ markup }}</option> |
|||
{% endfor %} |
|||
</select> |
|||
</td></tr> |
|||
<tr><th>{% trans %}Page content{% endtrans %} |
|||
<br/> |
|||
<span class="unimportant">{% trans %}Page will appear at:{% endtrans %} |
|||
{% if board %} <a href="/{{ board.uri }}/{{ page.name }}.html">{{ config.domain }}/{{ board.uri }}/{{ page.name }}.html</a> |
|||
{% else %} <a href="/{{ page.name }}.html">{{ config.site }}/{{ page.name }}.html</a> |
|||
{% endif %}</span></th><td><textarea name="content" style="height:500px;width:500px">{{content}}</textarea></td><tr> |
|||
</table> |
|||
<input type="submit" value="Save page"> |
|||
</form> |
|||
</div> |
@ -0,0 +1,34 @@ |
|||
<script type="text/javascript" src="js/jquery.min.js"></script> |
|||
<div style="text-align:center"> |
|||
<p class="unimportant"> |
|||
{% if board %} |
|||
{% set page_max = config.pages_max %} |
|||
{% trans %}This page allows you to create static pages for your board. The limit is {{ page_max }} pages per board. You will still have to link to your pages somewhere in your board, for example in a sticky or in the board's announcement. To make links in the board's announcement, use <a> HTML tags.{% endtrans %} |
|||
{% else %} |
|||
{% trans %}This page allows you to create static pages for your imageboard.{% endtrans %} |
|||
{% endif %} |
|||
<h2>{% trans %}Existing pages{% endtrans %}</h2> |
|||
{% if pages %} |
|||
<form> |
|||
<table style="margin:auto"> |
|||
<tr><th>{% trans %}URL{% endtrans %}</th><th>{% trans %}Title{% endtrans %}</th><th>{% trans %}Edit{% endtrans %}</th><th>{% trans %}Delete{% endtrans %}</tr> |
|||
{% for page in pages %} |
|||
<tr><td>{{ page.name }}</td><td>{{ page.title }}</td><td><a href="?/edit_page/{{ page.id }}">{% trans %}Edit{% endtrans %}</a></td><td><a href="?/edit_pages/delete/{{ page.name }}{% if board %}/{{ board }}{% endif %}/{{ page.delete_token }}">{% trans %}Delete{% endtrans %}</a></td> |
|||
{% endfor %} |
|||
{% else %} |
|||
<em>No pages yet!</em> |
|||
{% endif %} |
|||
</table> |
|||
</form> |
|||
<hr/> |
|||
<h2>{% trans %}Create a new page{% endtrans %}</h2> |
|||
<form method="POST"> |
|||
<input type="hidden" name="token" value="{{ token }}"> |
|||
<table> |
|||
<tr><th>{% trans %}URL{% endtrans %}</th><th>{% trans %}Title{% endtrans %}</th></tr> |
|||
<tr><td><input type="text" name="page"></td><td><input type="text" name="title"></td> |
|||
</table> |
|||
<input type="submit" value="{% trans %}Create{% endtrans %}"> |
|||
</form> |
|||
|
|||
</div> |
@ -0,0 +1,16 @@ |
|||
<?php |
|||
// This script imports rules.txt files from the old system into the new ``pages`` table. |
|||
|
|||
require dirname(__FILE__) . '/inc/cli.php'; |
|||
|
|||
$boards = listBoards(TRUE); |
|||
|
|||
foreach ($boards as $i => $b) { |
|||
$rules = @file_get_contents($b.'/rules.txt'); |
|||
if ($rules && !empty(trim($rules))) { |
|||
$query = prepare('INSERT INTO ``pages``(name, title, type, board, content) VALUES("rules", "Rules", "html", :board, :content)'); |
|||
$query->bindValue(':board', $b); |
|||
$query->bindValue(':content', $rules); |
|||
$query->execute() or error(db_error($query)); |
|||
} |
|||
} |
Loading…
Reference in new issue