[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
The Honest Way Forum • View topic - Website amendments...

Website amendments...

Please feel free to make any suggestions on ways to improve this forum (or the parent website) or comments about anything forum-related. NO ADS!

Moderators: magnetize, Oosha, ftello, shezz

Website amendments...

Postby Tel » Wed Mar 28, 2007 5:34 pm

I'm a bit picky and some of the wording just didn't seem right on the homepage of the website.

I thought I'd been clever in using php to include a single file to administer things like menu bar, header and footer - part of each page that are the same so I'd only have to make any updates once. But there's still some text that is common to all pages (like the header) and that's what I've just changed.

I've also put the forum link in the menu bar and will eventually remove it from the right sidebar to make way for some more affiliate ads.
Terry

| | |
User avatar
Tel
Site Admin
 
Posts: 2919
Joined: Sun Mar 25, 2007 4:52 am
Location: Spain

Postby shezz » Wed Mar 28, 2007 10:14 pm

Oh so there is a way to do that, I didn't know that, I know nothing about php whenever I need to change something I change it individually on each page
Shezz
shezz
Moderator
 
Posts: 126
Joined: Tue Mar 27, 2007 10:20 pm

Postby Tel » Thu Mar 29, 2007 7:42 am

I'm no php expert by any means, but there is an easy trick to doing that.

Take your index.html file as an example. You have a header area, body and footer. These sections are porbably exactly the same on most of your other pages too. There are probably other sections to that page that are also the same everwhere else. Like the menu bar, maybe a sidebar with static ads, that sort of thing.

Whenever you want to make a change, say to the menu bar by adding another page link, you have to then make that change in every page that has the menu bar.

Here's how to get round it.

Open your index.html file and save a backup of it as index_old.html (you never know...). Now cut the entire <head> ... </head> section and paste it into a new file. Save it as something like header.php

Note: Here I'm a little unsure of naming conventions. Every site I've seen that uses php anywhere in the page has gotten rid of the .htm or .html extension and replaced it with .php. I think it has to do with the server being able to recognise that there is php embedded in the file. Not sure though.

Anyway, at the top of the now headless index.html file, insert this line of code exactly as is:

<?php
include ('header.php');
?>

Now save your amended index.html file (minus header) as index.php - see the above note. Upload the two new .php files to the server. Now rename index.html to index_old.html on the server.

Open your browser, open your homepage and hit the refresh button on the browser. It should look exactly the same. If it doesn't then there is a problem and you simply rename index_old.html back to index.html and delete index.php. Old backout habits die hard, but they can save your bacon when things go wrong!

Assuming the test was successful, you can go through every other page and replace the <head> ... </head> section with the php code above, making backups of each file first, or course.

One annoying but essential thing you also have to do is change all the internal links to point to the new .php files, but you'll only have to do it once. A good thing to do is to take your menu bar and cut and paste it into a separate file called, for instance, menu.php. Then add the php include statement in it's place:

<?php
include ('menu.php');
?>

The new menu.php will have all the links changed to your .php files, so you only have to make this change once and copy it to all the pages.

You can repeat this idea for the "footer" section and even a sidebar, or anything else you want that is the same on lots of pages.

Then upload all the new .php files to the server. When you're happy everything works fine and all the links are correct, you can delete all the old .htm files from the server.

Whenever you need to make changes to any party of the <head> ... </head> section again (or whatever section you have replaced with the php code), you only need to do it once, then upload that .php file to the server. You won't need to change or upload any of the main data pages unless you make changes to data on individual pages, as you would have done before.

Hope that's not all double dutch!!! 8)
Terry

| | |
User avatar
Tel
Site Admin
 
Posts: 2919
Joined: Sun Mar 25, 2007 4:52 am
Location: Spain


Return to Suggestions and Comments

Who is online

Users browsing this forum: No registered users and 1 guest

cron