roboa Posted June 9, 2009 Report Share Posted June 9, 2009 Hey everyone, Just wondering if the pages you can create through the admin panel will accept PHP and show it in the site. If not how could I display a php page? cheers, roboa Quote Link to comment Share on other sites More sharing options...
Administrators simpilot Posted June 9, 2009 Administrators Report Share Posted June 9, 2009 You can create your own php pages and place them in the "Pages" folder and then call them through <your site>/index.php/Pages/yourpage, or that is what has worked for me. I have not tried the pages module in the admin center although I think that is designed for static pages versus pages that are calling functions and such. It is easy to create your own module as well and create new dynamic pages through that method. The great way Nabeel has designed this app makes it easy to add your own content. Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted June 9, 2009 Administrators Report Share Posted June 9, 2009 If you're gonna use a lot of php, it's better to create a module, and you can call whatever you want in it. If it's just a few lines, you can add them via the html pages in /core/pages/[yourpage].htm. I am not sure if you can add PHP directly using the source mode of the editor Quote Link to comment Share on other sites More sharing options...
roboa Posted June 11, 2009 Author Report Share Posted June 11, 2009 cheers guys Quote Link to comment Share on other sites More sharing options...
roboa Posted June 28, 2009 Author Report Share Posted June 28, 2009 I've put 2 pages in the pages folder which contain this php: <?php echo "Hello, this is a test of the page test.php!!"; ?> One file is test2.php and the other is just test.htm and neither will show. I just get the page missing alert. Am I doing something wrong? cheers, roboa Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted June 28, 2009 Administrators Report Share Posted June 28, 2009 you have to add it in the .htm file, which is the same name as the title Quote Link to comment Share on other sites More sharing options...
roboa Posted June 28, 2009 Author Report Share Posted June 28, 2009 Ok, so I now have a file called test.htm in the core/pages folder with this content in it: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <title>test</title> </head> <body> <?php echo "Hello, this is a test of the page test.php!!"; ?> </body> </html> So the address for the page would be http://fcava.co.uk/index.php/pages/test but it displays the no page error. When I try to add the page through the admin panel I get this error: Warning: fopen(/home/fcava./public_html/core/pages/phptest.htm) [function.fopen]: failed to open stream: Permission denied in /home/fcava./public_html/core/common/SiteData.class.php on line 255 cheers, roboa Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted June 29, 2009 Administrators Report Share Posted June 29, 2009 You have to add the page in the admin panel first, then edit the file. Seems like permissions are not set to 777 in core/pages (for the folder and files it must be writable) Quote Link to comment Share on other sites More sharing options...
roboa Posted June 29, 2009 Author Report Share Posted June 29, 2009 Cheers Nabeel, got that working all nicely now! I'm trying to call the routemap to a page now and am using this: <?php MainController::Run("RouteMap", "ShowMap"); ?> Now, it sort of works and does bring up a google map but with no information and some joyful errors Is there anyway I can modify that to make it work? Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted June 29, 2009 Administrators Report Share Posted June 29, 2009 For the map you also need some of the javascript templates. What are some of the errors? Quote Link to comment Share on other sites More sharing options...
roboa Posted June 29, 2009 Author Report Share Posted June 29, 2009 These are the errors I get: Warning: Missing argument 1 for RouteMap::ShowMap(), called in /home/fcava./public_html/core/classes/MainController.class.php on line 295 and defined in /home/fcava./public_html/core/modules/RouteMap/RouteMap.php on line 39 Warning: Invalid argument supplied for foreach() in /home/fcava./public_html/core/modules/RouteMap/RouteMap.php on line 50 Warning: Division by zero in /home/fcava./public_html/core/modules/RouteMap/RouteMap.php on line 74 Warning: Division by zero in /home/fcava./public_html/core/modules/RouteMap/RouteMap.php on line 75 Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted June 30, 2009 Administrators Report Share Posted June 30, 2009 What are you trying to show? Quote Link to comment Share on other sites More sharing options...
roboa Posted June 30, 2009 Author Report Share Posted June 30, 2009 The routemap I'm trying to call it into another page Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted July 1, 2009 Administrators Report Share Posted July 1, 2009 Which routes are you trying to show? All of them? Quote Link to comment Share on other sites More sharing options...
roboa Posted July 1, 2009 Author Report Share Posted July 1, 2009 yep Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted July 6, 2009 Administrators Report Share Posted July 6, 2009 Sorry, been hectic. Use this: MainController::Run("RouteMap", "ShowMap", SchedulesData::GetSchedules()); Quote Link to comment Share on other sites More sharing options...
G-NEWC Posted August 18, 2009 Report Share Posted August 18, 2009 Sorry to bump an old topic, but if i wanted to show the ACARSmap on one of these pages, what would i have to put? Cheers Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted August 18, 2009 Administrators Report Share Posted August 18, 2009 Copy the code from the route_map.tpl or acarsdata.tpl I think it was Quote Link to comment Share on other sites More sharing options...
G-NEWC Posted August 19, 2009 Report Share Posted August 19, 2009 Tried to edit the htm file in core/pages and i'm getting the following after trying to save; [a fatal error or timeout occurred while processing this directive] Have tried editing the permissions but it won't allow me to. -James Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted August 19, 2009 Administrators Report Share Posted August 19, 2009 Contact your host about that, maybe try FTP in passive mode? 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.