Browse Source

Update and BugFix - Added Links to Archive and Featured Archive and Reload to Thread Pages and Catalog - Added Announcements to Catalog - And Small Bugfix to Announcements where link to [Show all] was wrong

main
PupperWoff 7 years ago
committed by discomrade
parent
commit
8544714057
  1. 11
      inc/announcements.php
  2. 1
      inc/archive.php
  3. 2
      inc/config.php
  4. 1
      inc/mod/pages.php
  5. 20
      templates/index.html
  6. 6
      templates/mod/archive_list.html
  7. 8
      templates/themes/catalog/catalog.html
  8. 8
      templates/thread.html

11
inc/announcements.php

@ -78,7 +78,7 @@ class Announcements {
static public function buildAnnouncementPages() {
global $config;
// Generate page for full list of announcements
// Generate pages for full list of announcements
if($config['announcements']['page'])
{
// Generate JSON file for full list of announcements
@ -105,12 +105,21 @@ class Announcements {
'announcements' => $announcements,
'mod' => false,
'token_json' => false,
'uri_json' => $config['root'] . $config['announcements']['file_json'],
))
));
file_write($config['dir']['home'] . $config['announcements']['page_html'], $announcement_page);
}
}
static public function stream_json($out = false, $filter_staff = false, $date_format = "%m/%d/%Y", $count = false) {
$query = query("SELECT ``announcements``.*, `username` FROM ``announcements``
LEFT JOIN ``mods`` ON ``mods``.`id` = `creator`
ORDER BY `date` DESC" . (($count === false)?"":" LIMIT " . (int)$count)) or error(db_error($query));
$announcements = $query->fetchAll(PDO::FETCH_ASSOC);
}
/* Might be used later for mobile API
static public function stream_json($out = false, $filter_staff = false, $date_format, $count = false) {
$query = query("SELECT ``announcements``.*, `username` FROM ``announcements``

1
inc/archive.php

@ -250,6 +250,7 @@ class Archive {
'body' => Element("mod/archive_list.html", array(
'config' => $config,
'thread_count' => $query->rowCount(),
'board' => $board,
'archive' => $archive
))
));

2
inc/config.php

@ -1310,6 +1310,8 @@
$config['archive']['threads'] = true;
// Indicate if it is possible to mark threads as featured (stored forever)
$config['feature']['threads'] = true;
// Indicate if link to featured archive should be shown on post and thread page
$config['feature']['link_post_page'] = false;
// Days to keep archived threads before deletion (if set to false all archived threads are kept forever)
$config['archive']['lifetime'] = 3;

1
inc/mod/pages.php

@ -3622,6 +3622,7 @@ function mod_view_archive($boardName) {
mod_page(sprintf(_('Archived') . ' %s: ' . $config['board_abbreviation'], _('threads'), $board['uri']), 'mod/archive_list.html', array(
'archive' => $archive,
'thread_count' => $query->rowCount(),
'board' => $board,
'token' => make_secure_link_token($board['uri']. '/archive/')
));
}

20
templates/index.html

@ -62,7 +62,13 @@
<span id="index-links-top" class="index-links">
<a id="index-bottom" href="#bottom">[{% trans %}Go to bottom{% endtrans %}]</a>
{% if config.catalog_link %}
<a id="index-catalog-top" href="{{ config.root }}{{ board.dir }}{{ config.catalog_link }}">[{% trans %}Catalog{% endtrans %}]</a>
<a id="index-catalog-top" href="{{ config.root }}{% if mod %}{{ config.file_mod }}?/{% endif %}{{ board.dir }}{{ config.catalog_link }}">[{% trans %}Catalog{% endtrans %}]</a>
{% endif %}
{% if config.archive.threads %}
<a id="index-archive-top" href="{{ config.root }}{% if mod %}{{ config.file_mod }}?/{% endif %}{{ board.dir }}{{ config.dir.archive }}">[{% trans %}Archive{% endtrans %}]</a>
{% endif %}
{% if config.feature.threads and config.feature.link_post_page %}
<a id="index-feature-top" href="{{ config.root }}{% if mod %}{{ config.file_mod }}?/{% endif %}{{ board.dir }}{{ config.dir.featured }}">[{% trans %}Featured{% endtrans %}]</a>
{% endif %}
{% if config.board_search %}
<!-- Start Search Form -->
@ -76,17 +82,23 @@
<!-- End Search Form -->
{% endif %}
</span>
<hr />
<form name="postcontrols" action="{{ config.post_url }}" method="post">
<input type="hidden" name="board" value="{{ board.uri }}" />
{% if mod %}<input type="hidden" name="mod" value="1" />{% endif %}
<hr />
{{ body }}
<div>
<span id="index-links-bottom" class="index-links">
<a id="index-top" href="#top">[{% trans %}Go to top{% endtrans %}]</a>
{% if config.catalog_link %}
<a id="index-catalog-bottom" href="{{ config.root }}{{ board.dir }}{{ config.catalog_link }}">[{% trans %}Catalog{% endtrans %}]</a>
{% endif %}
<a id="index-catalog-bottom" href="{{ config.root }}{% if mod %}{{ config.file_mod }}?/{% endif %}{{ board.dir }}{{ config.catalog_link }}">[{% trans %}Catalog{% endtrans %}]</a>
{% endif %}
{% if config.archive.threads %}
<a id="index-archive-bottom" href="{{ config.root }}{% if mod %}{{ config.file_mod }}?/{% endif %}{{ board.dir }}{{ config.dir.archive }}">[{% trans %}Archive{% endtrans %}]</a>
{% endif %}
{% if config.feature.threads and config.feature.link_post_page %}
<a id="index-feature-bottom" href="{{ config.root }}{% if mod %}{{ config.file_mod }}?/{% endif %}{{ board.dir }}{{ config.dir.featured }}">[{% trans %}Featured{% endtrans %}]</a>
{% endif %}
</span>
</div>
{% include 'report_delete.html' %}

6
templates/mod/archive_list.html

@ -1,5 +1,11 @@
{% if config.feature.threads %}
<p style="text-align: center">
<a id="unimportant" href="{{ config.root }}{% if mod %}{{ config.file_mod }}?/{% endif %}{{ board.dir }}{{ config.dir.featured }}">[{% trans %}Featured Thread Archive{% endtrans %}]</a>
</p>
{% endif %}
<p style="text-align: center">
<b>{% trans 'Displaying' %} {{ thread_count }} {% trans 'expired threads' %}{% if config.archive.lifetime %} {% trans 'from the past' %} {{ config.archive.lifetime }} {% trans 'days' %}{% endif %}</b>
</p>

8
templates/themes/catalog/catalog.html

@ -19,6 +19,8 @@
{% include 'post_form.html' %}
{% if config.announcements.show %}<table class="announcements" id="announcements"></table>{% endif %}
<span>{% trans 'Sort by' %}: </span>
<select id="sort_by" style="display: inline-block">
<option selected value="bump:desc">{% trans 'Bump order' %}</option>
@ -33,6 +35,12 @@
<option selected value="small">{% trans 'Small' %}</option>
<option value="large">{% trans 'Large' %}</option>
</select>
&nbsp;
<a id="catalog-reload-top" href="{{ config.root }}{% if mod %}{{ config.file_mod }}?/{% endif %}{{ board.dir }}{{ config.catalog_link }}">[{% trans %}Reload{% endtrans %}]</a>
{% if config.archive.threads %}<a id="catalog-archive-top" href="{{ config.root }}{% if mod %}{{ config.file_mod }}?/{% endif %}{{ board.dir }}{{ config.dir.archive }}">[{% trans %}Archive{% endtrans %}]</a>{% endif %}
{% if config.feature.threads and config.feature.link_post_page %}<a id="catalog-feature-top" href="{{ config.root }}{{ board.dir }}{{ config.dir.featured }}">[{% trans %}Featured{% endtrans %}]</a>{% endif %}
<div class="threads">
<div id="Grid">
{% for post in recent_posts %}

8
templates/thread.html

@ -58,21 +58,21 @@
<span id="thread-links-top" class="thread-links">
<a id="thread-goto-bottom" href="#bottom">[{% trans %}Go to bottom{% endtrans %}]</a>
{% if config.catalog_link %}
<a id="thread-catalog-top" href="{{ config.root }}{{ board.dir }}{{ config.catalog_link }}">[{% trans %}Catalog{% endtrans %}]</a>
<a id="thread-catalog-top" href="{{ config.root }}{% if mod %}{{ config.file_mod }}?/{% endif %}{{ board.dir }}{{ config.catalog_link }}">[{% trans %}Catalog{% endtrans %}]</a>
{% endif %}
<a id="thread-return-top" href="{{ return }}">[{% trans %}Return{% endtrans %}]</a>
</span>
</div>
<hr />
<form name="postcontrols" action="{{ config.post_url }}" method="post">
<input type="hidden" name="board" value="{{ board.uri }}" />
{% if mod %}<input type="hidden" name="mod" value="1" />{% endif %}
<hr />
{{ body }}
<div id="thread-interactions">
<span id="thread-links-bottom" class="thread-links">
<a id="thread-goto-top" href="#top">[{% trans %}Go to top{% endtrans %}]</a>
{% if config.catalog_link %}
<a id="thread-catalog-bottom" href="{{ config.root }}{{ board.dir }}{{ config.catalog_link }}">[{% trans %}Catalog{% endtrans %}]</a>
{% if config.catalog_link %}
<a id="thread-catalog-bottom" href="{{ config.root }}{% if mod %}{{ config.file_mod }}?/{% endif %}{{ board.dir }}{{ config.catalog_link }}">[{% trans %}Catalog{% endtrans %}]</a>
{% endif %}
<a id="thread-return-bottom" href="{{ return }}">[{% trans %}Return{% endtrans %}]</a>
</span>

Loading…
Cancel
Save