diff options
| author | Benjamin Southall <applemansigloo@gmail.com> | 2017-04-28 01:12:38 +0900 |
|---|---|---|
| committer | Benjamin Southall <applemansigloo@gmail.com> | 2017-04-28 01:12:38 +0900 |
| commit | b3ffae870524e67bcd356beba0a5333c4b9b23d4 (patch) | |
| tree | 13d18e3f60ee2a62dde0b2ca5bcff8110d8dbc98 /templates/themes | |
| parent | acb8c5db6e610275d4d9e7f2dbebcdae85fd02c4 (diff) | |
Fix ukko scroll to post is too high / incorrect bug because of post_controls being display block on ukko threads. Add ordering by sticky to ukko2 and ukko3 forms for overboards
Diffstat (limited to 'templates/themes')
| -rw-r--r-- | templates/themes/ukko/theme.php | 2 | ||||
| -rw-r--r-- | templates/themes/ukko/ukko.js | 2 | ||||
| -rw-r--r-- | templates/themes/ukko2/theme.php | 4 | ||||
| -rw-r--r-- | templates/themes/ukko2/ukko.js | 2 | ||||
| -rw-r--r-- | templates/themes/ukko3/theme.php | 4 | ||||
| -rw-r--r-- | templates/themes/ukko3/ukko.js | 2 |
6 files changed, 8 insertions, 8 deletions
diff --git a/templates/themes/ukko/theme.php b/templates/themes/ukko/theme.php index 1d98f836..6faf7139 100644 --- a/templates/themes/ukko/theme.php +++ b/templates/themes/ukko/theme.php @@ -73,7 +73,7 @@ openBoard($post['board']); $thread = new Thread($post, $mod ? '?/' : $config['root'], $mod); - $posts = prepare(sprintf("SELECT * FROM ``posts_%s`` WHERE `thread` = :id ORDER BY `id` DESC LIMIT :limit", $post['board'])); + $posts = prepare(sprintf("SELECT * FROM ``posts_%s`` WHERE `thread` = :id ORDER BY `sticky` DESC, `id` DESC LIMIT :limit", $post['board'])); $posts->bindValue(':id', $post['id']); $posts->bindValue(':limit', ($post['sticky'] ? $config['threads_preview_sticky'] : $config['threads_preview']), PDO::PARAM_INT); $posts->execute() or error(db_error($posts)); diff --git a/templates/themes/ukko/ukko.js b/templates/themes/ukko/ukko.js index deeccfd0..b2668e0b 100644 --- a/templates/themes/ukko/ukko.js +++ b/templates/themes/ukko/ukko.js @@ -84,7 +84,7 @@ $(document).ready(function() { $(data).find('div[id*="thread_"]').each(function() { var checkout = $(this).attr('id').replace('thread_', ''); if ($('div#thread_' + checkout + '[data-board="' + overflow[0].board + '"]').length == 0) { - $('form[name="postcontrols"]').prepend($(this).css('display', 'block').attr("data-cached", "yes").attr('data-board', overflow[0].board)); + $('form[name="postcontrols"]').prepend($(this).css('display', 'none').attr("data-cached", "yes").attr('data-board', overflow[0].board)); } }); diff --git a/templates/themes/ukko2/theme.php b/templates/themes/ukko2/theme.php index 42074d69..76a78caf 100644 --- a/templates/themes/ukko2/theme.php +++ b/templates/themes/ukko2/theme.php @@ -53,7 +53,7 @@ array_push($boardsforukko2,$_board); } } - $query = preg_replace('/UNION ALL $/', 'ORDER BY `bump` DESC', $query); + $query = preg_replace('/UNION ALL $/', 'ORDER BY `sticky` DESC ,`bump` DESC', $query); $query = query($query) or error(db_error()); $count = 0; @@ -73,7 +73,7 @@ openBoard($post['board']); $thread = new Thread($post, $mod ? '?/' : $config['root'], $mod); - $posts = prepare(sprintf("SELECT * FROM ``posts_%s`` WHERE `thread` = :id ORDER BY `id` DESC LIMIT :limit", $post['board'])); + $posts = prepare(sprintf("SELECT * FROM ``posts_%s`` WHERE `thread` = :id ORDER BY `sticky` DESC, `id` DESC LIMIT :limit", $post['board'])); $posts->bindValue(':id', $post['id']); $posts->bindValue(':limit', ($post['sticky'] ? $config['threads_preview_sticky'] : $config['threads_preview']), PDO::PARAM_INT); $posts->execute() or error(db_error($posts)); diff --git a/templates/themes/ukko2/ukko.js b/templates/themes/ukko2/ukko.js index deeccfd0..b2668e0b 100644 --- a/templates/themes/ukko2/ukko.js +++ b/templates/themes/ukko2/ukko.js @@ -84,7 +84,7 @@ $(document).ready(function() { $(data).find('div[id*="thread_"]').each(function() { var checkout = $(this).attr('id').replace('thread_', ''); if ($('div#thread_' + checkout + '[data-board="' + overflow[0].board + '"]').length == 0) { - $('form[name="postcontrols"]').prepend($(this).css('display', 'block').attr("data-cached", "yes").attr('data-board', overflow[0].board)); + $('form[name="postcontrols"]').prepend($(this).css('display', 'none').attr("data-cached", "yes").attr('data-board', overflow[0].board)); } }); diff --git a/templates/themes/ukko3/theme.php b/templates/themes/ukko3/theme.php index 650dfc37..937a1ef3 100644 --- a/templates/themes/ukko3/theme.php +++ b/templates/themes/ukko3/theme.php @@ -53,7 +53,7 @@ array_push($boardsforukko3,$_board); } } - $query = preg_replace('/UNION ALL $/', 'ORDER BY `bump` DESC', $query); + $query = preg_replace('/UNION ALL $/', 'ORDER BY `sticky` DESC ,`bump` DESC', $query); $query = query($query) or error(db_error()); $count = 0; @@ -73,7 +73,7 @@ openBoard($post['board']); $thread = new Thread($post, $mod ? '?/' : $config['root'], $mod); - $posts = prepare(sprintf("SELECT * FROM ``posts_%s`` WHERE `thread` = :id ORDER BY `id` DESC LIMIT :limit", $post['board'])); + $posts = prepare(sprintf("SELECT * FROM ``posts_%s`` WHERE `thread` = :id ORDER BY `sticky` DESC, `id` DESC LIMIT :limit", $post['board'])); $posts->bindValue(':id', $post['id']); $posts->bindValue(':limit', ($post['sticky'] ? $config['threads_preview_sticky'] : $config['threads_preview']), PDO::PARAM_INT); $posts->execute() or error(db_error($posts)); diff --git a/templates/themes/ukko3/ukko.js b/templates/themes/ukko3/ukko.js index deeccfd0..b2668e0b 100644 --- a/templates/themes/ukko3/ukko.js +++ b/templates/themes/ukko3/ukko.js @@ -84,7 +84,7 @@ $(document).ready(function() { $(data).find('div[id*="thread_"]').each(function() { var checkout = $(this).attr('id').replace('thread_', ''); if ($('div#thread_' + checkout + '[data-board="' + overflow[0].board + '"]').length == 0) { - $('form[name="postcontrols"]').prepend($(this).css('display', 'block').attr("data-cached", "yes").attr('data-board', overflow[0].board)); + $('form[name="postcontrols"]').prepend($(this).css('display', 'none').attr("data-cached", "yes").attr('data-board', overflow[0].board)); } }); |
