In my CMS file index.php selects a module. The list of actions:
– include kernel.php
– echo <html><head> … to </head><body>
– include skin’s body.php (it includes a file which selects a module or category)
– echo </body></html>
Index.php is used for most modules (except admin.php, login.php…).
Site addresses looks like:
– index.php?mod=arts&id=5
– index.php?mod=user&id=1
I think about changing it if there are better solutions. I want to allow modules and plugins put their code into <title>, <head> and before <html>. However, more important is allowing them to select if they want to use the whole layout or information <div> or Header(“Location: …”).
I used the following code in <head></head>. However, I can include it before <html>.
[code=php]
if($_GET[‘mod’])
{
@include(‘plugins/’.$_GET[‘mod’].’/head.php’);
}
Is it good solution?
[b]Other way.
The main files would be modules’ files, e.g. art.php, file.php. Addresses like:
– art.php?id=7
– user.php?id=4
The disadvantage of it is repeating code for displaying layout in every module / file. Maybe there are better solutions similar to these.
What do you think about it? What advices can you give me? Do you have other solutions?