1
jph000
WF-Links 1.06 XHTML Validation
  • 2009/2/6 0:08

  • jph000

  • Just popping in

  • Posts: 60

  • Since: 2004/8/2 2


My changes to get WF-Links 1.06 to validate for CSS level 2 and XHTML 1.0 Transitional are shown below -- under XOOPS 2.3.2 and PHP5.

WF-Links 1.06 Module

wflinks_index.html (template)

OLD

<tr>
<td colspan="2">&nbsp;</td>
<tr>
</table>

NEW - simple change removed 13 errors!

<tr>
<td colspan="2">&nbsp;</td>
</tr>
</table>

As to an error regarding a "link rel=" for a style sheet being outside the head section, the line in question containing that is included via a reference (somewhere) to the wflinks_tag_block_cloud.html file which contains the single line:

<{include file="db:tag_block_cloud.html"}>

and tag_block_cloud.html is a Tag module blocks template, which contains the "link rel=" code in question. Wflinks checks whether the Tag module is activated; so, the block of code in question may or may not be present in the generated html page.

One solution might be to include the "link rel=" separately and earlier -- placed in the head section. But that would couple the code of the two modules -- require modifying the Tag module (to separate the "link rel=" statement from the following div code) and the wf-links module (to use a separate call in the head section). The easy way to eliminate this vaidation error was to deactivate the XOOPS Tag module.

Another problem was in the (English vs. French) admin.php and main.php and modinfo.php files for string values for PageRank and Google PageRank containing invalid byte values for the trademark symbol rather than "& t r a d e ;" string.

wflinks_singlelink.html (template)

NEW
</tr>
</table>
</td></tr>
</table>

OLD
</tr>
</table>
</tr>
</table>

wflinks_linkload.html (template)

NEW
<{/if}>
</table>
</td></tr>

OLD
<{/if}>
</table>
</tr>


wflinks_viewcat.html (template) - ten &'s and "absmiddle" to replace with "& a m p ;" and "middle" -- for example:

OLD
<a href="viewcat.php?cid=<{$category_id}>&orderby=titleA">
<img src="images/up.gif" alt="" align="absmiddle" /></a>
<a href="viewcat.php?cid=<{$category_id}>&orderby=titleD">
<img src="images/down.gif" alt="" align="absmiddle" /></a>

Fixing those lines left 6 validation errors, all were: value of attribute "align" cannot be "absmiddle"; must be one of "top", "middle", "bottom", "left", "right".

2
ghia
Re: WF-Links 1.06 XHTML Validation
  • 2009/2/6 8:46

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Thank you for sharing this!

Some absmiddle are present in:
/admin/admin_header.php
/include/functions.php
/templates/wflinks_singlelink.html
/templates/wflinks_linkload.html
/templates/wflinks_linkloadsimple.html

BTW: I see in your post some templatenames spelled with a dot in between. Should it not be an underline?

3
jph000
Re: WF-Links 1.06 XHTML Validation
  • 2009/2/6 16:58

  • jph000

  • Just popping in

  • Posts: 60

  • Since: 2004/8/2 2


Thanks, ghia. I corrected the template file names in question.

(I am currently working on validation for SmartFAQ 1.0.8, by the way.)

4
jph000
Re: WF-Links 1.06 XHTML Validation - additional edits
  • 2009/2/10 22:18

  • jph000

  • Just popping in

  • Posts: 60

  • Since: 2004/8/2 2


1. templates/wflinks_singlelink.html

Five absmiddle's were replaced with middle.

Lines 1 - 14 inline style (css) block not allowed in body (versus head section) of page. Hmm ... how to relocate or ... Generated code contains the style lines after a "<!-- Start content module page -->" comment.

The 'socbookmark' style only is used in line 88 which only generates HTML code if $link.showsbookmarx > 0 -- that is, if Show Social Bookmarks is set to 'Yes' in the module's config options. Since I had this option set to 'No' the simple solution for validation was to remove the 14 lines in question.

2. templates/wflinks_linkload.html

Four absmiddle's were replaced with middle.

3, singlelink.php

Line 208 was missing alt attribute.

4. topten.php

For the Popular and Top Rated pages, line 61 was missing alt attribute.

5. include/linkloadinfo.php

Line 145 had simple ampersand for mail body parameter.

2-11-2009 [Some of these fixed in version 1.07.]

templates/wflinks_print.html

OLD

<body>
<script for=window event=onload language="javascript">
window.print();
</script>

<body style="font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 12px;" bgcolor="#ffffff" text="#000000">

NEW

<body style="font-family: Verdana,Arial,Helvetica,sans-serif; font-size: 12px;" bgcolor="#ffffff" text="#000000" onload="window.print()">

Missing </div> tag for line 23.

print.php

Six absmiddle's replaced with middle.

5
McDonald
Re: WF-Links 1.06 XHTML Validation - additional edits
  • 2009/2/11 9:34

  • McDonald

  • Home away from home

  • Posts: 1072

  • Since: 2005/8/15


Quote:
absmiddle's were replaced with middle

Did you compare the difference in your browser(s)?
Validators are very theoretically, I just use my browsers to validate the code.

Latest version is WF-Links 1.07

6
jph000
Re: WF-Links 1.06 XHTML Validation - additional edits
  • 2009/2/11 18:21

  • jph000

  • Just popping in

  • Posts: 60

  • Since: 2004/8/2 2


McDonald, thanks for letting me know that version 1.07 is available. I am not sure what you are asking regarding difference in browser(s). Modern browsers tolerate differences from declared HTML standards. (Using standards compliance mode for my new Web projects, I check for W3C validation with zero errors.)

My standard for HTML / XHTML validation is W3C Markup Validator v0.8.4 (currently). Visual inspection of code confirms whether there is an actual issue, as well as what items later in the error list are cascades from earlier errors.

For example, thanks for noting in your bug history for 1.07 the print fixes. Sometimes I do not validate print features. I just ran W3C Markup Validator on a wflinks 1.06 print.php action and the Validator detected both div and body tag issues you noted in your bug fix list (as well as a <script for=window event=onload language="javascript"> issue which I'll check sometime).

My standard browsers are Firefox, Internet Explorer, Safari, and Opera, by the way.


7
McDonald
Re: WF-Links 1.06 XHTML Validation - additional edits
  • 2009/2/12 11:38

  • McDonald

  • Home away from home

  • Posts: 1072

  • Since: 2005/8/15


If you replace 'absmiddle' with 'middle' you will notice some difference in alignment between text and icons. Look for example at the up/down icons for sorting.
'absmiddle' might not get validated, but it's known by all major browsers and so it will work.

OT.
You might want to test with Google Chrome and see that this browser can't handle <legend>-tags.

8
ghia
Re: WF-Links 1.06 XHTML Validation
  • 2009/2/13 1:05

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Having the validator satisfied will be the best guarantee, that most browsers will show your pages alike. It may limit you by not be able to use some extensions, but true creativity doesn't stop due to limits.

A replacement for absmiddle could be:
IMG.absmiddle vertical-alignmiddlemargin-bottom.25em; }


For Chrome, I would not be to worried. It is just out of beta and its use is very limited. Besides it is up to them to comply to the standards and not to bend the code for them.

@jph000: Thank you for your outstanding work!

@McDonald: I hope we can see quick an update of your module: W3C compliant!

Login

Username:
Password:

Lost Password? Register now!

Who's Online

72 user(s) are online (46 user(s) are browsing Support Forums)


Members: 0


Guests: 72


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits