View Full Version : XHTML question...
Saviour
01-17-2009, 05:03 PM
I have the following line of code in a product's XML file and would like to know the proper way to code it, since the way it is now fails XHTML compliancy.
Here's the HTML:
<div class="smallfont" style="float: right" style="font-style: italic;">
Any help is greatly appreciated.
Lynne
01-17-2009, 05:16 PM
Perhaps:
<div class="smallfont" style="float:right; font-style:italic;">
Saviour
01-17-2009, 05:25 PM
Thanks Lynne...I can always count on you, but aren't you missing some spaces in your coding? Just want to make sure...
Lynne
01-17-2009, 05:28 PM
You may add in a space if you want. I don't think it really matters.
Saviour
01-17-2009, 06:02 PM
Thanks, Lynne...
You're one of the best!
I've got 136 errors down to just 89, but from there...I'm totally "clueless".
Lynne
01-17-2009, 06:16 PM
Usually the validator spits out the reason. And, very often one little error on your page will give several errors on a validator. So, just take them one at a time and you'll see progress.
Saviour
01-17-2009, 06:27 PM
Unfortunately, I'm not really that skilled. Even though I can get the general idea...and I do happen to fix some of the issues, most of the time, on my own.
However, reading the reasons the validator gives is based on the source code for that particular page. What I find to be the hardest part is determining whether the errors are being caused by the product's xml file...or if it's being caused by a template within that product.
That's why...at this particular juncture...I'm stuck.
I do agree, however, that one issue can cause several. I just wish I had someone sitting next to me who knows what they're doing. Care to come over and fix this for me?:D
--------------- Added 1232229018 at 1232229018 ---------------
Guess I can take that as a "no", huh?;)
Dismounted
01-18-2009, 03:32 AM
However, reading the reasons the validator gives is based on the source code for that particular page. What I find to be the hardest part is determining whether the errors are being caused by the product's xml file...or if it's being caused by a template within that product.
All HTML should be inside templates, and none should in plugins/files/etc. Make sure you have enabled template commenting in the Admin CP (vBulletin Options > General Settings, IIRC). This will allow you to easily pinpoint which template is causing the error.
Saviour
01-18-2009, 05:48 AM
Dismounted...
Thanks for the tip...I'm down to just 37 errors. However, I'm stuck. Is there any way I can provide you with the source code and you tell me where to look?
I've enable the setting as you previously mentioned...and it does show the templates, but the very first validation error has me stumped.
Thanks for all of your help everyone...really...much appreciated.
Dismounted
01-18-2009, 09:46 AM
Please post a link to the page you are validating.
Saviour
01-18-2009, 10:15 AM
Here ya go: http://www.glitchpc.com/forums/c_news_letter.php
Dismounted
01-18-2009, 11:00 AM
I get a 404 on that page.
Saviour
01-18-2009, 12:26 PM
Sorry, Dismounted...
Here ya go, again: http://www.glitchpc.com/forums/c_news_letter.php
Lynne
01-18-2009, 03:14 PM
Grab the source code for your page and throw it into a text editor. Then, search for the lines the validator is having problems with. The first one "</tr><tr>" shows me right away the problem. I'll post the code above it:
<tr>
<td class="alt1" style="padding: 0px;">
<table cellpadding="6" cellspacing="1" width="100%" border="0">
<!-- BEGIN TEMPLATE: c_news_letter_latest_memberbit -->
</tr><tr>
<td class="alt1" align="center">
<img src="http://glitchpc.com/forums/images/misc/c_news_letter_noav.gif" alt="" />
<div class="smallfont"><a href="http://glitchpc.com/forums/member.php?u=29">tolson7761</a></div>
Then look at the code..... you've put "</tr><tr>" in an invalid place. You ended a row when you never started one.
Just keep doing a search for the lines it doesn't like.
Saviour
01-18-2009, 03:56 PM
Lynne...
Thanks for that information, but the coder of this modification has that </tr><tr> within an "if statement" of one of the templates:
<if condition="$latest_members_count%3 == '1'"></tr><tr></if>
<td class="$bgclass" align="center">
<if condition="$vboptions[c_news_letter_show_avatar]">
<img src="$member[avatarurl]" alt="" />
</if>
<div class="smallfont"><a href="$vboptions[bburl]/member.php?u=$member[userid]">$member[username]</a></div>
</td>
No matter what I do there...it breaks the newsletter. I'm tellin' ya. I think I've lost about all my hair on this one. I'm trying, though...and really do appreciate your help.
Lynne
01-18-2009, 03:59 PM
Then change the lines in the template above it. Or, change the modification. I can't think of any modification I have installed that I haven't changed in some way to work the way I want it to work on my site.
Saviour
01-18-2009, 04:50 PM
I'm sorry...but I'm truly lost on this one...
Unless someone can take me by the hand and guide me step-by-step through these edits...I'm afraid I may have to call it quits.
Seriously though...I really appreciate the help...and even though you see the word "Coder" under my username...don't take it "verbatim". I'm really not that good...if at all.
So just generalizing an answer, may be good for some...it's not helping me in the least.
Dismounted
01-19-2009, 03:23 AM
Find:
<if condition="$latest_members_count%3 == '1'"></tr><tr></if>
Replace With:
<if condition="!isset($called) AND $called = true"><tr><else /><if condition="$latest_members_count % 3 == 1"></tr><tr></if></if>
Dirty hack job, but should work.
Saviour
01-19-2009, 12:55 PM
Thanks, Dismounted...
Tried your code, but the errors jumped from 37 to 45. So, reverted back to the original code...at least, for now.
I'm tellin' ya...this has been a royal PITA...
Saviour
01-21-2009, 12:04 PM
On another note...
I've been told that..."trying to get one's site to validate with W3C compliance is a total waste of time...as long as the code works, why bother?" While others say it's better for several reasons.
Anyone care to comment?
BTW...I've given up on that particular page...for now, anyway. The coder is working on making it compliant.
However, I just added a new style and the forum homepage validates except for one <table> error. I've looked that code up and down and can find nothing wrong with it.
Anyone care to take a stab at it?
Thanks to anyone who replies...
Lynne
01-21-2009, 02:05 PM
I know the pages on my site don't validate correctly, but usually it is usually because I use some property that it doesn't like in a certain tag. If it's a matter of table tags not adding up correctly, I always fix those because otherwise a browser could misinterpret the page and make it all wonky.
Saviour
01-21-2009, 02:26 PM
In my case...I have to get my forum homepage to validate...and it has one error. The error I get is this:
Line 511, Column 7: end tag for "table" which is not finished .
</table>
Most likely, you nested tags and closed them in the wrong order. For example <p><em>...</p> is not acceptable, as <em> must be closed before <p>. Acceptable nesting is: <p><em>...</em></p>
Another possibility is that you used an element which requires a child element that you did not include. Hence the parent element is "not finished", not complete. For instance, in HTML the <head> element must contain a <title> child element, lists (ul, ol, dl) require list items (li, or dt, dd), and so on.
Now...I've taken a look at that code...and for the life of me...can't see where the issue is. I know the problem originates with my FORUMHOME template, but I can't seem to find where the table has not been closed properly.
I've checked the code...yet it's driving me nuts. Hopefully, someone can find the error for me and tell me what to change so I can get this mokey off my back.
Thanks for the reply, Lynne...
Lynne
01-21-2009, 02:37 PM
I just put your homepage into the validator and it passed. I'm just a guest though. So, whatever is causing the problem is something that isn't shown to guests.
Saviour
01-21-2009, 02:40 PM
Are you looking at my homepage...or the forum homepage? It's the forum's homepage that's causing the headaches: http://www.glitchpc.com/forums/index.php
Lynne
01-21-2009, 02:56 PM
I did a quick look through your page source and every </table> tag looked valid to me so I'm not sure what it is talking about. Sorry.
Saviour
01-21-2009, 02:57 PM
Thanks, Lynne...LOL! Now you know the pain I'm going through.
Lynne
01-21-2009, 03:00 PM
Well, as I said, I don't worry about that stuff. Well, sometimes when I'm board, I go try to validate a page, but I don't lose any sleep over it if I'm left with a couple of errors.
Saviour
01-21-2009, 03:48 PM
Well...I have a total of three styles...and this is the only one that doesn't validate, so I'm going to post my FORUMHOME template code here to see if anyone can help me locate the problem.
$stylevar[htmldoctype]
<html xmlns="http://www.w3.org/1999/xhtml" dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<!-- no cache headers -->
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<meta http-equiv="Cache-Control" content="no-cache" />
<!-- end no cache headers -->
$headinclude
<title><phrase 1="$vboptions[bbtitle]">$vbphrase[x_powered_by_vbulletin]</phrase></title>
</head>
<body>
$header
$navbar
<!-- main -->
<if condition="$show['guest']">
<!-- guest welcome message -->
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<thead>
<tr>
<td class="tcat" colspan="<if condition="$vboptions['showmoderatorcolumn']">6<else />5</if>"><phrase 1="$vboptions[bbtitle]">$vbphrase[welcome_to_the_x]</phrase></td>
</tr>
<tr>
<td class="alt1" colspan="<if condition="$vboptions['showmoderatorcolumn']">6<else />5</if>">
<phrase 1="faq.php$session[sessionurl_q]" 2="register.php$session[sessionurl_q]">$vbphrase[first_visit_message]</phrase>
</td>
</tr>
</thead>
</table>
<!-- / guest welcome message -->
<br />
</if>
$forumbits
$forumhome_markread_script
<!-- /main -->
<br />
$ad_location[ad_forumhome_afterforums]
<br />
<!-- what's going on box -->
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<thead>
<tr>
<td class="tcat" colspan="2">$vbphrase[whats_going_on]</td>
</tr>
</thead>
$template_hook[forumhome_wgo_pos1]
<if condition="$show['loggedinusers']">
<!-- logged-in users -->
<tbody>
<tr>
<td class="thead" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_activeusers')"><img id="collapseimg_forumhome_activeusers" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_activeusers].gif" alt="" border="0" /></a>
<a href="online.php$session[sessionurl_q]">$vbphrase[currently_active_users]</a>: $totalonline (<phrase 1="$numberregistered" 2="$numberguest">$vbphrase[x_members_and_y_guests]</phrase>)
</td>
</tr>
</tbody>
<tbody id="collapseobj_forumhome_activeusers" style="$vbcollapse[collapseobj_forumhome_activeusers]">
<tr>
<td class="alt2"><a href="online.php$session[sessionurl_q]"><img src="$stylevar[imgdir_misc]/whos_online.gif" alt="$vbphrase[view_whos_online]" border="0" /></a></td>
<td class="alt1" width="100%">
<div class="smallfont">
<div style="white-space: nowrap"><phrase 1="$recordusers" 2="$recorddate" 3="$recordtime">$vbphrase[most_users_ever_online_was_x_y_at_z]</phrase></div>
<div>$activeusers</div>
</div>
</td>
</tr>
</tbody>
<!-- end logged-in users -->
</if>
$template_hook[forumhome_wgo_pos2]
<tbody>
<tr>
<td class="thead" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_stats')"><img id="collapseimg_forumhome_stats" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_stats].gif" alt="" border="0" /></a>
<phrase 1="$vboptions[bbtitle]">$vbphrase[x_statistics]</phrase>
</td>
</tr>
</tbody>
<tbody id="collapseobj_forumhome_stats" style="$vbcollapse[collapseobj_forumhome_stats]">
<tr>
<td class="alt2"><img src="$stylevar[imgdir_misc]/stats.gif" alt="<phrase 1="$vboptions[bbtitle]">$vbphrase[x_statistics]</phrase>" border="0" /></td>
<td class="alt1" width="100%">
<div class="smallfont">
<div>
$vbphrase[threads]: $totalthreads,
$vbphrase[posts]: $totalposts,
$vbphrase[members]: $numbermembers<if condition="$show['activemembers']">,
<span title="<phrase 1="$vboptions[activememberdays]">$vbphrase[within_the_last_x_days]</phrase>">$vbphrase[active_members]: $activemembers</span>
</if>
</div>
<div><phrase 1="member.php?$session[sessionurl]u=$newuserid" 2="$newusername">$vbphrase[welcome_to_our_newest_member_x]</phrase></div>
$template_hook[forumhome_wgo_stats]
</div>
</td>
</tr>
</tbody>
$template_hook[forumhome_wgo_pos3]
<if condition="$show['birthdays']">
<!-- today's birthdays -->
<tbody>
<tr>
<td class="thead" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_birthdays')"><img id="collapseimg_forumhome_birthdays" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_birthdays].gif" alt="" border="0" /></a>
$vbphrase[todays_birthdays]
</td>
</tr>
</tbody>
<tbody id="collapseobj_forumhome_birthdays" style="$vbcollapse[collapseobj_forumhome_birthdays]">
<tr>
<td class="alt2"><a href="calendar.php?$session[sessionurl]do=getday&day=$today&sb=1"><img src="$stylevar[imgdir_misc]/birthday.gif" alt="$vbphrase[view_birthdays]" border="0" /></a></td>
<td class="alt1" width="100%"><div class="smallfont">$birthdays</div></td>
</tr>
</tbody>
<!-- end today's birthdays -->
</if>
$template_hook[forumhome_wgo_pos4]
<if condition="$show['upcomingevents']">
<tbody>
<tr>
<td class="thead" colspan="2">
<a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_events')"><img id="collapseimg_forumhome_events" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_events].gif" alt="" border="0" /></a>
<if condition="$show['todaysevents']">$vbphrase[todays_events]<else /><phrase 1="$vboptions[showevents]">$vbphrase[upcoming_events_for_the_next_x_days]</phrase></if>
</td>
</tr>
</tbody>
<tbody id="collapseobj_forumhome_events" style="$vbcollapse[collapseobj_forumhome_events]">
<tr>
<td class="alt2"><a href="calendar.php$session[sessionurl_q]"><img src="$stylevar[imgdir_misc]/calendar.gif" alt="$vbphrase[calendar]" border="0" /></a></td>
<td class="alt1" width="100%"><div class="smallfont">$upcomingevents</div></td>
</tr>
</tbody>
</if>
$template_hook[forumhome_wgo_pos5]
<tbody>
<tr>
<td class="alt2" align="center" colspan="<if condition="$vboptions['showmoderatorcolumn']">6<else />5</if>"><div class="smallfont"><strong>
<a href="forumdisplay.php?$session[sessionurl]do=markread">$vbphrase[mark_forums_read]</a>
<if condition="$vboptions['forumleaders']">
<a href="showgroups.php$session[sessionurl_q]">$vbphrase[view_forum_leaders]</a></if>
</strong></div></td>
</tr>
</tbody>
</table>
<br />
<!-- end what's going on box -->
<!-- icons and login code -->
<table cellpadding="0" cellspacing="2" border="0" width="100%">
<tr valign="bottom">
<td>
<table cellpadding="2" cellspacing="0" border="0">
<tr>
<td><img src="$stylevar[imgdir_statusicon]/forum_new.gif" alt="$vbphrase[contains_new_posts]" border="0" /></td>
<td class="smallfont"> $vbphrase[forum_contains_new_posts]</td>
</tr>
<tr>
<td><img src="$stylevar[imgdir_statusicon]/forum_old.gif" alt="$vbphrase[contains_no_new_posts]" border="0" /></td>
<td class="smallfont"> $vbphrase[forum_contains_no_new_posts]</td>
</tr>
<if condition="$vboptions['showlocks']">
<tr>
<td><img src="$stylevar[imgdir_statusicon]/forum_old_lock.gif" alt="$vbphrase[a_closed_forum]" border="0" /></td>
<td class="smallfont"> $vbphrase[forum_is_closed_for_posting]</td>
</tr>
</if>
</table>
</td>
<if condition="!$show['guest']">
<!-- member logout -->
<td align="$stylevar[right]"><a href="login.php?$session[sessionurl]do=logout&logouthash=$bbuserinfo[logouthash]" onclick="return log_out('$vbphrase[sure_you_want_to_log_out]')"><phrase 1="$bbuserinfo[username]">$vbphrase[log_out_x]</phrase></a></td>
<!-- end member logout -->
</if>
</tr>
</table>
<!-- / icons and login code -->
$footer
</body>
</html>
Much thanks to anyone who can solve this for me...
Lynne
01-21-2009, 05:07 PM
Probably your best bet is to compare that template to one of the forumhome templates in the other styles.
Saviour
01-21-2009, 05:55 PM
Lynne...if you were standing next to me...I'd kiss you smack dab on the mouth!:eek:
Removed <thead></thead> from the template and low and behold...SUCCESS!:D
Please let me know if there's anything I can do for you...within reason, that is...;)
All my best!
Steve
Lynne
01-21-2009, 07:18 PM
Lynne <-- will work for kisses :D
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.