forked from leftypol/leftypol
track cites (remove broken links after a post 404s)
This commit is contained in:
parent
486842e9a1
commit
b57be65c9f
6 changed files with 98 additions and 8 deletions
11
post.php
11
post.php
|
@ -334,7 +334,7 @@
|
|||
$post['body_nomarkup'] = $post['body'];
|
||||
|
||||
if(!($mod && isset($post['raw']) && $post['raw']))
|
||||
markup($post['body']);
|
||||
$post['tracked_cites'] = markup($post['body'], true);
|
||||
|
||||
// Check for a flood
|
||||
if(!($mod && $mod['type'] >= $config['mod']['flood']) && checkFlood($post)) {
|
||||
|
@ -557,6 +557,15 @@
|
|||
|
||||
$id = post($post, $OP);
|
||||
|
||||
foreach($post['tracked_cites'] as $cite) {
|
||||
$query = prepare('INSERT INTO `cites` VALUES (:board, :post, :target_board, :target)');
|
||||
$query->bindValue(':board', $board['uri']);
|
||||
$query->bindValue(':post', $id, PDO::PARAM_INT);
|
||||
$query->bindValue(':target_board',$cite[0]);
|
||||
$query->bindValue(':target', $cite[1], PDO::PARAM_INT);
|
||||
$query->execute() or error(db_error($query));
|
||||
}
|
||||
|
||||
buildThread(($OP?$id:$post['thread']));
|
||||
|
||||
if(!$OP && strtolower($post['email']) != 'sage' && !$thread['sage'] && ($config['reply_limit'] == 0 || numPosts($post['thread']) < $config['reply_limit'])) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue