forked from GithubBackups/vichan
Merge branch 'master' of https://github.com/ctrlcctrlv/8chan
This commit is contained in:
commit
1d0409e84b
2
404.php
2
404.php
@ -35,7 +35,7 @@ $page = <<<EOT
|
|||||||
var faves = JSON.parse(localStorage.favorites);
|
var faves = JSON.parse(localStorage.favorites);
|
||||||
|
|
||||||
$.each(faves, function(k, v) {
|
$.each(faves, function(k, v) {
|
||||||
if (window.location.pathname === '/' + v + '/') {
|
if ((window.location.pathname === '/' + v + '/') || (window.location.pathname === '/' + v)) {
|
||||||
faves.pop(v);
|
faves.pop(v);
|
||||||
localStorage.favorites = JSON.stringify(faves);
|
localStorage.favorites = JSON.stringify(faves);
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ header("Expires: 0");
|
|||||||
|
|
||||||
function get_custom_banner(&$b) {
|
function get_custom_banner(&$b) {
|
||||||
# Validate the board name
|
# Validate the board name
|
||||||
if (!(isset($b) && preg_match('/^[a-z0-9]{1,10}$/', $b)))
|
if (!(isset($b) && preg_match('/^[a-z0-9]{1,30}$/', $b)))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
# Check if directory exists
|
# Check if directory exists
|
||||||
|
2
faq.php
2
faq.php
@ -79,7 +79,7 @@ $body = <<<EOT
|
|||||||
<p>There isn't one yet and there will never be an official archive.</p>
|
<p>There isn't one yet and there will never be an official archive.</p>
|
||||||
|
|
||||||
<h2>How do I donate?</h2>
|
<h2>How do I donate?</h2>
|
||||||
<p>Donations can be sent to 1NpQaXqmCBji6gfX8UgaQEmEstvVY7U32C (Bitcoin) or LUPgSCJt3iGeJXUETVhmnbQ89Riaq1yjZm (Litecoin). PayPal is also accepted @ fredrick.brennan1@gmail.com .</p>
|
<p>Donations can be sent to 1NpQaXqmCBji6gfX8UgaQEmEstvVY7U32C (Bitcoin) or LUPgSCJt3iGeJXUETVhmnbQ89Riaq1yjZm (Litecoin).</p>
|
||||||
<p>You may also donate monthly via Patreon at <a href="http://www.patreon.com/user?u=162165">http://www.patreon.com/user?u=162165</a>.
|
<p>You may also donate monthly via Patreon at <a href="http://www.patreon.com/user?u=162165">http://www.patreon.com/user?u=162165</a>.
|
||||||
|
|
||||||
<h2>Are you really a cripple?</h2>
|
<h2>Are you really a cripple?</h2>
|
||||||
|
@ -1091,9 +1091,9 @@ function deletePost($id, $error_if_doesnt_exist=true, $rebuild_after=true) {
|
|||||||
|
|
||||||
if (!$post['thread']) {
|
if (!$post['thread']) {
|
||||||
// Delete thread HTML page
|
// Delete thread HTML page
|
||||||
file_unlink($board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], $post['id']));
|
@file_unlink($board['dir'] . $config['dir']['res'] . sprintf($config['file_page'], $post['id']));
|
||||||
file_unlink($board['dir'] . $config['dir']['res'] . sprintf($config['file_page50'], $post['id']));
|
@file_unlink($board['dir'] . $config['dir']['res'] . sprintf($config['file_page50'], $post['id']));
|
||||||
file_unlink($board['dir'] . $config['dir']['res'] . sprintf('%d.json', $post['id']));
|
@file_unlink($board['dir'] . $config['dir']['res'] . sprintf('%d.json', $post['id']));
|
||||||
|
|
||||||
$antispam_query = prepare('DELETE FROM ``antispam`` WHERE `board` = :board AND `thread` = :thread');
|
$antispam_query = prepare('DELETE FROM ``antispam`` WHERE `board` = :board AND `thread` = :thread');
|
||||||
$antispam_query->bindValue(':board', $board['uri']);
|
$antispam_query->bindValue(':board', $board['uri']);
|
||||||
@ -1106,9 +1106,9 @@ function deletePost($id, $error_if_doesnt_exist=true, $rebuild_after=true) {
|
|||||||
if ($post['files']) {
|
if ($post['files']) {
|
||||||
// Delete file
|
// Delete file
|
||||||
foreach (json_decode($post['files']) as $i => $f) {
|
foreach (json_decode($post['files']) as $i => $f) {
|
||||||
if ($f->file !== 'deleted') {
|
if (isset($f->file, $f->thumb) && $f->file !== 'deleted') {
|
||||||
file_unlink($config['dir']['img_root'] . $board['dir'] . $config['dir']['img'] . $f->file);
|
@file_unlink($config['dir']['img_root'] . $board['dir'] . $config['dir']['img'] . $f->file);
|
||||||
file_unlink($config['dir']['img_root'] . $board['dir'] . $config['dir']['thumb'] . $f->thumb);
|
@file_unlink($config['dir']['img_root'] . $board['dir'] . $config['dir']['thumb'] . $f->thumb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -135,6 +135,7 @@
|
|||||||
$config['additional_javascript'][] = 'js/youtube.js';
|
$config['additional_javascript'][] = 'js/youtube.js';
|
||||||
$config['additional_javascript'][] = 'js/comment-toolbar.js';
|
$config['additional_javascript'][] = 'js/comment-toolbar.js';
|
||||||
$config['additional_javascript'][] = 'js/catalog-search.js';
|
$config['additional_javascript'][] = 'js/catalog-search.js';
|
||||||
|
$config['additional_javascript'][] = 'js/thread-stats.js';
|
||||||
|
|
||||||
//$config['font_awesome_css'] = '/netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css';
|
//$config['font_awesome_css'] = '/netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css';
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
* $config['additional_javascript'][] = 'js/thread-stats.js';
|
* $config['additional_javascript'][] = 'js/thread-stats.js';
|
||||||
*/
|
*/
|
||||||
if (active_page == 'thread') {
|
if (active_page == 'thread') {
|
||||||
|
$(document).ready(function(){
|
||||||
//check if page uses unique ID
|
//check if page uses unique ID
|
||||||
var IDsupport = ($('.poster_id').length > 0);
|
var IDsupport = ($('.poster_id').length > 0);
|
||||||
var thread_id = (document.location.pathname + document.location.search).split('/');
|
var thread_id = (document.location.pathname + document.location.search).split('/');
|
||||||
@ -100,10 +101,9 @@ if (active_page == 'thread') {
|
|||||||
if (!found) $('#thread_stats_page').css('color','red');
|
if (!found) $('#thread_stats_page').css('color','red');
|
||||||
});
|
});
|
||||||
},30000);
|
},30000);
|
||||||
$(document).ready(function(){
|
|
||||||
$('body').append('<style>.posts_by_id{display:none;}.poster_id:hover+.posts_by_id{display:initial}</style>');
|
$('body').append('<style>.posts_by_id{display:none;}.poster_id:hover+.posts_by_id{display:initial}</style>');
|
||||||
update_thread_stats();
|
update_thread_stats();
|
||||||
$('#update_thread').click(update_thread_stats);
|
$('#update_thread').click(update_thread_stats);
|
||||||
$(document).on('new_post',update_thread_stats);
|
$(document).on('new_post',update_thread_stats);
|
||||||
});
|
});
|
||||||
}
|
}
|
7
post.php
7
post.php
@ -232,14 +232,15 @@ elseif (isset($_POST['post'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(($post['op'] && $_POST['post'] == $config['button_newtopic']) ||
|
//if (!(($post['op'] && $_POST['post'] == $config['button_newtopic']) ||
|
||||||
(!$post['op'] && $_POST['post'] == $config['button_reply'])))
|
//(!$post['op'] && $_POST['post'] == $config['button_reply'])))
|
||||||
//error($config['error']['bot']);
|
//error($config['error']['bot']);
|
||||||
|
|
||||||
// Check the referrer
|
// Check the referrer
|
||||||
if ($config['referer_match'] !== false &&
|
if ($config['referer_match'] !== false &&
|
||||||
(!isset($_SERVER['HTTP_REFERER']) || !preg_match($config['referer_match'], rawurldecode($_SERVER['HTTP_REFERER']))))
|
(!isset($_SERVER['HTTP_REFERER']) || !preg_match($config['referer_match'], rawurldecode($_SERVER['HTTP_REFERER'])))) {
|
||||||
error($config['error']['referer']);
|
error($config['error']['referer']);
|
||||||
|
}
|
||||||
|
|
||||||
checkDNSBL();
|
checkDNSBL();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user