| View previous topic :: View next topic |
| Author |
Message |
Eraser Grandmaster Cheater
Reputation: 0
Joined: 23 Jul 2008 Posts: 504 Location: http://www.youtube.com/PCtrainers
|
Posted: Tue Apr 21, 2009 7:31 am Post subject: How people do this with sites? |
|
|
http://www.thps-mods.com/
this is my site and as u see there are sections to the left. Now if i want to add forums section i would have to edit all of my pages i have uploaded to the website. Is there any easier way to add? Like edit something in .CSS file?
|
|
| Back to top |
|
 |
SoccaBallDude Master Cheater
Reputation: 1
Joined: 29 Aug 2008 Posts: 263
|
Posted: Tue Apr 21, 2009 2:22 pm Post subject: |
|
|
| You could create a base template, and then attach all the desired files to it. Then any changes to the template would change the code for you in the other pages in the non-editable regions.
|
|
| Back to top |
|
 |
Eraser Grandmaster Cheater
Reputation: 0
Joined: 23 Jul 2008 Posts: 504 Location: http://www.youtube.com/PCtrainers
|
Posted: Wed Apr 22, 2009 4:25 am Post subject: |
|
|
| I tried googling how to attach everything to main template, but couldn't find anything :S Can you explain? If there's not much write to you of course
|
|
| Back to top |
|
 |
SXGuy I post too much
Reputation: 0
Joined: 19 Sep 2006 Posts: 3551
|
Posted: Wed Apr 22, 2009 6:27 am Post subject: |
|
|
Simple php scripting, very easy.
Create an html page that holds menu bar details, then include a php page that checks whether a certain menu item is clicked, and populates the page with the correct php script.
you can find loads of tutorials with google.
|
|
| Back to top |
|
 |
shhac Expert Cheater
Reputation: 0
Joined: 30 Oct 2007 Posts: 108
|
Posted: Wed Apr 22, 2009 7:10 am Post subject: |
|
|
As the previous person mentioned, using some kind of container .php as the index would enable you to seperate the html.
You could also use frames but php would be better because frames are like new instances of the rendering engine.
Example of what you might want to do: | Code: | <html><head>...</head><body>...
<?
include 'sidebar.html';
?>
...
<?
$page = basename($_GET['p']);
if($page == '' || $page == '..'){
include 'main.html';
}elseif(file_exists($page.'.html') && $page != 'sidebar'){
include $page.'.html';
}else{
include 'notFound.html';
}
?>
...
</body>
</html> |
|
|
| Back to top |
|
 |
lil_hack3r Cheater
Reputation: 0
Joined: 26 Dec 2007 Posts: 29 Location: In your Comps Hard drive
|
Posted: Wed Apr 22, 2009 8:05 am Post subject: |
|
|
Looks like a decent site.
_________________
It's not my fault that you were expecting to see a cool signature. |
|
| Back to top |
|
 |
~Pineapple! Grandmaster Cheater Supreme
Reputation: 2
Joined: 27 Dec 2008 Posts: 1810 Location: The Local Library :3
|
Posted: Wed Apr 22, 2009 10:01 am Post subject: |
|
|
| lil_hack3r wrote: | | Looks like a decent site. |
How is that on topic?
_________________
|
|
| Back to top |
|
 |
Eraser Grandmaster Cheater
Reputation: 0
Joined: 23 Jul 2008 Posts: 504 Location: http://www.youtube.com/PCtrainers
|
Posted: Wed Apr 22, 2009 2:12 pm Post subject: |
|
|
Erm.. it's a lil complicated for me.. so u saying that i should create a php file and put
| Code: | <html><head>...</head><body>...
<?
include 'sidebar.html';
?>
...
<?
$page = basename($_GET['p']);
if($page == '' || $page == '..'){
include 'main.html';
}elseif(file_exists($page.'.html') && $page != 'sidebar'){
include $page.'.html';
}else{
include 'notFound.html';
}
?>
...
</body>
</html> |
in it?
and here:
| Code: | | <html><head>...</head><body> |
i put my whole htm file or just the part i want to be changed?
|
|
| Back to top |
|
 |
pazila Master Cheater
Reputation: 0
Joined: 25 Apr 2007 Posts: 266 Location: Australia
|
Posted: Thu Apr 23, 2009 1:38 am Post subject: |
|
|
1) Copy the code which makes up your menu.
2) Stick it into a new file, such as "menu.php".
3) Replace the menu code in all your pages with "<?php include 'menu.php' ?>".
- Make sure whatever files have the above code in them are saved with the extension ".php".
- If the file was already in PHP, then don't put in the PHP tags. ("<?php" and "?>")
_________________
|
|
| Back to top |
|
 |
Eraser Grandmaster Cheater
Reputation: 0
Joined: 23 Jul 2008 Posts: 504 Location: http://www.youtube.com/PCtrainers
|
Posted: Thu Apr 23, 2009 4:20 am Post subject: |
|
|
OMG you're my hero man i will rep you as soon as possible because i gave rep to someone like 2 hrs ago
thnx pazila
|
|
| Back to top |
|
 |
|