Modification to alignment of text in script

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

Modification to alignment of text in script

Post by clubamigos99 »

Script URL: http://www.club-amigos.co.uk/mboard/mboard.php
Version of script: latest
Version of PHP: 4
Hosting company:
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 can you tell me how l can make an amendment to the script so that the forum is centred in IE.

I would like to add the following code:

<tr align="center"> after the words 95%">
Please can you tell me the correct syntax for this, as l tried this and got an error.

<div align="center"><center>
<table border="0" width="95%"><tr>
<td>
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

Hello clubamigos99,

Because you keep asking, i tried again today.
I saved your starting page index.htm which displays right and two pages that display wrong, the presented mboard.php (saved as mboard_php.html) and the presented 31.html page.

Then I looked at what was different between the index.htm page and the mboard.php page. This was the headers. I pasted the headers of the index.htm page in my mboard_php.html page and it showd ok. I then tried to narrow down what of the header made the difference. It turned out to be doctype declaration. In the presented mboard page you declare the following doctype

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
In your index.htm page you declare the following doctype

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
When i replace the first with the second it works for me.

The same is true for your 31.html file this also works when i have the second doctype declaration.

I discovered another thing.
When i look at the source code from the pages created by mboard (mboard.php and 31.html) i see two doctype declarations and two <title> sections. One from the code generated by mboard.php and one from your header.txt file. When i save this page to my computer the code is cleaned up and the double doctype declaration and the double <title> section is cleaned so that only on exists (as it should).

