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
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
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.
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
cheers guys
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
you have to add it in the .htm file, which is the same name as the title
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
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)
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?
For the map you also need some of the javascript templates.
What are some of the errors?
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
What are you trying to show?
The routemap
I’m trying to call it into another page
Which routes are you trying to show? All of them?
yep
Sorry, been hectic. Use this:
MainController::Run("RouteMap", "ShowMap", SchedulesData::GetSchedules());
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
Copy the code from the route_map.tpl or acarsdata.tpl I think it was
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
Contact your host about that, maybe try FTP in passive mode?