';
+ }
+
+ echo Element('modpage.html', array(
+ 'config' => $config,
+ 'mod' => $mod,
+ 'hide_dashboard_link' => true,
+ 'title' => _('Recent posts'),
+ 'subtitle' => '',
+ 'nojavascript' => false,
+ 'is_recent_posts' => true,
+ 'body' => $body
+ )
+ );
+
+}
function mod_config($board_config = false) {
global $config, $mod, $board;
diff --git a/js/recent-posts.js b/js/recent-posts.js
new file mode 100644
index 00000000..c65f6991
--- /dev/null
+++ b/js/recent-posts.js
@@ -0,0 +1,73 @@
+/*
+ * recent-posts.js
+ *
+ * Recent posts controlling script
+ *
+ * Released under the WTFPL license
+ * Copyright (c) 2014 sinuca <#55ch@rizon.net>
+ *
+ * Requires jquery
+ * incomplete
+ *
+ */
+
+$(document).ready(function(){
+
+ if (!localStorage.hiddenrecentposts)
+ localStorage.hiddenrecentposts = '{}';
+
+ if (!localStorage.recentpostscount)
+ localStorage.recentpostscount = 25;
+
+ // Load data from HTML5 localStorage
+ var hidden_data = JSON.parse(localStorage.hiddenrecentposts);
+
+ var store_data_posts = function() {
+ localStorage.hiddenrecentposts = JSON.stringify(hidden_data);
+ }
+
+ // Delete old hidden posts (7+ days old)
+ for (var key in hidden_data) {
+ for (var id in hidden_data[key]) {
+ if (hidden_data[key][id] < Math.round(Date.now() / 1000) - 60 * 60 * 24 * 7) {
+ delete hidden_data[key][id];
+ store_data_posts();
+ }
+ }
+ }
+
+ var do_hide_posts = function() {
+ var data = $(this).attr('id');
+ var splitted = data.split('-');
+ var id = splitted[2];
+ var post_container = $(this).parent();
+
+ var board = post_container.data("board");
+
+ if (!hidden_data[board]) {
+ hidden_data[board] = {};
+ }
+
+ $('
Dismiss ')
+ .insertBefore(post_container.find('a.eita-link:first'))
+ .click(function(){
+ hidden_data[board][id] = Math.round(Date.now() / 1000);
+ store_data_posts();
+
+ post_container.closest('hr').hide();
+ post_container.children().hide();
+ });
+ if(hidden_data[board][id])
+ post_container.find('a.hide-post-link').click();
+ }
+
+ $('a.eita-link').each(do_hide_posts);
+
+ $('#erase-local-data').click(function(){
+ hidden_data = {};
+ store_data_posts();
+ $(this).html('Loading...');
+ location.reload();
+ });
+
+});
\ No newline at end of file
diff --git a/mod.php b/mod.php
index e5b14878..6918dc57 100644
--- a/mod.php
+++ b/mod.php
@@ -65,6 +65,8 @@ $pages = array(
'/bans/(\d+)' => 'secure_POST bans', // ban list
'/ban-appeals' => 'secure_POST ban_appeals', // view ban appeals
+ '/recent/(\d+)' => 'recent_posts', // view recent posts
+
'/search' => 'search_redirect', // search
'/search/(posts|IP_notes|bans|log)/(.+)/(\d+)' => 'search', // search
'/search/(posts|IP_notes|bans|log)/(.+)' => 'search', // search
diff --git a/templates/mod/recent_posts.html b/templates/mod/recent_posts.html
new file mode 100644
index 00000000..c106b4e8
--- /dev/null
+++ b/templates/mod/recent_posts.html
@@ -0,0 +1,5 @@
+{% if posts|count %}
+
({% trans 'There are no active posts.' %})
+{% else %}
+
+{% endif %}
\ No newline at end of file
--
cgit v1.3
From e0a89c597d3de8867d0faa01244fe8d5d06c34cc Mon Sep 17 00:00:00 2001
From: czaks
Date: Tue, 25 Mar 2014 11:37:39 +0100
Subject: move recent-posts to mod
---
js/mod/recent-posts.js | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++
js/recent-posts.js | 73 --------------------------------------------------
2 files changed, 73 insertions(+), 73 deletions(-)
create mode 100644 js/mod/recent-posts.js
delete mode 100644 js/recent-posts.js
diff --git a/js/mod/recent-posts.js b/js/mod/recent-posts.js
new file mode 100644
index 00000000..c65f6991
--- /dev/null
+++ b/js/mod/recent-posts.js
@@ -0,0 +1,73 @@
+/*
+ * recent-posts.js
+ *
+ * Recent posts controlling script
+ *
+ * Released under the WTFPL license
+ * Copyright (c) 2014 sinuca <#55ch@rizon.net>
+ *
+ * Requires jquery
+ * incomplete
+ *
+ */
+
+$(document).ready(function(){
+
+ if (!localStorage.hiddenrecentposts)
+ localStorage.hiddenrecentposts = '{}';
+
+ if (!localStorage.recentpostscount)
+ localStorage.recentpostscount = 25;
+
+ // Load data from HTML5 localStorage
+ var hidden_data = JSON.parse(localStorage.hiddenrecentposts);
+
+ var store_data_posts = function() {
+ localStorage.hiddenrecentposts = JSON.stringify(hidden_data);
+ }
+
+ // Delete old hidden posts (7+ days old)
+ for (var key in hidden_data) {
+ for (var id in hidden_data[key]) {
+ if (hidden_data[key][id] < Math.round(Date.now() / 1000) - 60 * 60 * 24 * 7) {
+ delete hidden_data[key][id];
+ store_data_posts();
+ }
+ }
+ }
+
+ var do_hide_posts = function() {
+ var data = $(this).attr('id');
+ var splitted = data.split('-');
+ var id = splitted[2];
+ var post_container = $(this).parent();
+
+ var board = post_container.data("board");
+
+ if (!hidden_data[board]) {
+ hidden_data[board] = {};
+ }
+
+ $(' Dismiss ')
+ .insertBefore(post_container.find('a.eita-link:first'))
+ .click(function(){
+ hidden_data[board][id] = Math.round(Date.now() / 1000);
+ store_data_posts();
+
+ post_container.closest('hr').hide();
+ post_container.children().hide();
+ });
+ if(hidden_data[board][id])
+ post_container.find('a.hide-post-link').click();
+ }
+
+ $('a.eita-link').each(do_hide_posts);
+
+ $('#erase-local-data').click(function(){
+ hidden_data = {};
+ store_data_posts();
+ $(this).html('Loading...');
+ location.reload();
+ });
+
+});
\ No newline at end of file
diff --git a/js/recent-posts.js b/js/recent-posts.js
deleted file mode 100644
index c65f6991..00000000
--- a/js/recent-posts.js
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * recent-posts.js
- *
- * Recent posts controlling script
- *
- * Released under the WTFPL license
- * Copyright (c) 2014 sinuca <#55ch@rizon.net>
- *
- * Requires jquery
- * incomplete
- *
- */
-
-$(document).ready(function(){
-
- if (!localStorage.hiddenrecentposts)
- localStorage.hiddenrecentposts = '{}';
-
- if (!localStorage.recentpostscount)
- localStorage.recentpostscount = 25;
-
- // Load data from HTML5 localStorage
- var hidden_data = JSON.parse(localStorage.hiddenrecentposts);
-
- var store_data_posts = function() {
- localStorage.hiddenrecentposts = JSON.stringify(hidden_data);
- }
-
- // Delete old hidden posts (7+ days old)
- for (var key in hidden_data) {
- for (var id in hidden_data[key]) {
- if (hidden_data[key][id] < Math.round(Date.now() / 1000) - 60 * 60 * 24 * 7) {
- delete hidden_data[key][id];
- store_data_posts();
- }
- }
- }
-
- var do_hide_posts = function() {
- var data = $(this).attr('id');
- var splitted = data.split('-');
- var id = splitted[2];
- var post_container = $(this).parent();
-
- var board = post_container.data("board");
-
- if (!hidden_data[board]) {
- hidden_data[board] = {};
- }
-
- $(' Dismiss ')
- .insertBefore(post_container.find('a.eita-link:first'))
- .click(function(){
- hidden_data[board][id] = Math.round(Date.now() / 1000);
- store_data_posts();
-
- post_container.closest('hr').hide();
- post_container.children().hide();
- });
- if(hidden_data[board][id])
- post_container.find('a.hide-post-link').click();
- }
-
- $('a.eita-link').each(do_hide_posts);
-
- $('#erase-local-data').click(function(){
- hidden_data = {};
- store_data_posts();
- $(this).html('Loading...');
- location.reload();
- });
-
-});
\ No newline at end of file
--
cgit v1.3
From b0c837ce9369b932cecff91966dacdaef4a96952 Mon Sep 17 00:00:00 2001
From: sinuca <55vitaminado@gmail.com>
Date: Tue, 25 Mar 2014 11:41:20 +0100
Subject: expand-images.js: shrink all images functionality
---
js/expand-all-images.js | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/js/expand-all-images.js b/js/expand-all-images.js
index 6ef58ca9..fc273e5e 100644
--- a/js/expand-all-images.js
+++ b/js/expand-all-images.js
@@ -7,6 +7,7 @@
* Released under the MIT license
* Copyright (c) 2012-2013 Michael Save
* Copyright (c) 2013-2014 Marcin Łabanowski
+ * Copyright (c) 2014 sinuca <#55ch@rizon.net>
*
* Usage:
* $config['additional_javascript'][] = 'js/jquery.min.js';
@@ -25,6 +26,16 @@ onready(function(){
if (!$(this).parent()[0].dataset.expanded)
$(this).parent().click();
});
- $(this).parent().remove();
+
+ $('hr:first').before('');
+ $('div#shrink-all-images a')
+ .text(_('Shrink all images'))
+ .click(function(){
+ $('a img.post-image').each(function() {
+ if ($(this).parent()[0].dataset.expanded)
+ $(this).parent().click();
+ });
+ $(this).parent().remove();
+ });
});
});
--
cgit v1.3
From 1e78987ef638cc899be7993d3a7938e51b16ad6d Mon Sep 17 00:00:00 2001
From: sinuca <55vitaminado@gmail.com>
Date: Tue, 18 Mar 2014 00:39:13 -0300
Subject: Added ukko and favelaframes themes
---
templates/themes/favelaframes/favelaframes.css | 84 ++++++++++++++++++++
templates/themes/favelaframes/frames.html | 102 +++++++++++++++++++++++++
templates/themes/favelaframes/info.php | 87 +++++++++++++++++++++
templates/themes/favelaframes/news.html | 40 ++++++++++
templates/themes/favelaframes/sidebar.html | 38 +++++++++
templates/themes/favelaframes/theme.php | 74 ++++++++++++++++++
templates/themes/favelaframes/thumb.png | Bin 0 -> 7571 bytes
7 files changed, 425 insertions(+)
create mode 100644 templates/themes/favelaframes/favelaframes.css
create mode 100644 templates/themes/favelaframes/frames.html
create mode 100644 templates/themes/favelaframes/info.php
create mode 100644 templates/themes/favelaframes/news.html
create mode 100644 templates/themes/favelaframes/sidebar.html
create mode 100644 templates/themes/favelaframes/theme.php
create mode 100644 templates/themes/favelaframes/thumb.png
diff --git a/templates/themes/favelaframes/favelaframes.css b/templates/themes/favelaframes/favelaframes.css
new file mode 100644
index 00000000..5f0f0db6
--- /dev/null
+++ b/templates/themes/favelaframes/favelaframes.css
@@ -0,0 +1,84 @@
+body {
+ font-family: sans-serif;
+ background: none repeat scroll 0 0 #EEFDFF;
+ font-size: 12px;
+ margin: 6px;
+ padding: 0;
+}
+
+h1.title {
+ font-family: Verdana, Tahoma, sans-serif;
+ font-size: 23px;
+ color: #333300;
+ margin-top: 1em;
+ background: none;
+ letter-spacing: normal;
+}
+
+header div.subtitle {
+ font-family: Verdana, Tahoma, sans-serif;
+ color: #333300;
+ font-weight: normal;
+ font-size: medium;
+ font-style: italic;
+}
+
+div.favelito {
+ text-align: center;
+}
+
+.favelito {
+ display: block;
+ height: auto;
+ max-width: 100%;
+ vertical-align: middle;
+}
+
+div.news-content {
+ margin-left: 1em;
+ text-align: justify;
+}
+
+h2 {
+ color: #000;
+ background: #D6F0E4;
+}
+
+div.sidebar h2 {
+ font-family: Verdana, Tahoma, sans-serif;
+ font-size: 18px;
+}
+
+div.sidebar h3 {
+ margin: 0;
+ background: #D6F0E4;
+ font-size: 100%
+}
+
+div.fav_irc h4 {
+ font-family: Verdana, Tahoma, sans-serif;
+ margin: 0;
+ font-size: 10px;
+ background: #D6F0E4;
+}
+
+div.fav_irc h4 a {
+ color: #FF7800;
+ text-decoration: none;
+ vertical-align: top;
+}
+
+ul.fav_nav {
+ margin-top: 0;
+ padding: 0;
+ list-style: none;
+}
+
+ul.fav_nav a {
+ text-decoration: none;
+ color: #555500;
+}
+
+.sidebar a:hover {
+ text-decoration: underline;
+}
\ No newline at end of file
diff --git a/templates/themes/favelaframes/frames.html b/templates/themes/favelaframes/frames.html
new file mode 100644
index 00000000..ccbd377e
--- /dev/null
+++ b/templates/themes/favelaframes/frames.html
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+ {% if settings.tryresponsive %}
+
+
+ {% endif %}
+
+ {{ settings.title }}
+
+
+
+
+
+ 55
+
+
+
diff --git a/templates/themes/favelaframes/info.php b/templates/themes/favelaframes/info.php
new file mode 100644
index 00000000..b82a2b6d
--- /dev/null
+++ b/templates/themes/favelaframes/info.php
@@ -0,0 +1,87 @@
+ 'Site title',
+ 'name' => 'title',
+ 'type' => 'text'
+ );
+
+ $theme['config'][] = Array(
+ 'title' => 'Slogan',
+ 'name' => 'subtitle',
+ 'type' => 'text',
+ 'comment' => '(optional)'
+ );
+
+ $theme['config'][] = Array(
+ 'title' => 'Main HTML file',
+ 'name' => 'file_main',
+ 'type' => 'text',
+ 'default' => $config['file_index'],
+ 'comment' => '(eg. "index.html")'
+ );
+
+ $theme['config'][] = Array(
+ 'title' => 'Sidebar file',
+ 'name' => 'file_sidebar',
+ 'type' => 'text',
+ 'default' => 'sidebar.html',
+ 'comment' => '(eg. "sidebar.html")'
+ );
+
+ $theme['config'][] = Array(
+ 'title' => 'News file',
+ 'name' => 'file_news',
+ 'type' => 'text',
+ 'default' => 'news.html',
+ 'comment' => '(eg. "news.html")'
+ );
+
+ $theme['config'][] = Array(
+ 'title' => 'IRC url',
+ 'name' => 'irc_url',
+ 'type' => 'text',
+ 'default' => 'http://qchat.rizon.net/?nick=Anao.&channels=55ch&uio=d4',
+ 'comment' => '(optional) Link to IRC channel'
+ );
+
+ $theme['config'][] = Array(
+ 'title' => 'IRC address',
+ 'name' => 'irc_address',
+ 'type' => 'text',
+ 'default' => '#55ch@rizon.net',
+ 'comment' => '(optional) IRC channel address to appear as a label to the url entered above'
+ );
+
+ $theme['config'][] = Array(
+ 'title' => 'CSS file',
+ 'name' => 'css',
+ 'type' => 'text',
+ 'default' => 'favelaframes.css',
+ 'comment' => '(eg. "favelaframes.css")'
+ );
+
+ $theme['config'][] = Array(
+ 'title' => 'Try the little responsive thingy thing',
+ 'name' => 'tryresponsive',
+ 'type' => 'checkbox',
+ 'default' => true,
+ 'comment' => 'With this checked, the menu frame will become collapsible when viewport width is under 767px.'
+ );
+
+ // Unique function name for building everything
+ $theme['build_function'] = 'favelaframes_build';
+?>
diff --git a/templates/themes/favelaframes/news.html b/templates/themes/favelaframes/news.html
new file mode 100644
index 00000000..2b32a78b
--- /dev/null
+++ b/templates/themes/favelaframes/news.html
@@ -0,0 +1,40 @@
+{% filter remove_whitespace %}
+
+
+
+
+ {{ settings.title }}
+
+
+
+
+
+
+
+ {% if news|count == 0 %}
+
(No news to show.)
+ {% else %}
+ {% for entry in news %}
+
+ {% if entry.subject %}
+ {{ entry.subject }}
+ {% else %}
+ no subject
+ {% endif %}
+ — by {{ entry.name }} at {{ entry.time|date(config.post_date) }}
+
+
{{ entry.body }}
+ {% endfor %}
+ {% endif %}
+
+
+ Powered by Tinyboard {{ config.version }} | Tinyboard Copyright © 2010-2012 Tinyboard Development Group
+
+
+{% endfilter %}
diff --git a/templates/themes/favelaframes/sidebar.html b/templates/themes/favelaframes/sidebar.html
new file mode 100644
index 00000000..5ee84d80
--- /dev/null
+++ b/templates/themes/favelaframes/sidebar.html
@@ -0,0 +1,38 @@
+{% filter remove_whitespace %}
+
+
+
+
+ {{ settings.title }}
+
+
+
+
+
+
+
+
+
+{% endfilter %}
diff --git a/templates/themes/favelaframes/theme.php b/templates/themes/favelaframes/theme.php
new file mode 100644
index 00000000..d31a324e
--- /dev/null
+++ b/templates/themes/favelaframes/theme.php
@@ -0,0 +1,74 @@
+ $config, 'settings' => $settings));
+ }
+
+ // Build news page
+ public static function news($settings) {
+ global $config;
+
+ $query = query("SELECT * FROM ``news`` ORDER BY `time` DESC") or error(db_error());
+ $news = $query->fetchAll(PDO::FETCH_ASSOC);
+
+ return Element('themes/favelaframes/news.html', Array(
+ 'settings' => $settings,
+ 'config' => $config,
+ 'news' => $news
+ ));
+ }
+
+ // Build sidebar
+ public static function sidebar($settings) {
+ global $config, $board;
+
+ $categories = $config['categories'];
+
+ foreach ($categories as &$boards) {
+ foreach ($boards as &$board) {
+ $title = boardTitle($board);
+ if (!$title)
+ $title = $board; // board doesn't exist, but for some reason you want to display it anyway
+ $board = Array('title' => $title, 'uri' => sprintf($config['board_path'], $board));
+ }
+ }
+
+ return Element('themes/favelaframes/sidebar.html', Array(
+ 'settings' => $settings,
+ 'config' => $config,
+ 'categories' => $categories
+ ));
+ }
+ };
+
+?>
diff --git a/templates/themes/favelaframes/thumb.png b/templates/themes/favelaframes/thumb.png
new file mode 100644
index 00000000..df18a8e9
Binary files /dev/null and b/templates/themes/favelaframes/thumb.png differ
--
cgit v1.3
From 9d9d514919625ac66178198045b2a997d282b5c7 Mon Sep 17 00:00:00 2001
From: czaks
Date: Tue, 25 Mar 2014 11:57:36 +0100
Subject: we no have any modpages.html
---
inc/mod/pages.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/inc/mod/pages.php b/inc/mod/pages.php
index b9f3b045..9294e801 100644
--- a/inc/mod/pages.php
+++ b/inc/mod/pages.php
@@ -2266,7 +2266,7 @@ function mod_recent_posts($lim) {
$body .= $replacement . '';
}
- echo Element('modpage.html', array(
+ echo Element('page.html', array(
'config' => $config,
'mod' => $mod,
'hide_dashboard_link' => true,
--
cgit v1.3
From fe95b3302208d6b60e13a9a9399b08c5e43a3972 Mon Sep 17 00:00:00 2001
From: czaks