Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-18-2007, 01:33 AM
Goat Boy Goat Boy is offline
 
Join Date: Mar 2003
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Need help with validating this short bit of code

A few months back I was askied if I could help out managing vbulletin for a website. This site was created 2~3 years ago and when I check the XHTML validation there were many errors. I have read and read and fixed up many of the error in which I have it down to 4 which lie in the header and footer. This was a custom template for the site.

Just wondering if someone can look at this code to see if anything sticks out as incorrect, I am stuggling with getting this to validate

PHP Code:
<table background="http://www.cmoc.ca/images/forum/mainbg.jpg" cellspacing=0 cellpadding=0  align="center" width="760" alt="Ford Mustang Canada"
The main errors are:

there is no attribute "background"
an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified
there is no attribute "alt"


Hopefully this is enough information.
Thanks
Reply With Quote
  #2  
Old 02-18-2007, 01:41 AM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

-Wrap your cellpadding and cellspacing values in double quotes.
-Replace background="X" with style="background: X"
-Replace alt attribute with summary attribute

The rest should be OK for XHTML transitional.
Reply With Quote
  #3  
Old 02-18-2007, 01:48 AM
da420 da420 is offline
 
Join Date: Nov 2005
Posts: 1,232
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

HTML Code:
<table bgcolor="http://www.cmoc.ca/images/forum/mainbg.jpg" cellspacing=0 cellpadding=0  align="center" width="760" SUMMARY="Ford Mustang Canada">
Try that.
Reply With Quote
  #4  
Old 02-18-2007, 02:14 AM
Goat Boy Goat Boy is offline
 
Join Date: Mar 2003
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for your help guys, almost there.

I can't believe I missed the quotes since I found them missing earlier in the footer

The only problem I have now is this
Replace background="X" with style="background: X"

Just to explain what happens it seem the jpg in the original code gets stretched to fill part of the header in the height, when I change it to the code suggested it passes the XHTML but the jpg does not get streched

One bit of code that follows the code I posted above that may give a clue is this

<tr valign="top"><td>


da420 when using bgcolor that code it fills it with a color instead of the jpg
Reply With Quote
  #5  
Old 02-18-2007, 03:11 AM
Kungfu Kungfu is offline
 
Join Date: Dec 2005
Posts: 242
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<a href="http://www.w3schools.com/css/css_background.asp" target="_blank">http://www.w3schools.com/css/css_background.asp</a>

but to strech youll need something like css
background: #0A0B0C url(/images/bg.jpg) top left repeat-x;

that may work as it is. or you can do something like
background-image: url(/images/bg.jpg);
background-repeat: repeat-x;
etc..
Reply With Quote
  #6  
Old 02-18-2007, 03:24 AM
Adrian Schneider's Avatar
Adrian Schneider Adrian Schneider is offline
 
Join Date: Jul 2004
Posts: 2,528
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oops, forgot the url() bit, thought that was obvious.
Reply With Quote
  #7  
Old 02-19-2007, 02:30 AM
Goat Boy Goat Boy is offline
 
Join Date: Mar 2003
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for your help guys, got it all fixed up
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:15 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09414 seconds
  • Memory Usage 2,221KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_html
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete