RedKingOne Posted April 24, 2020 Report Share Posted April 24, 2020 Greetings all! I've had a long hard look around the forums in reference to getting information pulled from phpvms and displayed on a static html front page. The most common suggestion I see are to add the following on to the static HTML page. Option 1 Quote <?php include('Destination Path/core/codon.config.php'); include('Destination Path/core/local.config.php'); ?> <?php Template::Show('acarsmap.php'); ?></p> Option 2 Quote <?php include('/home/YOURUSERNAME/public_html/core/codon.config.php'); include('/home/YOURUSERNAME/public_html/core/local.config.php'); ?> <?php MainController::Run('ACARS', 'index'); ?> or some other variation of the above. I think I've attempted at least 12 different variations to try and get those codes to work with no luck. If anyone can provide me some assistance or guidance on this, it would much appreciated. Quote Link to comment Share on other sites More sharing options...
Administrators ProAvia Posted April 24, 2020 Administrators Report Share Posted April 24, 2020 Does this static front page reside on the same domain/sub-domain as your phpvms installation? Is this static front page intended to be the same as the phpvms index.php page but in a directory other than the phpvms files? Quote Link to comment Share on other sites More sharing options...
RedKingOne Posted April 24, 2020 Author Report Share Posted April 24, 2020 7 minutes ago, ProAvia said: Does this static front page reside on the same domain/sub-domain as your phpvms installation? Is this static front page intended to be the same as the phpvms index.php page but in a directory other than the phpvms files? @ProAvia thanks for the response. The HTML resides in its own subdomain and the PHPVMS is inside of that. http://urlhere.org/welcome - This is were the HTML resides. http://urlhere.org/welcome/portal - This is were the PHPVMS resides. Since I am using a crewcenter build, it cant sit on a domain. It has the login page prior to entering the crew area and its designed to be in a subdomain. But I would like to show the live map and some basic stats like pilot count, fuel burned and so on to guests who don't have a login hens the reason for the static html front page. Quote Link to comment Share on other sites More sharing options...
Administrators ProAvia Posted April 24, 2020 Administrators Report Share Posted April 24, 2020 This will work for the default index.php file that comes with phpVMS - this file should be in the same directory where phpVMS files/folders are Copy the index.php file from /welcome/portal (where your phpVMS files/folders are) to /welcome (one directory up from your phpVMS files/folders) Open the /welcome/index.php file (NOT /welcome/portal/index.php) Find these lines define('CODON_MODULES_PATH', dirname(__FILE__).'/core/modules'); define('CODON_DEFAULT_MODULE', 'Frontpage'); include 'core/codon.config.php'; Change to (set for the folder structure you posted above) define('CODON_MODULES_PATH', dirname(__FILE__).'/portal/core/modules'); define('CODON_DEFAULT_MODULE', 'Frontpage'); include 'portal/core/codon.config.php'; Save the /welcome/index.php file and test if it works for you. Let us know if that works for you. I would guess that you could set up the index.php file in /welcome any way you like (map, newest pilots, etc.) - but you need to have the above edited lines so it can find phpVMS stuff. Quote Link to comment Share on other sites More sharing options...
RedKingOne Posted April 24, 2020 Author Report Share Posted April 24, 2020 @ProAvia When I load the index.php with the stated changes, it forces the change to move into the portal subdomain. Quote Link to comment Share on other sites More sharing options...
Administrators ProAvia Posted April 24, 2020 Administrators Report Share Posted April 24, 2020 If you go to your domain... http://urlhere.org/welcome - it should load the index page. clicking any link there will load to the /portal directory If you go to your domain/portal... http://urlhere.org/welcome/portal - it should load the same index page I don't use a crew center type skin. My log in box is in the upper right corner of the page. I just wanted to main domain and the phpvms directory to show the same page. https://mysite.com - domain https://mysite.com/phpvms - where my phpvms files/folders are Quote Link to comment Share on other sites More sharing options...
RedKingOne Posted April 24, 2020 Author Report Share Posted April 24, 2020 2 minutes ago, ProAvia said: If you go to your domain... http://urlhere.org/welcome - it should load the index page. clicking any link there will load to the /portal directory If you go to your domain/portal... http://urlhere.org/welcome/portal - it should load the same index page I don't use a crew center type skin. My log in box is in the upper right corner of the page. I just wanted to main domain and the phpvms directory to show the same page. https://mysite.com - domain https://mysite.com/phpvms - where my phpvms files/folders are What I mean is that if I type http://urlhere.org/welcome/index.php it will auto redirect to http://urlhere.org/welcome/portal/index.php. Trouble remains, If I dont have a user name and password it still wont show me anything.in a worst case scenario I know I can just iframe the map. Im just trying to scripted so that I can pull the rest of the VA stats as well. Quote Link to comment Share on other sites More sharing options...
Administrators ProAvia Posted April 24, 2020 Administrators Report Share Posted April 24, 2020 Mine doesn't redirect until you click a link on the index.php page. How about if you edit frontpage_main in the skins folder? <?php if(Auth::LoggedIn()) { header('Location:'.SITE_URL.'/index.php/profile'); } else { header('Location:'.SITE_URL.'/index.php/login'); } ?> In the 'else' section, have /index.php - without the /login. Of course, you would need to provide a login section on the index.php page. Or have a totally different page to go to if not logged in - but it would still need a login section or link to the login page. Like I said, I don't have a crew center skin and don't really know if the above would work with it or not. Quote Link to comment Share on other sites More sharing options...
RedKingOne Posted April 24, 2020 Author Report Share Posted April 24, 2020 8 minutes ago, ProAvia said: Mine doesn't redirect until you click a link on the index.php page. How about if you edit frontpage_main in the skins folder? <?php if(Auth::LoggedIn()) { header('Location:'.SITE_URL.'/index.php/profile'); } else { header('Location:'.SITE_URL.'/index.php/login'); } ?> In the 'else' section, have /index.php - without the /login. Of course, you would need to provide a login section on the index.php page. Or have a totally different page to go to if not logged in - but it would still need a login section or link to the login page. Like I said, I don't have a crew center skin and don't really know if the above would work with it or not. Hey no worries, I appreciate you even taking the time. That still didn't work. Either full blank page or fatal errors out. If I can try a different a different approach to this. Do you know how to create a module for use inside of phpvms. Im figuring if I can add a blank module to only show text, than I can use the normal code spinets to pull all the stats into that one module. After that I can just iframe the module to the static page. Quote Link to comment Share on other sites More sharing options...
Administrators ProAvia Posted April 24, 2020 Administrators Report Share Posted April 24, 2020 I do know how to create a module. Getting it to successfully work is another thing. LOL Hopefully another member will see this and be able to assist you. Let us know how this all works out. Quote Link to comment Share on other sites More sharing options...
RedKingOne Posted April 27, 2020 Author Report Share Posted April 27, 2020 So I've managed to get the iframes working. On last bit, hoping you all can help me with. If I am signed in to the crewcenter, I the iframe shows me the skin plus the map. When im logout, it will only show me the map. Any thoughts on how I can get the iframe to show me only the map regardless of status. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.