forked from leftypol/leftypol
Add board data on all catalogs, rename overboard 'replies' and 'images' fields to keep consistency
This commit is contained in:
parent
dc63ff61ee
commit
3a5081e73d
3 changed files with 8 additions and 8 deletions
|
@ -1322,7 +1322,7 @@ function index($page, $mod=false, $brief = false) {
|
|||
$body = '';
|
||||
$offset = round($page*$config['threads_per_page']-$config['threads_per_page']);
|
||||
|
||||
$query = prepare(sprintf("SELECT * FROM ``posts_%s`` WHERE `thread` IS NULL ORDER BY `sticky` DESC, `bump` DESC LIMIT :offset,:threads_per_page", $board['uri']));
|
||||
$query = prepare(sprintf("SELECT *,'%s' as board FROM ``posts_%s`` WHERE `thread` IS NULL ORDER BY `sticky` DESC, `bump` DESC LIMIT :offset,:threads_per_page", $board['uri'], $board['uri']));
|
||||
$query->bindValue(':offset', $offset, PDO::PARAM_INT);
|
||||
$query->bindValue(':threads_per_page', $config['threads_per_page'], PDO::PARAM_INT);
|
||||
$query->execute() or error(db_error($query));
|
||||
|
@ -2292,7 +2292,7 @@ function buildThread($id, $return = false, $mod = false) {
|
|||
$action = generation_strategy('sb_thread', array($board['uri'], $id));
|
||||
|
||||
if ($action == 'rebuild' || $return || $mod) {
|
||||
$query = prepare(sprintf("SELECT * FROM ``posts_%s`` WHERE (`thread` IS NULL AND `id` = :id) OR `thread` = :id ORDER BY `thread`,`id`", $board['uri']));
|
||||
$query = prepare(sprintf("SELECT *,'%s' as board FROM ``posts_%s`` WHERE (`thread` IS NULL AND `id` = :id) OR `thread` = :id ORDER BY `thread`,`id`", $board['uri'],$board['uri']));
|
||||
$query->bindValue(':id', $id, PDO::PARAM_INT);
|
||||
$query->execute() or error(db_error($query));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue