fixes path for catalog. fixes syntax bugs.
This commit is contained in:
parent
4ee8f9349a
commit
5b57d35a4c
|
@ -25,7 +25,7 @@ $config['boards'] = array(
|
||||||
);
|
);
|
||||||
|
|
||||||
$config['prepended_foreign_boards'] = array(
|
$config['prepended_foreign_boards'] = array(
|
||||||
'overboard' => 'overboard/index.html',
|
'overboard' => '/overboard',
|
||||||
);
|
);
|
||||||
|
|
||||||
$config['foreign_boards'] = array(
|
$config['foreign_boards'] = array(
|
||||||
|
|
|
@ -349,7 +349,7 @@
|
||||||
/**
|
/**
|
||||||
* Build and save the HTML of the catalog for the overboard
|
* Build and save the HTML of the catalog for the overboard
|
||||||
*/
|
*/
|
||||||
public function buildOverboardCatalog($settings, $board_names) {
|
public function buildOverboardCatalog($settings, $boards) {
|
||||||
$board_name = $settings['overboard_location'];
|
$board_name = $settings['overboard_location'];
|
||||||
|
|
||||||
if (array_key_exists($board_name, $this->threadsCache)) {
|
if (array_key_exists($board_name, $this->threadsCache)) {
|
||||||
|
@ -360,16 +360,16 @@
|
||||||
$sql .= $this->buildThreadsQuery($board);
|
$sql .= $this->buildThreadsQuery($board);
|
||||||
$sql .= " UNION ALL ";
|
$sql .= " UNION ALL ";
|
||||||
}
|
}
|
||||||
$query = preg_replace('/UNION ALL $/', 'ORDER BY `bump` DESC', $query);
|
$sql = preg_replace('/UNION ALL $/', 'ORDER BY `bump` DESC', $sql);
|
||||||
$result = query($query) or error(db_error());
|
$result = query($sql) or error(db_error());
|
||||||
$threads = $query->fetchAll(PDO::FETCH_ASSOC);
|
$threads = $result->fetchAll(PDO::FETCH_ASSOC);
|
||||||
// Save for posterity
|
// Save for posterity
|
||||||
$this->threadsCache[$board_name] = $threads;
|
$this->threadsCache[$board_name] = $threads;
|
||||||
}
|
}
|
||||||
// Generate data for the template
|
// Generate data for the template
|
||||||
$recent_posts = $this->generateRecentPosts($threads);
|
$recent_posts = $this->generateRecentPosts($threads);
|
||||||
|
|
||||||
$this->saveForBoard($board_name, $recent_posts);
|
$this->saveForBoard($board_name, $recent_posts, '/' . $settings['overboard_location']);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function generateRecentPosts($threads) {
|
private function generateRecentPosts($threads) {
|
||||||
|
|
Loading…
Reference in New Issue