diff --git a/inc/functions.php b/inc/functions.php index e127a87d..3d7ae1b7 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -657,8 +657,8 @@ function listBoards($just_uri = false) { $just_uri ? $cache_name = 'all_boards_uri' : $cache_name = 'all_boards'; - if ($config['cache']['enabled'] && ($boards = cache::get($cache_name))) - return $boards; + //if ($config['cache']['enabled'] && ($boards = cache::get($cache_name))) + //return $boards; if (!$just_uri) { $query = query("SELECT ``boards``.`uri` uri, ``boards``.`title` title, ``boards``.`subtitle` subtitle, ``board_create``.`time` time FROM ``boards`` LEFT JOIN ``board_create`` ON ``boards``.`uri` = ``board_create``.`uri` ORDER BY ``boards``.`uri`") or error(db_error()); @@ -666,7 +666,9 @@ function listBoards($just_uri = false) { } else { $boards = array(); $query = query("SELECT `uri` FROM ``boards``") or error(db_error()); - while ($board = $query->fetchColumn()) { + while (true) { + $board = $query->fetchColumn(); + if ($board === FALSE) break; $boards[] = $board; } } diff --git a/inc/instance-config.php b/inc/instance-config.php index 5d7f7823..1e5081b5 100644 --- a/inc/instance-config.php +++ b/inc/instance-config.php @@ -81,6 +81,7 @@ $config['mod']['recent_reports'] = 65535; // Board shit + $config['ayah_enabled'] = true; $config['url_banner'] = '/banners.php'; //$config['default_stylesheet'] = array('Notsuba', 'notsuba.css'); $config['additional_javascript'][] = 'js/jquery.min.js'; @@ -92,6 +93,7 @@ $config['additional_javascript'][] = 'js/favorites.js'; $config['additional_javascript'][] = 'js/show-op.js'; $config['additional_javascript'][] = 'js/hide-threads.js'; + $config['additional_javascript'][] = 'js/mobile-style.js' $config['additional_javascript'][] = 'js/smartphone-spoiler.js'; $config['additional_javascript'][] = 'js/inline-expanding.js'; $config['additional_javascript'][] = 'js/show-backlinks.js'; @@ -117,6 +119,7 @@ $config['additional_javascript'][] = 'js/toggle-locked-threads.js'; $config['additional_javascript'][] = 'js/toggle-images.js'; $config['additional_javascript'][] = 'js/mobile-style.js'; + $config['additional_javascript'][] = 'js/threadscroll.js'; $config['font_awesome_css'] = '//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css'; @@ -128,7 +131,7 @@ $config['markup'][] = array("/\[spoiler\](.+?)\[\/spoiler\]/", "\$1"); $config['markup'][] = array("/~~(.+?)~~/", "\$1"); - $config['boards'] = array(array('' => '/', '' => '/boards.html', '' => '/faq.html', '' => '/random.php', '' => '/create.php', '' => '/search.php', '' => '/mod.php', '' => 'https://qchat.rizon.net/?channels=#8chan'), array('b', 'meta', 'int'), array('v', 'a', 'tg', 'fit', 'pol', 'tech', 'mu', 'co', 'sp', 'boards'), array(''=>'https://twitter.com/infinitechan')); + $config['boards'] = array(array('' => '/', '' => '/boards.html', '' => '/faq.html', '' => '/random.php', '' => '/create.php', '' => '/search.php', '' => '/mod.php', '' => 'https://qchat.rizon.net/?channels=#8chan'), array('b', 'meta', 'int'), array('v', 'a', 'tg', 'fit', 'pol', 'tech', 'mu', 'co', 'sp', 'boards'), array(''=>'https://twitter.com/infinitechan')); $config['footer'][] = 'Contribute to 8chan.co development at github'; $config['footer'][] = 'To make a DMCA request or report illegal content, please email admin@8chan.co or use the "Global Report" functionality on every page.'; diff --git a/js/image-hover.js b/js/image-hover.js new file mode 100644 index 00000000..c752a2cf --- /dev/null +++ b/js/image-hover.js @@ -0,0 +1,98 @@ +/* + Copyright (C) 2014 undido + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + expands images and webm on hover +*/ + +$(document).ready(function(){ + var mouseisOnImage = false; + var mouseexitedImage = false; + var imageHover = (localStorage['imagehover']) ? true:false; + + imageHover = !imageHover; + + var imageEnter = function(){ + if (!imageHover) + return; + + mouseexitedImage = false; + mouseisOnImage = false; + + isVideo = (($(this).prop("tagName") == "VIDEO") ? true:($(this).parent().attr("href").indexOf("player.php?v=") > -1) ? true:false); + maxWidth = document.body.offsetWidth-(document.body.offsetWidth * 0.25); + maxHeight = document.documentElement.clientHeight; + stylez = "z-index:1000;z-index: 1000;position: fixed;top: 0;right: 0;"; + if (!isVideo){ + fileInfo = $(this).parent().parent().children(".fileinfo").children(".unimportant").text(); + isSpoiler = (fileInfo.indexOf("Spoiler") > -1) ? true:false; + imageD = ((isSpoiler) ? fileInfo.split(",")[2]:fileInfo.split(",")[1]); + imageWidth = parseInt(imageD.split("x")[0]); + imageHeight = parseInt(imageD.split("x")[1]); + + widStyle = "max-width:" + maxWidth + "px;"; + heiStyle = ((maxHeight < imageHeight) ? "height:"+maxHeight+"px;":""); + $imgH = $("", {"src":$(this).parent().attr("href"), "style":stylez + ((imageWidth > maxWidth) ? widStyle:"")+heiStyle, "id":"hover-image"}); + } else { + fileInfo = $(this).parent().parent().children(".fileinfo").children(".unimportant").text(); + isSpoiler = (fileInfo.indexOf("Spoiler") > -1) ? true:false; + imageD = ((isSpoiler) ? fileInfo.split(",")[2]:fileInfo.split(",")[1]); + videoWidth = parseInt(imageD.split("x")[0]); + videoHeight = parseInt(imageD.split("x")[1]); + + widStyle = "width:" + ((maxWidth > videoWidth) ? videoWidth:maxWidth) + "px;" + "height:" + ((maxHeight < videoHeight) ? "100%": videoHeight+"px;"); + $imgH = $("