Page 1 of 1

how to include any html/php page into home page or any page?

Posted: Nov 14th, '14, 02:24
by chirng
Dear Sir,

I would like to know how to include any html/php page into home page or any other pages, please advise, TQ.

Re: how to include any html/php page into home page or any page?

Posted: Nov 16th, '14, 19:08
by administrator
templates/{your template}/default.php

Code: Select all

<?php
if((Application::Get('page') != '') && file_exists('page/'.Application::Get('page').'.php')){
    include_once('page/'.Application::Get('page').'.php');
}else if((Application::Get('user') != '') && file_exists('user/'.Application::Get('user').'.php')){
    if(Modules::IsModuleInstalled('users')){   
        include_once('user/'.Application::Get('user').'.php');
    }else{
        include_once('user/404.php');
    }
}else if((Application::Get('admin') != '') && file_exists('admin/'.Application::Get('admin').'.php')){
    include_once('admin/'.Application::Get('admin').'.php');
}else{
    if(Application::Get('template') == 'admin'){
        include_once('admin/home.php');
    }else{                              
        include_once('page/pages.php');                              
    }
}
?>


Add there call to home.php and create such page in page/ directory

Re: how to include any html/php page into home page or any page?

Posted: Nov 17th, '14, 03:03
by chirng
do you means, add include_once('page/my_ownpage.php'); inside below content?

if(Application::Get('template') == 'admin'){
include_once('admin/home.php');
}else{
include_once('page/pages.php');
include_once('page/my_ownpage.php');
}

Re: how to include any html/php page into home page or any page?

Posted: Nov 17th, '14, 18:57
by administrator
Yes, something like this, you may define any rule you need.

Re: how to include any html/php page into home page or any page?

Posted: Nov 18th, '14, 08:39
by chirng
feedback about the bug, after a day, I can't login the admin page mydomain/index.php?admin=home,.. even I copy back the original default.php file also not running, how do I debug it? Please find attched error image,
error.jpg
error.jpg (15.43 KiB) Viewed 4374 times



please advise.

TQ

Re: how to include any html/php page into home page or any page?

Posted: Nov 18th, '14, 15:31
by administrator
In this page chech the code that Check if user is logged in: if($objLogin->IsLoggedIn...

Re: how to include any html/php page into home page or any page?

Posted: Nov 20th, '14, 03:37
by chirng
ok, the above mentioned issues have been resolved, but I would like to know how to create my own text area of Home Page, perhaps I want to let Home Page as a link page, so that we can create our own Home Page text area to become our customized page, just like other kind of new page, we can make the text area more creative, please advise.

Re: how to include any html/php page into home page or any page?

Posted: Nov 20th, '14, 19:27
by administrator
how to create my own text area of Home Page

Explain please what do you mean?

Re: how to include any html/php page into home page or any page?

Posted: Nov 21st, '14, 01:41
by chirng
the current Home Page is header + text area, can we remove the text area and replace our own page? like include something.php or let the Home Page forward to another url page? or How to set the Home page to another new page which created by ourselves?

Re: how to include any html/php page into home page or any page?

Posted: Nov 23rd, '14, 06:45
by administrator
I don't really understand what you mean.
1. You may redo link of Home page in include/classes/Menu.class.php
2. When you create your own php page for hoe page you may add to it any content you want, including html or javascript.