diff options
| author | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-30 15:00:33 +1000 |
|---|---|---|
| committer | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-30 15:00:33 +1000 |
| commit | 46d41cd2a7bce8e81b0deec2022a1393e155fe32 (patch) | |
| tree | edbd372a6fac42767db65f1871d8e2861a45c885 /inc/mod/pages.php | |
| parent | 2d3846384ad2fd92ea06fb7effe09a59be41ac31 (diff) | |
More track_cites work
Diffstat (limited to 'inc/mod/pages.php')
| -rw-r--r-- | inc/mod/pages.php | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 043b9a5c..afd8daf3 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -1001,7 +1001,7 @@ function mod_bumplock($board, $unbumplock, $post) { } function mod_move($originBoard, $postID) { - global $board, $config, $mod; + global $board, $config, $mod, $pdo; if (!openBoard($originBoard)) error($config['error']['noboard']); @@ -1118,13 +1118,14 @@ function mod_move($originBoard, $postID) { $clone($post['file_thumb'], sprintf($config['board_path'], $board['uri']) . $config['dir']['thumb'] . $post['thumb']); } - 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', $newPostID, PDO::PARAM_INT); - $query->bindValue(':target_board',$cite[0]); - $query->bindValue(':target', $cite[1], PDO::PARAM_INT); - $query->execute() or error(db_error($query)); + if (!empty($post['tracked_cites'])) { + $insert_rows = array(); + foreach ($post['tracked_cites'] as $cite) { + $insert_rows[] = '(' . + $pdo->quote($board['uri']) . ', ' . $newPostID . ', ' . + $pdo->quote($cite[0]) . ', ' . (int)$cite[1] . ')'; + } + query('INSERT INTO ``cites`` VALUES ' . implode(', ', $insert_rows)) or error(db_error());; } } |
