summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Foster <savetheinternet@tinyboard.org>2013-07-16 02:48:20 -0400
committerMichael Foster <savetheinternet@tinyboard.org>2013-07-16 02:48:20 -0400
commit29b10c88db1ba16210e753e1fcf08d702455a674 (patch)
treed6527facb56c8459cb63f1cd4b921cdc051e2160
parent7302fc57a8f83c6fe40f9c751259d9c616ebdaec (diff)
Outputting thread subject in header/title (issue #122)
-rw-r--r--inc/config.php3
-rw-r--r--inc/functions.php5
-rw-r--r--templates/index.html2
-rw-r--r--templates/thread.html2
4 files changed, 8 insertions, 4 deletions
diff --git a/inc/config.php b/inc/config.php
index 83b98c2b..ed4a31f1 100644
--- a/inc/config.php
+++ b/inc/config.php
@@ -527,6 +527,9 @@
// Number of characters in the poster ID (maximum is 40)
$config['poster_id_length'] = 5;
+ // Show thread subject in page title?
+ $config['thread_subject_in_title'] = false;
+
// Page footer
$config['footer'][] = 'All trademarks, copyrights, comments, and images on this page are owned by and are the responsibility of their respective parties.';
diff --git a/inc/functions.php b/inc/functions.php
index 67019e0a..4b0e56d8 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -1537,8 +1537,9 @@ function buildThread($id, $return=false, $mod=false) {
error($config['error']['nonexistant']);
$body = Element('thread.html', array(
- 'board'=>$board,
- 'body'=>$thread->build(),
+ 'board' => $board,
+ 'thread' => $thread,
+ 'body' => $thread->build(),
'config' => $config,
'id' => $id,
'mod' => $mod,
diff --git a/templates/index.html b/templates/index.html
index 112756d1..9b25e1be 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -4,7 +4,7 @@
<meta charset="utf-8">
<link rel="stylesheet" media="screen" href="{{ config.url_stylesheet }}">
{% if config.url_favicon %}<link rel="shortcut icon" href="{{ config.url_favicon }}">{% endif %}
- <title>{{ board.url }} - {{ board.name }}</title>
+ <title>{{ board.url }} - {{ board.title|e }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes">
{% if config.meta_keywords %}<meta name="keywords" content="{{ config.meta_keywords }}">{% endif %}
{% if config.default_stylesheet.1 != '' %}<link rel="stylesheet" type="text/css" id="stylesheet" href="{{ config.uri_stylesheets }}{{ config.default_stylesheet.1 }}">{% endif %}
diff --git a/templates/thread.html b/templates/thread.html
index 5442166f..aea8abb5 100644
--- a/templates/thread.html
+++ b/templates/thread.html
@@ -4,7 +4,7 @@
<meta charset="utf-8">
<link rel="stylesheet" media="screen" href="{{ config.url_stylesheet }}">
{% if config.url_favicon %}<link rel="shortcut icon" href="{{ config.url_favicon }}">{% endif %}
- <title>{{ board.url }} - {{ board.name }}</title>
+ <title>{{ board.url }} - {% if config.thread_subject_in_title and thread.subject %}{{ thread.subject }}{% else %}{{ board.title|e }}{% endif %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes">
{% if config.meta_keywords %}<meta name="keywords" content="{{ config.meta_keywords }}">{% endif %}
{% if config.default_stylesheet.1 != '' %}<link rel="stylesheet" type="text/css" id="stylesheet" href="{{ config.uri_stylesheets }}{{ config.default_stylesheet.1 }}">{% endif %}