From 1f80db864d498c8d76814cccef5f6f8f3ae37a19 Mon Sep 17 00:00:00 2001 From: "Fredrick Brennan:w" Date: Tue, 29 Apr 2014 14:59:17 -0400 Subject: [PATCH 1/6] Oekaki instructions --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 000fb32f..e852bd3d 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,18 @@ Wanting to have vichan in your language? You can contribute your translations at https://www.transifex.com/projects/p/tinyboard-vichan-devel/ +Oekaki +------ + +vichan makes use of [wPaint](https://github.com/websanova/wPaint) for oekaki. After you pull the repository, however, you will need to download wPaint separately using git's `submodule` feature. Use the following commands: + +``` +git submodule init +git submodule update +``` + +To enable oekaki, add all the scripts listed in `js/oekaki.js` to your `instance-config.php`. + License -------- See [LICENSE.md](http://github.com/vichan-devel/vichan/blob/master/LICENSE.md). From fdac0cbbb84d0e5b7c2d17b9aea2d1c702ee811d Mon Sep 17 00:00:00 2001 From: "Fredrick Brennan:w" Date: Tue, 29 Apr 2014 15:01:34 -0400 Subject: [PATCH 2/6] Add webm support to README --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e852bd3d..c2d57135 100644 --- a/README.md +++ b/README.md @@ -105,7 +105,6 @@ https://www.transifex.com/projects/p/tinyboard-vichan-devel/ Oekaki ------ - vichan makes use of [wPaint](https://github.com/websanova/wPaint) for oekaki. After you pull the repository, however, you will need to download wPaint separately using git's `submodule` feature. Use the following commands: ``` @@ -115,6 +114,10 @@ git submodule update To enable oekaki, add all the scripts listed in `js/oekaki.js` to your `instance-config.php`. +WebM support +------------ +Read `inc/lib/webm/README.md` for information about enabling webm. + License -------- See [LICENSE.md](http://github.com/vichan-devel/vichan/blob/master/LICENSE.md). From d3e03c11256c2c8c17bdf2a4b3a7776d4c30f8aa Mon Sep 17 00:00:00 2001 From: czaks Date: Wed, 30 Apr 2014 17:24:11 +0200 Subject: [PATCH 3/6] ukko: mod support for ukko; fixes #23 --- inc/config.php | 17 +++++++++++++++++ templates/themes/ukko/info.php | 19 ++++++++++--------- templates/themes/ukko/theme.php | 16 +++++++++------- templates/themes/ukko/ukko.js | 2 +- 4 files changed, 37 insertions(+), 17 deletions(-) diff --git a/inc/config.php b/inc/config.php index 9a1dd706..88db1db0 100644 --- a/inc/config.php +++ b/inc/config.php @@ -1526,6 +1526,23 @@ // // ... // }; + // You can also enable themes (like ukko) in mod panel like this: + // require_once("templates/themes/ukko/theme.php"); + // + // $config['mod']['custom_pages']['/\*/'] = function() { + // global $mod; + // + // $ukko = new ukko(); + // $ukko->settings = array(); + // $ukko->settings['uri'] = '*'; + // $ukko->settings['title'] = 'derp'; + // $ukko->settings['subtitle'] = 'derpity'; + // $ukko->settings['thread_limit'] = 15; + // $ukko->settings['exclude'] = ''; + // + // echo $ukko->build($mod); + // }; + // Example: Add links to dashboard (will all be in a new "Other" category). // $config['mod']['dashboard_links']['Something'] = '?/something'; diff --git a/templates/themes/ukko/info.php b/templates/themes/ukko/info.php index 34d59d4e..45a687fc 100644 --- a/templates/themes/ukko/info.php +++ b/templates/themes/ukko/info.php @@ -1,40 +1,41 @@ 'Board name', 'name' => 'title', 'type' => 'text', 'default' => 'Ukko' ); - $theme['config'][] = Array( + $theme['config'][] = array( 'title' => 'Board URI', 'name' => 'uri', 'type' => 'text', + 'default' => '*', 'comment' => '(ukko for example)' ); - $theme['config'][] = Array( + $theme['config'][] = array( 'title' => 'Subtitle', 'name' => 'subtitle', 'type' => 'text', 'comment' => '(%s = thread limit. for example "%s freshly bumped threads")' ); - $theme['config'][] = Array( + $theme['config'][] = array( 'title' => 'Excluded boards', 'name' => 'exclude', 'type' => 'text', 'comment' => '(space seperated)' ); - $theme['config'][] = Array( + $theme['config'][] = array( 'title' => 'Number of threads', 'name' => 'thread_limit', 'type' => 'text', diff --git a/templates/themes/ukko/theme.php b/templates/themes/ukko/theme.php index 88b0c4a4..2aff2837 100644 --- a/templates/themes/ukko/theme.php +++ b/templates/themes/ukko/theme.php @@ -4,7 +4,9 @@ function ukko_build($action, $settings) { $ukko = new ukko(); $ukko->settings = $settings; - $ukko->build(); + + file_write($settings['uri'] . '/index.html', $ukko->build()); + file_write($settings['uri'] . '/ukko.js', Element('themes/ukko/ukko.js', array())); } class ukko { @@ -85,17 +87,17 @@ } $body .= ''; - $body .= ''; + $body .= ''; - file_write($this->settings['uri'] . '/index.html', Element('index.html', array( + return Element('index.html', array( 'config' => $config, 'board' => $board, 'no_post_form' => true, 'body' => $body, - 'boardlist' => createBoardlist($mod) - ))); - - file_write($this->settings['uri'] . '/ukko.js', Element('themes/ukko/ukko.js', array())); + 'mod' => $mod, + 'boardlist' => createBoardlist($mod), + 'return' => ($mod ? '?' . $board['url'] . $config['file_index'] : $config['root'] . $board['dir'] . $config['file_index']) + )); } }; diff --git a/templates/themes/ukko/ukko.js b/templates/themes/ukko/ukko.js index 490f67f0..b2668e0b 100644 --- a/templates/themes/ukko/ukko.js +++ b/templates/themes/ukko/ukko.js @@ -58,7 +58,7 @@ $(document).ready(function() { $('.pages').show().html(_("No more threads to display")); } while($(window).scrollTop() + $(window).height() + 1000 > $(document).height() && !loading && overflow.length > 0) { - var page = '../' + overflow[0].board + '/' + overflow[0].page; + var page = modRoot + overflow[0].board + '/' + overflow[0].page; thread = $('div#thread_' + overflow[0].id + '[data-board="' + overflow[0].board + '"]'); if (thread.length > 0 && thread.attr("data-cached") !== 'yes') { // already present overflow.shift(); From d4753786c708be4758ec80de8feb044b4207e597 Mon Sep 17 00:00:00 2001 From: czaks Date: Wed, 30 Apr 2014 17:24:11 +0200 Subject: [PATCH 4/6] ukko: mod support for ukko; fixes #23 --- inc/config.php | 17 +++++++++++++++++ templates/themes/ukko/info.php | 19 ++++++++++--------- templates/themes/ukko/theme.php | 16 +++++++++------- templates/themes/ukko/ukko.js | 2 +- 4 files changed, 37 insertions(+), 17 deletions(-) diff --git a/inc/config.php b/inc/config.php index a4d1c6d5..0cd5bcdf 100644 --- a/inc/config.php +++ b/inc/config.php @@ -1521,6 +1521,23 @@ // // ... // }; + // You can also enable themes (like ukko) in mod panel like this: + // require_once("templates/themes/ukko/theme.php"); + // + // $config['mod']['custom_pages']['/\*/'] = function() { + // global $mod; + // + // $ukko = new ukko(); + // $ukko->settings = array(); + // $ukko->settings['uri'] = '*'; + // $ukko->settings['title'] = 'derp'; + // $ukko->settings['subtitle'] = 'derpity'; + // $ukko->settings['thread_limit'] = 15; + // $ukko->settings['exclude'] = ''; + // + // echo $ukko->build($mod); + // }; + // Example: Add links to dashboard (will all be in a new "Other" category). // $config['mod']['dashboard_links']['Something'] = '?/something'; diff --git a/templates/themes/ukko/info.php b/templates/themes/ukko/info.php index 34d59d4e..45a687fc 100644 --- a/templates/themes/ukko/info.php +++ b/templates/themes/ukko/info.php @@ -1,40 +1,41 @@ 'Board name', 'name' => 'title', 'type' => 'text', 'default' => 'Ukko' ); - $theme['config'][] = Array( + $theme['config'][] = array( 'title' => 'Board URI', 'name' => 'uri', 'type' => 'text', + 'default' => '*', 'comment' => '(ukko for example)' ); - $theme['config'][] = Array( + $theme['config'][] = array( 'title' => 'Subtitle', 'name' => 'subtitle', 'type' => 'text', 'comment' => '(%s = thread limit. for example "%s freshly bumped threads")' ); - $theme['config'][] = Array( + $theme['config'][] = array( 'title' => 'Excluded boards', 'name' => 'exclude', 'type' => 'text', 'comment' => '(space seperated)' ); - $theme['config'][] = Array( + $theme['config'][] = array( 'title' => 'Number of threads', 'name' => 'thread_limit', 'type' => 'text', diff --git a/templates/themes/ukko/theme.php b/templates/themes/ukko/theme.php index 1ca00014..5d887227 100644 --- a/templates/themes/ukko/theme.php +++ b/templates/themes/ukko/theme.php @@ -4,7 +4,9 @@ function ukko_build($action, $settings) { $ukko = new ukko(); $ukko->settings = $settings; - $ukko->build(); + + file_write($settings['uri'] . '/index.html', $ukko->build()); + file_write($settings['uri'] . '/ukko.js', Element('themes/ukko/ukko.js', array())); } class ukko { @@ -85,17 +87,17 @@ } $body .= ''; - $body .= ''; + $body .= ''; - file_write($this->settings['uri'] . '/index.html', Element('index.html', array( + return Element('index.html', array( 'config' => $config, 'board' => $board, 'no_post_form' => true, 'body' => $body, - 'boardlist' => createBoardlist($mod) - ))); - - file_write($this->settings['uri'] . '/ukko.js', Element('themes/ukko/ukko.js', array())); + 'mod' => $mod, + 'boardlist' => createBoardlist($mod), + 'return' => ($mod ? '?' . $board['url'] . $config['file_index'] : $config['root'] . $board['dir'] . $config['file_index']) + )); } }; diff --git a/templates/themes/ukko/ukko.js b/templates/themes/ukko/ukko.js index 490f67f0..b2668e0b 100644 --- a/templates/themes/ukko/ukko.js +++ b/templates/themes/ukko/ukko.js @@ -58,7 +58,7 @@ $(document).ready(function() { $('.pages').show().html(_("No more threads to display")); } while($(window).scrollTop() + $(window).height() + 1000 > $(document).height() && !loading && overflow.length > 0) { - var page = '../' + overflow[0].board + '/' + overflow[0].page; + var page = modRoot + overflow[0].board + '/' + overflow[0].page; thread = $('div#thread_' + overflow[0].id + '[data-board="' + overflow[0].board + '"]'); if (thread.length > 0 && thread.attr("data-cached") !== 'yes') { // already present overflow.shift(); From 7ab87343b7a68c7b6841d9fe5aa1697a81349059 Mon Sep 17 00:00:00 2001 From: czaks Date: Wed, 30 Apr 2014 18:28:14 +0200 Subject: [PATCH 5/6] ukko: this `return` thingy wasn`t needed --- templates/themes/ukko/theme.php | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/themes/ukko/theme.php b/templates/themes/ukko/theme.php index 5d887227..37ecf208 100644 --- a/templates/themes/ukko/theme.php +++ b/templates/themes/ukko/theme.php @@ -96,7 +96,6 @@ 'body' => $body, 'mod' => $mod, 'boardlist' => createBoardlist($mod), - 'return' => ($mod ? '?' . $board['url'] . $config['file_index'] : $config['root'] . $board['dir'] . $config['file_index']) )); } From 344b1d9731104552ef60360daecb80738a91c7d5 Mon Sep 17 00:00:00 2001 From: czaks Date: Wed, 30 Apr 2014 22:46:20 +0200 Subject: [PATCH 6/6] remove quick-reply harder --- post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/post.php b/post.php index 48973b11..8ff99e31 100644 --- a/post.php +++ b/post.php @@ -222,7 +222,7 @@ if (isset($_POST['delete'])) { } if (!$post['mod']) { - $post['antispam_hash'] = checkSpam(array($board['uri'], isset($post['thread']) && !($config['quick_reply'] && isset($_POST['quick-reply'])) ? $post['thread'] : ($config['try_smarter'] && isset($_POST['page']) ? 0 - (int)$_POST['page'] : null))); + $post['antispam_hash'] = checkSpam(array($board['uri'], isset($post['thread']) ? $post['thread'] : ($config['try_smarter'] && isset($_POST['page']) ? 0 - (int)$_POST['page'] : null))); if ($post['antispam_hash'] === true) error($config['error']['spam']); }