<?php
// prevenir invocacion directa del script
defined('PRONTUS') OR exit('');

# CONFIGURACION DESDE PRONTUS NEXT
$config_path = "$document_root/$prontus_id/cpan/$prontus_id-redes.cfg";

if (file_exists($config_path)){
    $config_vars = file_get_contents($config_path);
    if (preg_match("/FB_APP_ID\s*=\s*['](.+?)[']/",$config_vars,$match)){
        define('APP_ID',$match[1]);
    }
    if (preg_match("/FB_APP_SECRET\s*=\s*['](.+?)[']/",$config_vars,$match)){
        define('APP_SECRET',$match[1]);
    }
    if (preg_match("/FB_ACCESS_TOKEN\s*=\s*['](.+?)[']/",$config_vars,$match)){
        define('ACCESS_TOKEN',$match[1]);
    }
    if (preg_match("/FB_PICTURE_WALL\s*=\s*['](.+?)[']/",$config_vars,$match)){
        define('PICTURE_WALL',$match[1]);
    }
    if (preg_match("/FB_PAGE_ID\s*=\s*['](.+?)[']/",$config_vars,$match)){
        define('PAGE_ID',$match[1]);
    }

} else {
    echo "Error en la lectura de variables";
    exit;
}
