[DEV] Modernization: XHTML Strict, UTF-8 and prototype.js

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply
User avatar
Merri
Registered User
Posts: 255
Joined: Mon Nov 25, 2002 1:08 pm
Location: Riihimäki, Finland
Contact:

[DEV] Modernization: XHTML Strict, UTF-8 and prototype.js

Post by Merri » Sat Mar 29, 2008 11:56 am

MOD Title: XHTML 1.0 Strict, UTF-8 and prototype.js modernization
MOD Description: This MOD replaces the old template base to XHTML 1.0 Strict and UTF-8 compliant base. It also provides tools for modern JavaScript with prototype.js.
MOD Version: Early development / planning phase.

MOD Download: n/a
Last Stable version: n/a

Demo Board: http://kontu.selfip.info/phpBB2/
Demo Username: n/a
Demo Password: n/a


The base idea is modernize the code base of phpBB2 by dumping out the outdated XHTML Transitional code as well as improve i18n by forcing UTF-8. Additionally prototype.js is also provided out-of-the-box thus enabling easy JavaScript development.

Goals
  • Much more options for styling via CSS by removing the tag soup and by restructuring the HTML.
  • Individual IDs to elements where possible to improve CSS and JavaScript usage.
  • Perfect XML compliancy: the forum could be served as application/xhtml+xml without a trouble.
  • Retain compatibility with existing MODs where possible (unfortunatenaly templates will be broken entirely).
  • Provide external JavaScript in an efficient way by packing and compressing (prototype.js is only 21332 bytes this way, without any handling it would be over 100 kB).

Personally I still find phpBB2 a nicer board to develop on thanks to the simplicity when compared to phpBB3 and other forum software, but I've grown a bit weary on the need of doing extra work for UTF-8 as well as being very limited in CSS styling. subSilver isn't a JavaScript designer's dream either. With this MOD I've thought to eliminate this problem, hopefully there are others who are in the need of similar kind of solution.

Currently I'd be interested to hear on what kind of limitations or issues you've detected while developing for phpBB2, as with this MOD many things can be made much easier. The sample board linked above demonstrates some of the ideas that I have, but I may have missed something. Of course the sample board only has an index page at the moment as it is a slow process to rethink a good way to implement things. For example, I haven't yet decided whether I use tables or not in the viewtopic template.

One more thing: should some other MODs be included in a way or another, such as the Multi BBcode? As it is, with prototype.js a lot of the JS can be rewritten thus making JavaScript containing MODs such as Multi BBcode more incompatible and bothersome to install. The main package could contain extensions to some of the most used MODs.

someone101
Registered User
Posts: 62
Joined: Thu Jan 31, 2008 3:37 pm
Contact:

Re: [DEV] Modernization: XHTML Strict, UTF-8 and prototype.js

Post by someone101 » Sun Mar 30, 2008 3:26 am

Merri wrote:MOD Title: XHTML 1.0 Strict, UTF-8 and prototype.js modernization
MOD Description: This MOD replaces the old template base to XHTML 1.0 Strict and UTF-8 compliant base. It also provides tools for modern JavaScript with prototype.js.
MOD Version: Early development / planning phase.

MOD Download: n/a
Last Stable version: n/a

Demo Board: http://kontu.selfip.info/phpBB2/
Demo Username: n/a
Demo Password: n/a


The base idea is modernize the code base of phpBB2 by dumping out the outdated XHTML Transitional code as well as improve i18n by forcing UTF-8. Additionally prototype.js is also provided out-of-the-box thus enabling easy JavaScript development.

Goals
  • Much more options for styling via CSS by removing the tag soup and by restructuring the HTML.
  • Individual IDs to elements where possible to improve CSS and JavaScript usage.
  • Perfect XML compliancy: the forum could be served as application/xhtml+xml without a trouble.
  • Retain compatibility with existing MODs where possible (unfortunatenaly templates will be broken entirely).
  • Provide external JavaScript in an efficient way by packing and compressing (prototype.js is only 21332 bytes this way, without any handling it would be over 100 kB).

Personally I still find phpBB2 a nicer board to develop on thanks to the simplicity when compared to phpBB3 and other forum software, but I've grown a bit weary on the need of doing extra work for UTF-8 as well as being very limited in CSS styling. subSilver isn't a JavaScript designer's dream either. With this MOD I've thought to eliminate this problem, hopefully there are others who are in the need of similar kind of solution.

Currently I'd be interested to hear on what kind of limitations or issues you've detected while developing for phpBB2, as with this MOD many things can be made much easier. The sample board linked above demonstrates some of the ideas that I have, but I may have missed something. Of course the sample board only has an index page at the moment as it is a slow process to rethink a good way to implement things. For example, I haven't yet decided whether I use tables or not in the viewtopic template.

