Browse Source

fixes path for catalog. fixes syntax bugs.

pull/40/head
nonmakina 3 years ago
parent
commit
5b57d35a4c
  1. 2
      inc/instance-config.php
  2. 10
      templates/themes/catalog/theme.php

2
inc/instance-config.php

@ -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(

10
templates/themes/catalog/theme.php

@ -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…
Cancel
Save