From 4c2ec96e6bd7a741dbe88b310f3721e9774d81f1 Mon Sep 17 00:00:00 2001 From: Trevor Slocum Date: Fri, 11 Jun 2021 00:31:40 -0700 Subject: [PATCH] Add post type hint to reflinks Resolves #226. --- css/burichan.css | 6 +++--- imgboard.php | 1 + inc/functions.php | 3 ++- inc/html.php | 2 +- js/tinyib.js | 22 +++++++++++++--------- 5 files changed, 20 insertions(+), 14 deletions(-) diff --git a/css/burichan.css b/css/burichan.css index 8d922b6..c782009 100644 --- a/css/burichan.css +++ b/css/burichan.css @@ -190,9 +190,9 @@ hr { } .reply { - background: #D6DAF0; - color: #000000; - font-family: serif; + background: #D6DAF0 !important; + color: #000000 !important; + font-family: serif !important; } .replyhl { diff --git a/imgboard.php b/imgboard.php index 5fae100..3092bd7 100644 --- a/imgboard.php +++ b/imgboard.php @@ -572,6 +572,7 @@ if (!isset($_GET['delete']) && !isset($_GET['manage']) && (isset($_POST['name']) if (isset($_GET['res'])) { $html = fixLinksInRes($html); } + echo $html; die(); // Check if the request is to auto-refresh a thread diff --git a/inc/functions.php b/inc/functions.php index d76ff2c..f85b792 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -176,7 +176,8 @@ function fixLinksInRes($html) { function _postLink($matches) { $post = postByID($matches[1]); if ($post) { - return '' . $matches[0] . ''; + $is_op = $post['parent'] == TINYIB_NEWTHREAD; + return '' . $matches[0] . ''; } return $matches[0]; } diff --git a/inc/html.php b/inc/html.php index 2d79cf7..944343e 100644 --- a/inc/html.php +++ b/inc/html.php @@ -441,7 +441,7 @@ function backlinks($post) { if ($return != '') { $return = ' ' . $return; } - return ' ' . $return . ''; + return ' ' . $return . ''; } function buildPost($post, $res, $compact=false) { diff --git a/js/tinyib.js b/js/tinyib.js index da4c823..aaabb19 100644 --- a/js/tinyib.js +++ b/js/tinyib.js @@ -240,15 +240,15 @@ function setPostAttributes(element, autorefresh) { } if (enablebacklinks && autorefresh) { - reflinks = $('#reflinks' + m[1]); - if (reflinks) { - if (reflinks.html() == '') { - reflinks.append(' '); + backlinks = $('#backlinks' + m[1]); + if (backlinks) { + if (backlinks.html() == '') { + backlinks.append(' '); } else { - reflinks.append(', '); + backlinks.append(', '); } - reflinks.append('>>' + $(element).attr('postID') + ''); - setPostAttributes(reflinks, false); + backlinks.append('>>' + $(element).attr('postID') + ''); + setPostAttributes(backlinks, false); } } @@ -275,11 +275,15 @@ function setPostAttributes(element, autorefresh) { } else if (refpost.html() && refpost.html() != undefined) { preview.className = 'hoverpost'; $(preview).html(refpost.html()); - if (refpost.hasClass('reply')) { + if (refpost.prop("tagName").toLowerCase() == 'td') { $(preview).addClass('reply'); } } else { - $(preview).html('
Loading...
'); + extraclasses = ''; + if ($(this).hasClass('refreply')) { + extraclasses = ' reply'; + } + $(preview).html('
Loading...
'); $(preview).fadeIn(125); $.ajax({ url: base_url + $(this).attr('refID'),