Viewing file: request.php (1.8 KB) -rw-rw-r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/**
*
* @author Robert Johnston
*
* @package Forum Runner
* @version CVS/SVN: $Id: $
* @copyright (c) 2010 End of Time Studios, LLC
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
define('MCWD', (($getcwd = getcwd()) ? $getcwd : '.'));
define('IN_PHPBB', true);
define('IN_FORUM_RUNNER', true);
define('PHPBB_MSG_HANDLER', 'fr_msg_handler');
if (isset($_REQUEST['d'])) {
error_reporting(E_ALL);
} else {
header('Content-type: application/json');
error_reporting(0);
}
require_once(MCWD . '/version.php');
require_once(MCWD . '/support/utils.php');
require_once(MCWD . '/support/JSON.php');
require_once(MCWD . '/include/general_phpbb.php');
$processed = process_input(array('cmd' => STRING, 'frv' => STRING, 'frp' => STRING));
if (!$processed['cmd']) {
return;
}
$frcl_version = '1.3.3';
$frcl_platform = 'ip';
if (isset($processed['frv'])) {
$frcl_version = $processed['frv'];
}
if (isset($processed['frp'])) {
$frcl_platform = $processed['frp'];
}
require_once(MCWD . '/support/common_methods.php');
if (!isset($methods[$processed['cmd']])) {
json_error(ERR_NO_PERMISSION);
}
if ($methods[$processed['cmd']]['include']) {
require_once(MCWD . '/include/' . $methods[$processed['cmd']]['include']);
}
if (isset($_REQUEST['d'])) {
error_reporting(E_ALL);
}
$out = call_user_func($methods[$processed['cmd']]['function']);
$json_out = array(
'success' => true,
'data' => $out,
'ads' => fr_show_ad(),
);
// Return Unread PM/Subscribed Threads count
if ($user->data['user_id'] != ANONYMOUS) {
$json_out['pm_notices'] = fr_get_pm_unread();
$json_out['sub_notices'] = fr_get_sub_thread_updates();
}
$json = new Services_JSON();
print $json->encode($json_out);
?>
|