● Set your site for HTML5

Mon May 15, 2023 7:43 am
Clan Leader
Top Dog
Nuke Dev / Coder
3041 Posts
coRpSE
In-Game
Once Human

Most Played:
This week: 146.2hrs.
Total Played: 146hrs.


  
Reputation: 7383.9
votes: 7
I am making this post in response to what is going on in
Please login to see this link
Get registered or Log in
. I had to post the changes here, as the Evo site doesn't like me posting the edits. Something with the security setting on the site just doesn't allow me to post it.

I use HTML5 on my site where Evo comes with HTML4 active, but for those that want to have it HTML5, there are 2 files that will need to be edited. Very simple to do. If you want it, just do simple changes:

Open: public_html/header.php

Find:

PHP:  [ Select all ]

echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">
"

 
and add a // in front of it, so it will look like this:

PHP:  [ Select all ]

//echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">
"; 

 
Under that, you will see that the next two lines have a // in front of them.

PHP:  [ Select all ]

// echo '<!DOCTYPE html>';
    // echo "<html lang=\""._LANGCODE."\" dir=\""._LANG_DIRECTION."\">
"; 

 
just remove both of those // on each line so it looks like:

PHP:  [ Select all ]

 echo '<!DOCTYPE html>';
     echo 
"<html lang=\""._LANGCODE."\" dir=\""._LANG_DIRECTION."\">
"

 
Save & Close

The last edit you would need to do is in the
Open: public_html/includes/meta.php

Find: (On or around Line 67)

PHP:  [ Select all ]

$metastring .= '<meta http-equiv="Content-Language" content="'._LANGCODE.'">'."
"

 
and add a // at the start of that.

PHP:  [ Select all ]

//$metastring .= '<meta http-equiv="Content-Language" content="'._LANGCODE.'">'."
"; 

 
Save & Close

Doing that should validate your site as HTML5, and if you were getting warnings on the self-closing tags, those should just switch to "info" warning you that if the attributes that precede the / aren't wrapped in quotes, it could cause issues.

For example:

Bad:

Code: [ Select all ]

<img alt=Logo src=./logo.png/>


Good:

Code: [ Select all ]

<img alt="Logo" src="./logo.png"/>


I hope that clarifies the confusing matter of the trailing forward slashes, (/). I know when I was first learning about it, it was confusing and many of the sites did not clarify it very well.


Expand
Tue May 16, 2023 7:45 am
Nuke Dev / Coder
101 Posts
Lonestar
Currently Offline
Offline

Most Played:
This week: 98.7hrs.
Total Played: 499hrs.


  
There is life outside of the game.
Reputation: 769.7
Please be aware when doing this though, If the theme is not coded correctly, by this I mean, If the images have not had their sizes specified or their containers, the theme will not look right, You will see large gaps between image sets.

We will be changing the way theme are integrated in the near future, You will be able to specify the "doctype" directly from theme files, Like it should have been from the start.


Expand
Tue May 16, 2023 11:04 am
NOOB!!!
9 Posts
Reputation: 34.5
Is there any way of testing/checking to see if it is compliant after the edits?
Wed May 17, 2023 6:13 am
Nuke Dev / Coder
101 Posts
Lonestar
Currently Offline
Offline

Most Played:
This week: 98.7hrs.
Total Played: 499hrs.


  
There is life outside of the game.
Reputation: 769.7
Not really, You would just have to change the doctype, refresh the page and take a look, only real way to know for sure if edits are needed.


 
Wed May 17, 2023 7:08 am
NOOB!!!
9 Posts
Reputation: 34.5
— Lonestar wrote
Not really, You would just have to change the doctype, refresh the page and take a look, only real way to know for sure if edits are needed.


Okay, Everything seems fine right now. I'm just not sure what you mean by "change the doctype"

Thanks for the reply  cool


 
Fri May 19, 2023 4:57 am
Nuke Dev / Coder
101 Posts
Lonestar
Currently Offline
Offline

Most Played:
This week: 98.7hrs.
Total Played: 499hrs.


  
There is life outside of the game.
Reputation: 769.7
coRpSE first message in this thread, shows you how to change the doctype of your site.


 
Fri May 19, 2023 6:04 am
NOOB!!!
9 Posts
Reputation: 34.5
— Lonestar wrote
coRpSE fiest message in this thread, shows you how to change the doctype of you site.


Yes, I saw that and did all the changes. I misunderstood and thought there was another setting I had to do.

Thanks for all the information and replies.  cool


 
Fri May 26, 2023 1:32 pm
Spammer
117 Posts
Reputation: 247.5
— UTBaDaSS wrote
— Lonestar wrote
coRpSE fiest message in this thread, shows you how to change the doctype of you site.


Yes, I saw that and did all the changes. I misunderstood and thought there was another setting I had to do.

Thanks for all the information and replies.  cool


This is for your site setting only for doctype as Lonestar and CoRpSE indicated. Any theme(s) being used (as Lonestar said) will have to be made in compliance with HTML 5, or you will see the error(s) in some shape or form. (IE: large gaps between image sets)


Expand
Forums ©