mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-24 07:30:10 +01:00
;_;
This commit is contained in:
parent
31aad827ad
commit
c617603179
@ -8,7 +8,8 @@
|
|||||||
* Class for generating json API compatible with 4chan API
|
* Class for generating json API compatible with 4chan API
|
||||||
*/
|
*/
|
||||||
class Api {
|
class Api {
|
||||||
function __construct($config){
|
function __construct(){
|
||||||
|
global $config;
|
||||||
/**
|
/**
|
||||||
* Translation from local fields to fields in 4chan-style API
|
* Translation from local fields to fields in 4chan-style API
|
||||||
*/
|
*/
|
||||||
|
@ -1301,7 +1301,7 @@ function buildIndex() {
|
|||||||
$antibot = create_antibot($board['uri']);
|
$antibot = create_antibot($board['uri']);
|
||||||
|
|
||||||
if ($config['api']['enabled']) {
|
if ($config['api']['enabled']) {
|
||||||
$api = new Api($config);
|
$api = new Api();
|
||||||
$catalog = array();
|
$catalog = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1775,7 +1775,7 @@ function buildThread($id, $return = false, $mod = false) {
|
|||||||
|
|
||||||
// json api
|
// json api
|
||||||
if ($config['api']['enabled']) {
|
if ($config['api']['enabled']) {
|
||||||
$api = new Api($config);
|
$api = new Api();
|
||||||
$json = json_encode($api->translateThread($thread));
|
$json = json_encode($api->translateThread($thread));
|
||||||
$jsonFilename = $board['dir'] . $config['dir']['res'] . $id . ".json";
|
$jsonFilename = $board['dir'] . $config['dir']['res'] . $id . ".json";
|
||||||
file_write($jsonFilename, $json);
|
file_write($jsonFilename, $json);
|
||||||
|
Loading…
Reference in New Issue
Block a user