';
+ }
+
+ 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 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
(limited to 'templates')
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 fe95b3302208d6b60e13a9a9399b08c5e43a3972 Mon Sep 17 00:00:00 2001
From: czaks
Date: Tue, 25 Mar 2014 12:05:07 +0100
Subject: recent posts link
---
templates/mod/dashboard.html | 3 +++
1 file changed, 3 insertions(+)
(limited to 'templates')
diff --git a/templates/mod/dashboard.html b/templates/mod/dashboard.html
index 7b907533..f83edafc 100644
--- a/templates/mod/dashboard.html
+++ b/templates/mod/dashboard.html
@@ -100,6 +100,9 @@
{% if mod|hasPermission(config.mod.modlog) %}
{% trans 'Moderation log' %}
{% endif %}
+ {% if mod|hasPermission(config.mod.recent_posts) %}
+ {% trans 'Recent posts' %}
+ {% endif %}
{% if mod|hasPermission(config.mod.rebuild) %}
{% trans 'Rebuild' %}
{% endif %}
--
cgit v1.3
From 1e92e678a61ea588197604a3acb51be35e393f66 Mon Sep 17 00:00:00 2001
From: czaks
Date: Tue, 25 Mar 2014 12:09:12 +0100
Subject: add a javascript
---
templates/mod/recent_posts.html | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'templates')
diff --git a/templates/mod/recent_posts.html b/templates/mod/recent_posts.html
index c106b4e8..4a2f9baa 100644
--- a/templates/mod/recent_posts.html
+++ b/templates/mod/recent_posts.html
@@ -1,5 +1,6 @@
+
{% if posts|count %}
({% trans 'There are no active posts.' %})
{% else %}
-{% endif %}
\ No newline at end of file
+{% endif %}
--
cgit v1.3
From b1490bed316f64e1e4a4215aebe90e990801e446 Mon Sep 17 00:00:00 2001
From: czaks
Date: Tue, 25 Mar 2014 12:09:59 +0100
Subject: favelaframes is nothing more than frameset AFAIC
---
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 7571 -> 0 bytes
7 files changed, 425 deletions(-)
delete mode 100644 templates/themes/favelaframes/favelaframes.css
delete mode 100644 templates/themes/favelaframes/frames.html
delete mode 100644 templates/themes/favelaframes/info.php
delete mode 100644 templates/themes/favelaframes/news.html
delete mode 100644 templates/themes/favelaframes/sidebar.html
delete mode 100644 templates/themes/favelaframes/theme.php
delete mode 100644 templates/themes/favelaframes/thumb.png
(limited to 'templates')
diff --git a/templates/themes/favelaframes/favelaframes.css b/templates/themes/favelaframes/favelaframes.css
deleted file mode 100644
index 5f0f0db6..00000000
--- a/templates/themes/favelaframes/favelaframes.css
+++ /dev/null
@@ -1,84 +0,0 @@
-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
deleted file mode 100644
index ccbd377e..00000000
--- a/templates/themes/favelaframes/frames.html
+++ /dev/null
@@ -1,102 +0,0 @@
-
-
-
-
-
-
- {% if settings.tryresponsive %}
-
-
- {% endif %}
-
- {{ settings.title }}
-
-
-
-
-
- 55
-
-
-
diff --git a/templates/themes/favelaframes/info.php b/templates/themes/favelaframes/info.php
deleted file mode 100644
index b82a2b6d..00000000
--- a/templates/themes/favelaframes/info.php
+++ /dev/null
@@ -1,87 +0,0 @@
- '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
deleted file mode 100644
index 2b32a78b..00000000
--- a/templates/themes/favelaframes/news.html
+++ /dev/null
@@ -1,40 +0,0 @@
-{% 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
deleted file mode 100644
index 5ee84d80..00000000
--- a/templates/themes/favelaframes/sidebar.html
+++ /dev/null
@@ -1,38 +0,0 @@
-{% filter remove_whitespace %}
-
-
-
-
- {{ settings.title }}
-
-
-
-
-
-
-
-
-
-{% endfilter %}
diff --git a/templates/themes/favelaframes/theme.php b/templates/themes/favelaframes/theme.php
deleted file mode 100644
index d31a324e..00000000
--- a/templates/themes/favelaframes/theme.php
+++ /dev/null
@@ -1,74 +0,0 @@
- $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
deleted file mode 100644
index df18a8e9..00000000
Binary files a/templates/themes/favelaframes/thumb.png and /dev/null differ
--
cgit v1.3
From 15810c9bedb5b7d18baec0f845bb3177f867471e Mon Sep 17 00:00:00 2001
From: czaks
Date: Tue, 25 Mar 2014 12:15:40 +0100
Subject: fix permission name
---
templates/mod/dashboard.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'templates')
diff --git a/templates/mod/dashboard.html b/templates/mod/dashboard.html
index f83edafc..2c370a11 100644
--- a/templates/mod/dashboard.html
+++ b/templates/mod/dashboard.html
@@ -100,7 +100,7 @@
{% if mod|hasPermission(config.mod.modlog) %}
{% trans 'Moderation log' %}
{% endif %}
- {% if mod|hasPermission(config.mod.recent_posts) %}
+ {% if mod|hasPermission(config.mod.recent) %}
{% trans 'Recent posts' %}
{% endif %}
{% if mod|hasPermission(config.mod.rebuild) %}
--
cgit v1.3