From e31e6af834c20c09abf95759af4a7ec67d182e03 Mon Sep 17 00:00:00 2001
From: Fredrick Brennan
Date: Sat, 28 Mar 2015 17:25:29 +0800
Subject: [PATCH 1/3] Add parsedown library
---
.gitmodules | 5 +++++
inc/lib/parsedown | 1 +
2 files changed, 6 insertions(+)
create mode 160000 inc/lib/parsedown
diff --git a/.gitmodules b/.gitmodules
index 098b04e2..c050039d 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -2,3 +2,8 @@
path = js/wPaint
url = https://github.com/ctrlcctrlv/wPaint.git
branch = master
+
+[submodule "inc/lib/parsedown"]
+ path = inc/lib/parsedown
+ url = https://github.com/erusev/parsedown.git
+ branch = master
diff --git a/inc/lib/parsedown b/inc/lib/parsedown
new file mode 160000
index 00000000..468d1e3d
--- /dev/null
+++ b/inc/lib/parsedown
@@ -0,0 +1 @@
+Subproject commit 468d1e3da8bde049debee7f484a4f9c4b26b41ba
From 5ccebaf0f617ef8aa27fcd7bf6b49f3265ada16c Mon Sep 17 00:00:00 2001
From: Fredrick Brennan
Date: Sat, 28 Mar 2015 18:15:08 +0800
Subject: [PATCH 2/3] I've made enough commits to this project to have a spot
in the license file I think :^)
---
LICENSE.md | 23 +++++++++++++++++++++++
README.md | 20 +++++++-------------
templates/8chan/index.html | 4 ----
templates/generic_page.html | 1 +
templates/index.html | 1 +
templates/page.html | 1 +
templates/themes/basic/index.html | 1 +
templates/themes/catalog/catalog.html | 2 ++
templates/themes/categories/news.html | 1 +
templates/themes/frameset/news.html | 1 +
templates/themes/recent/recent.html | 1 +
templates/thread.html | 1 +
12 files changed, 40 insertions(+), 17 deletions(-)
diff --git a/LICENSE.md b/LICENSE.md
index 942ac82a..677d15b1 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -1,3 +1,26 @@
+# License of infinity
+Copyright (c) 2013-2015 Infinity Development Group (https://github.com/ctrlcctrlv/infinity)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+All copyright notices and permission notices (including this file) shall be
+included and remain unedited in all copies or substantial portions of the
+Software. This explicitly includes but is not limited to the vichan copyright
+notices found in the footers of some template files.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
# License of vichan
Copyright (c) 2012-2014 vichan-devel
diff --git a/README.md b/README.md
index ecc9e239..46abe61d 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@ infinity
About
------------
-infinity is a fork of vichan, with the difference that infinity is geared towards allowing users to create their own boards. A running instance is at [8ch.net](https://8ch.net/)
+infinity is a fork of vichan, with the difference that infinity is geared towards allowing users to create their own boards. A running instance is at [8ch.net](https://8ch.net/) (new! a user of the software wrote to me that they created a Polish version: [8ch.pl](http://8ch.pl/))
Most things (other than installation) that apply to upstream vichan also apply to infinity. See their readme for a detailed FAQ: https://github.com/vichan-devel/vichan/blob/master/README.md
@@ -15,12 +15,12 @@ Basic requirements:
A computer running a Unix or Unix-like OS(infinity has been specifically tested with and is known to work under Ubuntu 14.x), Apache, MySQL, and PHP
* Make sure Apache has read/write access to the directory infinity resides in.
* `install.php` is not maintained. Don't use it.
-* As of February 22, 2015, you need the [DirectIO module (dio.so)](http://php.net/manual/en/ref.dio.php).
+* As of February 22, 2015, you need the [DirectIO module (dio.so)](http://php.net/manual/en/ref.dio.php). This is for compatibility with NFS.
Step 1. Create infinity's database from the included install.sql file. Enter mysql and create an empty database named 'infinity'. Then cd into the infinity base directory and run:
```
mysql -uroot -p infinity < install.sql
-echo 'infinity' > .installed
+echo '+ infinity '`git rev-parse HEAD|head -c 10` > .installed
```
Step 2. /inc/secrets.php does not exist by default, but infinity needs it in order to function. To fix this, cd into /inc/ and run:
@@ -40,18 +40,12 @@ Now open secrets.php and edit the $config['db'] settings to point to the 'infini
$config['cache']['enabled'] = 'apc';
```
-Step 3.(Optional) By default, infinity will ignore any changes you make to the template files until you log into mod.php, go to Rebuild, and select Flush Cache. You may find this inconvenient. To make infinity automatically accept your changes to the template files, open /inc/template.php and add:
+Step 3.(Optional) By default, infinity will ignore any changes you make to the template files until you log into mod.php, go to Rebuild, and select Flush Cache. You may find this inconvenient. To make infinity automatically accept your changes to the template files, set $config['twig_cache'].
+
+Step 4. Infinity can function in a *very* barebones fashion after the first two steps, but you should probably install these additional packages if you want to seriously run it and/or contribute to it. ffmpeg may fail to install under certain versions of Ubuntu. If it does, remove it from this script and install it via an alternate method. Make sure to run the below as root:
```
-'auto_reload' => true
-```
-
-To the array of settings passed to Twig_Environment().
-
-Step 4. Infinity can function in a very barebones fashion after the first two steps, but you should probably install these additional packages if you want to seriously run it and/or contribute to it. ffmpeg may fail to install under certain versions of Ubuntu. If it does, remove it from this script and install it via an alternate method. Make sure to run the below as root:
-
-```
-apt-get install graphicsmagick gifsicle php5-fpm mysql-client php5-mysql php5-cli php-pear php5-apcu; add-apt-repository ppa:jon-severinsson/ffmpeg; add-apt-repository ppa:nginx/stable; apt-get update; apt-get install nginx ffmpeg; pear install Net_DNS2
+apt-get install graphicsmagick gifsicle php5-fpm mysql-client php5-mysql php5-cli php-pear php5-apcu php5-dev; add-apt-repository ppa:jon-severinsson/ffmpeg; add-apt-repository ppa:nginx/stable; apt-get update; apt-get install nginx ffmpeg; pear install Net_DNS2; pecl install "channel://pecl.php.net/dio-0.0.7"
```
Step 5. The current captcha provider listed inc/config.php is dead. You may want to work around this.
diff --git a/templates/8chan/index.html b/templates/8chan/index.html
index 5c37cebf..7a2664f8 100644
--- a/templates/8chan/index.html
+++ b/templates/8chan/index.html
@@ -326,10 +326,6 @@
diff --git a/templates/generic_page.html b/templates/generic_page.html
index 4cd31162..2d53bea6 100644
--- a/templates/generic_page.html
+++ b/templates/generic_page.html
@@ -40,6 +40,7 @@
vichan {{ config.version }} -
Tinyboard Copyright © 2010-2014 Tinyboard Development Group
vichan Copyright © 2012-2014 vichan-devel
+
infinity Copyright © 2013-2015 Fredrick Brennan & Infinity Development Group
{% for footer in config.footer %}{{ footer }}
{% endfor %}
+
+
+{% 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 %}
+
{% trans %}Existing pages{% endtrans %}
+{% if pages %}
+
+
+
{% trans %}Create a new page{% endtrans %}
+
+
+
diff --git a/templates/mod/settings.html b/templates/mod/settings.html
index c0f43ced..97aebec9 100644
--- a/templates/mod/settings.html
+++ b/templates/mod/settings.html
@@ -76,11 +76,11 @@
{% trans %}Edit board flags{% endtrans %}
{% trans %}Edit board volunteers{% endtrans %}
{% trans %}Edit board tags{% endtrans %}
+ {% trans %}Edit board pages{% endtrans %}
diff --git a/tools/import_rules.php b/tools/import_rules.php
new file mode 100644
index 00000000..f583f035
--- /dev/null
+++ b/tools/import_rules.php
@@ -0,0 +1,16 @@
+ $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));
+ }
+}