Center alignment of text in mboard

Is message board greying out your hair (at least what's left of it)? Let us help you here
Locked
clubamigos99
Posts: 62
Joined: Mon Feb 20, 2006 4:20 pm

Center alignment of text in mboard

Post by clubamigos99 »

Script URL: http://www.club-amigos.co.uk/mboard/mboard.php
Version of script: latest
Version of PHP: 4
Hosting company: http://www.34sp.com/
Have you searched THIS FORUM for your problem:
(if not please do before posting)
If so, what terms did you try:

Write your message below:

Please please can you tell me where in the coding l need to change so that when l click on a thread on the message board it does not align to the left in IE.
I have used the same principle for header and footers in the mboard as l have for the gbook but for some reason this problem appears to be a bit of a nusiance in IE, it is fine in Firefox.
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Well, I have no intention of teaching HTML here, but you might try changing

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"

to

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"

I saw that work with <div> layer problems before...

Regards
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
clubamigos99
Posts: 62
Joined: Mon Feb 20, 2006 4:20 pm

Post by clubamigos99 »

I tried this but no luck.
Is there anything else l can try.
I have done everything as per your instructions in modifying the script.
Could there possibly be something in the script that is causing this error?
This is the header file l am using:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<title>Useful links</title>
<meta name="keywords" content="social clubs southampton,clubs southampton,single events hampshire,new friends hampshire,new friends southampton,looking new friends,meeting new people,social clubs south coast,looking friendship uk,social clubs UK">
<meta name="description" content="A social club for people to go out enjoy themselves and try new activites">
<meta name="robots" content="index,follow">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="http://club-amigos.co.uk/amigos_style.css" rel="stylesheet" type="text/css" />
<link href="http://club-amigos.co.uk/guestbook/style.css" rel="stylesheet" type="text/css" />

<div id="wrapper">
<div id="header"></div>
<div id="navcontainer">
<ul>
<li> <a href="http://www.club-amigos.co.uk/index.htm">Home</a> </li>
<li> <a href="http://www.club-amigos.co.uk/faq.htm">FAQ's</a> </li>
<li> <a href="http://www.club-amigos.co.uk/links.htm">Links</a> </li>
<li> <a href="http://www.club-amigos.co.uk/feb.html">Calendar</a></li>
<li> <a href="http://www.club-amigos.co.uk/mboard/mbo ... um</a></li>
<li> <a href="http://www.club-amigos.co.uk/guestbook/ ... ok</a></li>
<li> <a href="http://www.club-amigos.co.uk/contact.html" id="last">Contact</A>
</ul>
</div>
<div id="content">
<div id="rightcol">
</div>
<h1>Guestbook</h1>
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

Hello clubamigos99,

You use <link href="http://club-amigos.co.uk/guestbook/style.css" rel="stylesheet" type="text/css" /> as a link to the style file of MBoard.
I think you should use <link href="http://club-amigos.co.uk/mboard/style.css" rel="stylesheet" type="text/css" />

For the proper styles in the style.css file you should learn some css. I use the following pages a lot to see what styles to use http://www.w3schools.com/css/default.asp

Greetings,
Henrie
clubamigos99
Posts: 62
Joined: Mon Feb 20, 2006 4:20 pm

Post by clubamigos99 »

I tried this and no luck, any suggestion as to what else l could try?
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

First of all, learn the basics of html writing.
In the generated page http://www.club-amigos.co.uk/mboard/mboard.php
the <head>, </head> and <body> tags are missing.

When you have a page ready try the W3C Markup Validation Service http://validator.w3.org/ to test if your page is valid html.
A lot of pages on the internet don't behave the same way in different browsers because they are not written in correct html. And some browers try to correct the errors in one way and some in another way and therefor deliver a different looking page.

When i checked your page it shows 17 errors. There are really less errors in your page because when an opening or closing tag is missing following opening or closing tages are often counted wrong.
The main error i can discover are the before mentioned missing <head>, </head> and <body> tags and a missing "document type declaration".

For the MBoard there will always be errors because the generated output by the mboard.php is not valid (for example <p> tags are used in a <ul> list before a <li> tag is placed which is not allowed).

I hope this helps a little. Trying to write valid html pages will also help.

Greetings,
Henrie
clubamigos99
Posts: 62
Joined: Mon Feb 20, 2006 4:20 pm

Post by clubamigos99 »

Sorry, l am a bit confused.

I was told to remove the head,body and html tags from the header file by the author of the script.

Can you explain what HTML you mean?
clubamigos99
Posts: 62
Joined: Mon Feb 20, 2006 4:20 pm

Post by clubamigos99 »

clubamigos99 wrote:Sorry, l am a bit confused.

I was told to remove the head,body and html tags from the header file by the author of the script.

Can you explain what HTML you mean?
I think when l made this post l did not explain myself, l was referring to the forum not being aligned correctly and NOT the text.
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

I see what you meant.

I can't help you with this (it's to much work). I have looked at the produced pages and it's a mess :( .

1.
You have edited the mboard.php file and removed the code from the function printTopHTML() and have placed your own headers in the header.txt file. But as far as i can see you have placed only partial headers in this file. The <doctype>, <head>, </head> and <body> parts are missing.
And you have added the following code at the end

Code: Select all

<table BORDER=0 CELLSPACING=0 CELLPADDING=0 HEIGHT="1%" >
<div align="center"><center>
<table border="0" width="75%"><tr>
<td>
which in my opinion is not needed. Your wrapper div should be enough.
You have also started two tables here which are not being ended in the header.txt file or the footer.txt file you should always close a tag if you open one.

If you want to set the width of the MBoard you should find the following in the mboard.php file

Code: Select all

<table border="0" width="95%">
(possibly more than one time) and change the width.
My personal opinion is that this is just a little bad page writing from Klemen Stirn, to partially define styles in the php file and partially in the style.css file.

2.
You have removed the header produced by function printTopHTML() but not in the function createNewFile( which writes the headers for the different posts in the forum. Therefor in the posts now two headers are present. The ones created by the mboard.php file and the ones created by your header.txt file.

Conlusion.
If you clear the mess you have made by editing the headers, your pages will look a lot better.

If the resulting pages are not exactly what you want, look at the source code from inside your browser and try to find what's wrong. Are there incorrect headers (or double headers) as you have now.
Or maybe an element needs a different style. There probably is no need for additional tables or div's to change the appearance. Just a changing of styles in the style.css file or in the mboard.php file (because some styles are unfortunately coded directly in this file) will probably suffice.

I hope this helps you because the only other help i could give you would be to personally rewrite your pages and i have no intention of doing that.

Greetings,
Henrie
Locked