diff --git a/css/futaba.css b/css/futaba.css index 2551e23..a351b79 100644 --- a/css/futaba.css +++ b/css/futaba.css @@ -155,8 +155,8 @@ hr { } .reply { - background: #F0E0D6; - color: #800000; + background: #F0E0D6 !important; + color: #800000 !important; } .replyhl { diff --git a/imgboard.php b/imgboard.php index 5c3b520..57ff69e 100644 --- a/imgboard.php +++ b/imgboard.php @@ -566,7 +566,7 @@ if (!isset($_GET['delete']) && !isset($_GET['manage']) && (isset($_POST['name']) die(__('This post requires moderation before it can be displayed')); } - $html = buildPost($post, isset($_GET['res'])); + $html = buildPost($post, isset($_GET['res']), true); if (isset($_GET['res'])) { $html = fixLinksInRes($html); } diff --git a/inc/defines.php b/inc/defines.php index 822bcd0..6aaac90 100644 --- a/inc/defines.php +++ b/inc/defines.php @@ -109,6 +109,9 @@ if (!defined('TINYIB_EXPANDWIDTH')) { if (!defined('TINYIB_TIMEZONE')) { define('TINYIB_TIMEZONE', ''); } +if (!defined('TINYIB_BACKLINKS')) { + define('TINYIB_BACKLINKS', true); +} if (!defined('TINYIB_CATALOG')) { define('TINYIB_CATALOG', true); } diff --git a/inc/functions.php b/inc/functions.php index 02c94ea..7a70031 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -441,6 +441,13 @@ function setParent() { return TINYIB_NEWTHREAD; } +function getParent($post) { + if ($post['parent'] == TINYIB_NEWTHREAD) { + return $post['id']; + } + return $post['parent']; +} + function isRawPost() { if (isset($_POST['rawpost'])) { list($loggedin, $isadmin) = manageCheckLogIn(false); diff --git a/inc/html.php b/inc/html.php index 4231a71..6afb8ea 100644 --- a/inc/html.php +++ b/inc/html.php @@ -413,7 +413,36 @@ EOF; return $output; } -function buildPost($post, $res) { +function backlinks($post) { + if (!TINYIB_BACKLINKS) { + return ''; + } + global $thread_cache; + + $parent_id = getParent($post); + + if (!isset($thread_cache[$parent_id])) { + $thread_cache[$parent_id] = postsInThreadByID($parent_id); + } + + $needle = '>>' . $post['id']; + + $return = ''; + foreach ($thread_cache[$parent_id] as $reply) { + if (strpos($reply['message'], $needle) !== false) { + if ($return != '') { + $return .= ', '; + } + $return .= postLink('>>' . $reply['id']); + } + } + if ($return != '') { + $return = ' ' . $return; + } + return ' ' . $return . ''; +} + +function buildPost($post, $res, $compact=false) { $return = ""; $threadid = ($post['parent'] == TINYIB_NEWTHREAD) ? $post['id'] : $post['parent']; @@ -509,17 +538,22 @@ EOF; } } if ($post['parent'] == TINYIB_NEWTHREAD) { + $return .= '