This leads to my conclusion that you should really change the code in mboard.php or header.txt so that only one header section exists. You should choose to create the header of the html file with mboard.php (and therefor delete it in the header.txt file. Or create the header with your header.txt file and delete the part in mboard.php file which creates the headers.
Be aware that in mboard.php there are two portions that create headers.
One for the posted messages (in function createNewFile) and one for the forum startpage (in function printTopHTML).

I hope you try to correct the double doctype declaration (and apply the correct single doctype declaration) because it solved the problem for me when i changed your files locally on my computer.

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

Post by clubamigos99 »

Henrie wrote:Hello clubamigos99,

Because you keep asking, i tried again today.
I saved your starting page index.htm which displays right and two pages that display wrong, the presented mboard.php (saved as mboard_php.html) and the presented 31.html page.

Then I looked at what was different between the index.htm page and the mboard.php page. This was the headers. I pasted the headers of the index.htm page in my mboard_php.html page and it showd ok. I then tried to narrow down what of the header made the difference. It turned out to be doctype declaration. In the presented mboard page you declare the following doctype

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
In your index.htm page you declare the following doctype

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
When i replace the first with the second it works for me.

The same is true for your 31.html file this also works when i have the second doctype declaration.

I discovered another thing.
When i look at the source code from the pages created by mboard (mboard.php and 31.html) i see two doctype declarations and two <title> sections. One from the code generated by mboard.php and one from your header.txt file. When i save this page to my computer the code is cleaned up and the double doctype declaration and the double <title> section is cleaned so that only on exists (as it should).

This leads to my conclusion that you should really change the code in mboard.php or header.txt so that only one header section exists. You should choose to create the header of the html file with mboard.php (and therefor delete it in the header.txt file. Or create the header with your header.txt file and delete the part in mboard.php file which creates the headers.
Be aware that in mboard.php there are two portions that create headers.
One for the posted messages (in function createNewFile) and one for the forum startpage (in function printTopHTML).

I hope you try to correct the double doctype declaration (and apply the correct single doctype declaration) because it solved the problem for me when i changed your files locally on my computer.

Greetings,
Henrie
======================
Thanks for that.

Sorry but l am little confused.
Please can answer these questions so l fully understand how to recitify this problem.

1. Is this doctype correct for index.html:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401- ... /loose.dtd">

2. Is this doctype correct for mboard.php?
"<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>

3. Is this header file correct?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.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/album.htm">Album</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>


I would appreciate if you could answer the questions so l can resolve this issue.
clubamigos99
Posts: 62
Joined: Mon Feb 20, 2006 4:20 pm

Post by clubamigos99 »

clubamigos99 wrote:
Henrie wrote:Hello clubamigos99,

Because you keep asking, i tried again today.
I saved your starting page index.htm which displays right and two pages that display wrong, the presented mboard.php (saved as mboard_php.html) and the presented 31.html page.

Then I looked at what was different between the index.htm page and the mboard.php page. This was the headers. I pasted the headers of the index.htm page in my mboard_php.html page and it showd ok. I then tried to narrow down what of the header made the difference. It turned out to be doctype declaration. In the presented mboard page you declare the following doctype

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
In your index.htm page you declare the following doctype

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
When i replace the first with the second it works for me.

The same is true for your 31.html file this also works when i have the second doctype declaration.

I discovered another thing.
When i look at the source code from the pages created by mboard (mboard.php and 31.html) i see two doctype declarations and two <title> sections. One from the code generated by mboard.php and one from your header.txt file. When i save this page to my computer the code is cleaned up and the double doctype declaration and the double <title> section is cleaned so that only on exists (as it should).

This leads to my conclusion that you should really change the code in mboard.php or header.txt so that only one header section exists. You should choose to create the header of the html file with mboard.php (and therefor delete it in the header.txt file. Or create the header with your header.txt file and delete the part in mboard.php file which creates the headers.
Be aware that in mboard.php there are two portions that create headers.
One for the posted messages (in function createNewFile) and one for the forum startpage (in function printTopHTML).

I hope you try to correct the double doctype declaration (and apply the correct single doctype declaration) because it solved the problem for me when i changed your files locally on my computer.

Greetings,
Henrie
======================
Thanks for that.

Sorry but l am little confused.
Please can answer these questions so l fully understand how to recitify this problem.

1. Is this doctype correct for index.html:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401- ... /loose.dtd">

2. Is this doctype correct for mboard.php?
"<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>

3. Is this header file correct?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.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/album.htm">Album</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>


I would appreciate if you could answer the questions so l can resolve this issue.

I tried what you mentioned but it does not work please please can you tell me what l am doing wrong.

I put a new doctype in the mboard.php and got the error:

arse error: syntax error, unexpected '<' in /usr/local/psa/home/vhosts/club-amigos.co.uk/httpdocs/mboard/mboard.php on line 624
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

Ok here I go (because i can see you have certainly tried to change you code properly).

I saw you have it partially working bot it's not really proper html. You have meta tags and links to your css files inside your body and these are supposed to be in you head section.

Here is a step by step explanation how i would have done it.

1. Open mboard.php file.
Then change lines 255-268

Code: Select all

$content="<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
<html>
<head>
<title>$subject</title>
<meta content=\"text/html; charset=windows-1250\">
<link href=\"$settings[mboard_url]/style.css\" type=\"text/css\" rel=\"stylesheet\">
<META HTTP-EQUIV=\"Expires\" CONTENT=\"-1\">
<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">
<script language=\"Javascript\" src=\"$settings[mboard_url]/javascript.js\"><!--
//-->
</script>
</head>
<body>
";
to

Code: Select all

$content="<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd\">
<html>
<head>
<title>$subject</title>
<meta content=\"text/html; charset=iso-8859-1\">
<link href=\"http://club-amigos.co.uk/amigos_style.css\" rel=\"stylesheet\" type=\"text/css\">
<link href=\"$settings[mboard_url]/style.css\" type=\"text/css\" rel=\"stylesheet\">
<META HTTP-EQUIV=\"Expires\" CONTENT=\"-1\">
<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">
<script language=\"Javascript\" src=\"$settings[mboard_url]/javascript.js\"><!--
//-->
</script>
</head>
<body>
";
I would not include your own meta tags as they are not really needed for this page. These mostly make sense for your index.htm page.

Then change lines 623-634

Code: Select all

echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
<html>
<head>
<title>$settings[mboard_title]</title>
<meta content=\"text/html; charset=windows-1250\">
<link href=\"style.css\" type=\"text/css\" rel=\"stylesheet\">
<script language=\"Javascript\" src=\"javascript.js\" type=\"text/javascript\"><!--
//-->
</script>
</head>
<body>
";
to

Code: Select all

echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd\">
<html>
<head>
<title>$settings[mboard_title]</title>
<meta content=\"text/html; charset=iso-8859-1\">
<link href=\"http://club-amigos.co.uk/amigos_style.css\" rel=\"stylesheet\" type=\"text/css\">
<link href=\"style.css\" type=\"text/css\" rel=\"stylesheet\">
<script language=\"Javascript\" src=\"javascript.js\" type=\"text/javascript\"><!--
//-->
</script>
</head>
<body>
";
2. Open header.txt file.
Insert the following of your code

Code: Select all

<div id="wrapper">
			<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/mboard.php">Forum</a></li>	
								<li> <a href="http://www.club-amigos.co.uk/guestbook/gbook.php">Guestbook</a></li>
                                                                <li> <a href="http://www.club-amigos.co.uk/album.htm">Album</a></li>
								<li> <a href="http://www.club-amigos.co.uk/contact.html" id="last">Contact</A> 					
		            </ul>
		    				</div>
							<div id="content">
			 <h1>Guestbook</h1>
3. Open the footer.txt file
Insert the following code

Code: Select all

<div id="footer">x</div>
</div>
</div>
4. If you want to left align the list with topics in the start page of the forum, add this to you style.css file

Code: Select all

ul {text-align: left;}
5. If you want to align text in the displayed topic left (like it shows in Firefox) you should add

Code: Select all

p.left {text-align: left;}
to the style.css file
and change the following lines in mboard.php
line 284

Code: Select all

<p><a href=\"$settings[mboard_url]/mboard.php?a=delete&num=$count&up=$up\"><img
to

Code: Select all

<p class=\"left\"><a href=\"$settings[mboard_url]/mboard.php?a=delete&num=$count&up=$up\"><img
and
line 294

Code: Select all

<p>$comments</p>
to

Code: Select all

<p class=\"left\">$comments</p>
I think this should create good style.
For doctype i would not use xhtml doctype because the forum script is html4 and does not comply to xhtml standards.

I hope this is the light at the end of the tunnel for you.
And I hope you learn to write clean html 'code' because messy code can create unpredictable pages.

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

Post by clubamigos99 »

Thanks for that, it still does not work, this is the coding l am using:
Please can you check these files are correct and that l have not made a simple error, thanks.

header
=====

<div id="wrapper">
<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/album.htm">Album</a></li>
<li> <a href="http://www.club-amigos.co.uk/contact.html" id="last">Contact</A>
</ul>
</div>
<div id="content">
<h1>Forum</h1>


footer:
=====
<div id="footer">x</div>
</div>
</div>


styles.css
=====

TD.upper {
color : #FFFFFF;
background : #23559C;
font-size: 11px;
}

FONT.smaller {
font-size: 10px;
}

table.entries {
color : black;
font-size: 11px;
BORDER-RIGHT: #23559C 1px solid;
BORDER-LEFT: #23559C 1px solid;
BORDER-TOP: #23559C 1px solid;
BORDER-BOTTOM: #23559C 1px solid;
}


INPUT {
font-size: 11px;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
color:#000000;
background-color:#FFFFFF;
}

HR {
color: #B8CFE7;
height: 1px;
}

font.ip {
color : Gray;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 9px;
}

ul {text-align: left;}

p.left {text-align: left;}
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

Hello clubamigos99,

It works for me.... almost.
In the header.txt file I accidentally deleted the <div id="header"></div> in my previous example, so you should place it back in the header.txt file.

The existing forum entry is displayed wrong because the headers in this file http://www.club-amigos.co.uk/mboard/msg/31.html are wrong. An entry is just a simple html file with no php coding in it. Once it is created it is not upduted by the changed mboard.php file. So you should either edit the file manually or delete this entry.

To let you see my code works (without the <div id="header"></div>) I posted a message myself.
You should delete my message because it was just for testing purposes.

Greetings,
Henrie
Last edited by Henrie on Sun Mar 05, 2006 6:25 pm, edited 1 time in total.
clubamigos99
Posts: 62
Joined: Mon Feb 20, 2006 4:20 pm

Thanks you very much indeed

Post by clubamigos99 »

The forum now works yipee!!

I cannot thank you enough your help was really appreciated in getting this forum working.

I made this change , by adding:
<div id="header"></div>

and it now works great.

Thanks a lot once again for your help and patience in helping me getting it to work. Your time and effort is really appreciatiated.

justin
Locked