Browse Source

;_;

pull/40/head
ctrlcctrlv 11 years ago
committed by Michael Foster
parent
commit
ed142a5e5d
  1. 3
      inc/api.php
  2. 4
      inc/functions.php

3
inc/api.php

@ -8,7 +8,8 @@
* Class for generating json API compatible with 4chan API
*/
class Api {
function __construct($config){
function __construct(){
global $config;
/**
* Translation from local fields to fields in 4chan-style API
*/

4
inc/functions.php

@ -1296,7 +1296,7 @@ function buildIndex() {
$antibot = create_antibot($board['uri']);
if ($config['api']['enabled']) {
$api = new Api($config);
$api = new Api();
$catalog = array();
}
@ -1771,7 +1771,7 @@ function buildThread($id, $return = false, $mod = false) {
// json api
if ($config['api']['enabled']) {
$api = new Api($config);
$api = new Api();
$json = json_encode($api->translateThread($thread));
$jsonFilename = $board['dir'] . $config['dir']['res'] . $id . ".json";
file_write($jsonFilename, $json);

Loading…
Cancel
Save