One more thing: should some other MODs be included in a way or another, such as the Multi BBcode? As it is, with prototype.js a lot of the JS can be rewritten thus making JavaScript containing MODs such as Multi BBcode more incompatible and bothersome to install. The main package could contain extensions to some of the most used MODs.
Hahahaha nice demo board! lol
Template->make_filename(): Error - file viewforum_body.tpl does not exist

User avatar
Merri
Registered User
Posts: 255
Joined: Mon Nov 25, 2002 1:08 pm
Location: Riihimäki, Finland
Contact:

Re: [DEV] Modernization: XHTML Strict, UTF-8 and prototype.js

Post by Merri » Sun Mar 30, 2008 10:42 am

As I said:
Merri wrote:Of course the sample board only has an index page at the moment
:roll:

User avatar
Dog Cow
Registered User
Posts: 2494
Joined: Fri Jan 28, 2005 12:14 am
Contact:

Re: [DEV] Modernization: XHTML Strict, UTF-8 and prototype.js

Post by Dog Cow » Tue Apr 01, 2008 9:42 pm

I like what you've done so far. I personally have some plans to convert my site to UTf-8, and from what I've discovered, it's as easy as changing some database table types, and editing the lang file.
Moof!
Mac GUI Vault: Retro Apple II & Macintosh computing archive.
Inside Allerton bookMac GUIMac 512K Blog

User avatar
Dogs and things
Registered User
Posts: 2114
Joined: Fri Sep 01, 2006 9:04 am
Location: Spain
Contact:

Re: [DEV] Modernization: XHTML Strict, UTF-8 and prototype.js

Post by Dogs and things » Tue Apr 01, 2008 11:13 pm

It´s looking really good and your's is a very sensible proyect.

Because let´s be honest, the standard code that makes the looks of phpBB2 is, let me say, quite messy.

It´ll cost you a lot of work to turn all that soup into decent modern day markup.

I'd be very interested in having an XHTML Strict validating phpBB2 board. The problem is that when I started with my board I didn´t have the slightest idea about this kind of things, welll, honestly speaking, I had no idea about anything website related.

By now I know a lot more but, As it stands, I have a board with loads of MODs built in and I´m afraid there´s no way I´ll be able to change all those MODs to a new XHTML Strict board.

Allthough I definitily will give it a good try if you manage to come up with a good final release of your work.

Good luck on your mission. ;)
For phpBB2 support visit phpBB2refugees.

User avatar
Merri
Registered User
Posts: 255
Joined: Mon Nov 25, 2002 1:08 pm
Location: Riihimäki, Finland
Contact:

Re: [DEV] Modernization: XHTML Strict, UTF-8 and prototype.js

Post by Merri » Wed Apr 02, 2008 10:46 pm

Thanks for the words :)

Dog Cow: The UTF-8 issue isn't as easy as one might think. When you only modify the character set you are very likely to end up with a database where data is saved as double encoded UTF-8. So you'd also need to change the database connection to be UTF-8. Currently I haven't really taken a look into how this works, but I have noticed that my current databases have "corrupted" with double encoded UTF-8. This is very easy to notice with the alphabetical order in which data is retrieved: any non A-Z alphabets are sorted incorrectly and I get partially invalid results when doing searches. When you set the encoding in the tables you mostly change the sorting rules - at least in MySQL, which stores data in character sets instead of being based to Unicode, which would eliminate this problem. Wished we already had much better Unicode aware PHP and MySQL so nobody ever needed to think about encodings again. For now, I want to find out what is the proper way to handle UTF-8 so other didn't need to think about it as much and that nobody had any major complaints. Guess I should have a little look on how phpBB3 handles the issue.


Dogs and things: yeah, existing MODs are a problem. For most of them you have to rewrite the HTML portion again using the new clean XHTML syntax. This would mean I'd have to figure out design options so that this would be as easy as possible. Some MODs can also break due to changes to the PHP files. One of the problems is that it may mean that I'd need to come up with guidelines on how the XHTML should be written, like, when to use IDs, how forms should be made etc. - but this would of course become more of a problem if this MOD started to gain real interest and popularity.

The role of JavaScript is one problem. If I followed the good way to do things, I'd make JavaScript unobtrusive. The biggest issues are that many don't know how to use and code unobtrusive JavaScript, or how to handle browsers' leaking memory issues (which are introduced with most of the addEvent solutions if not all of them) and so on... so currently this has made me end up with traditional JavaScript usage, mixed in the XHTML. Luckily this shouldn't break the validation or well formed XML. I know XHTML and CSS very well, but JavaScript is still a newer area to me in comparison, which is why I'm still looking for the best way to do things.


I think too much!

Post Reply

Return to “[2.0.x] MODs in Development”