modules: how to run a separate PHP file?

Game development with Board Game Arena Studio
Post Reply
User avatar
Idsky
Posts: 132
Joined: 16 April 2020, 16:49

modules: how to run a separate PHP file?

Post by Idsky »

I made a modules/maps/index.php file thinking I could load that in the browser directly with

Code: Select all

window.open(g_gamethemeurl+"modules/maps/");
But that gives a 403 permission error. I understand that will be for security (though my page takes no input).

This maps reference page is big, I want to open it in a new tab, not in an overlay on the game page. Suggestions?
User avatar
Lunalol
Posts: 584
Joined: 09 October 2016, 23:21

Re: modules: how to run a separate PHP file?

Post by Lunalol »

Hi

PHP files are on SERVER side
Your browser is on CLIENT side
you can only import JS, CSS on CLIENT side
you can only import a PHP file from PHP itself on SERVER side.

Hope it helps.
User avatar
Tisaac
Posts: 2743
Joined: 26 August 2014, 21:28

Re: modules: how to run a separate PHP file?

Post by Tisaac »

Idsky wrote: 18 July 2020, 13:38 I made a modules/maps/index.php file thinking I could load that in the browser directly with

Code: Select all

window.open(g_gamethemeurl+"modules/maps/");
But that gives a 403 permission error. I understand that will be for security (though my page takes no input).

This maps reference page is big, I want to open it in a new tab, not in an overlay on the game page. Suggestions?
For security reasons, I dont think you could do something like this. I would believe only the standard action urls are authorized.
Lets wait to see if an admin has a solution, but I wouldnt be surprised if this is not possible.
User avatar
Idsky
Posts: 132
Joined: 16 April 2020, 16:49

Re: modules: how to run a separate PHP file?

Post by Idsky »

Static html pages within modules can be loaded so I'll pre-render / compile this page offline and add it as html.
Looks like the modules folder is not added to the repository on Quantum though, I guess an admin will need to add that for me.
User avatar
Idsky
Posts: 132
Joined: 16 April 2020, 16:49

Re: modules: how to run a separate PHP file?

Post by Idsky »

What I did was put a static html file into the img folder, along with a spritesheet for it's images, which was set as this.dontPreloadImage in the javascript constructor function.

I have a PHP script in misc for 'compiling' this static page which I run offline and commit the result.
Post Reply

Return to “Developers”