Closed jhasselbring closed 2 years ago
I'll look into this if anyone can provide real-world usage examples. All i can really think of is user registration, but since a user wanting to register would have access to the internet and the fluxcp site where they want to register there's really no need to expand past the registration page.
Thoughts?
To be clear, I've already build my own custom integration that resides outside of rAthena flux. I purposely did not edit the core flux in case of future updates.
In order to integrate dynamic information such as per server status, online player counts, market data or any data that is stored in the database, theme developers need to build a custom database connections either loading the config or hard coding database credentials.
The most common use case is getting server status and online player count followed by WoE status, market and top players.
The solution I am proposing is as simple as capturing a new $_GET['return'] parameter ie:
www.domain.com/flux/?module=server&action=status&return=json
if(isset($_GET['return']) && $_GET['return'] == 'json'){
// disable header.php and footer.php
header('Content-Type: application/json');
}
With this implemented, using return=json on pages that are not designed to return a json object will print/echo the body source code but that, in theory, will not be a security concern(unless the theme developer is stupid)
how this one go? @jhasselbring
It didn't go anywhere.
It feels like an open source that's not very open.
It's a paint to build using react/vue because of this lack of cunctionality.
This would be better served as an API built into rAthena itself for serving it's data, instead of adding tools inside of other tools.
Some of us use REST APIs heavily. Sometime for AJAX requests and sometimes for external apps.
Is there anyway to have this feature built in instead of being forced to do logic in the theme/themeName/header.php.
I was thinking, if the path starts with /API/ before the query, it will cue the Flux to use a different header.php that will handle the proper header();