serendipity_event_backup.php (small) output error

Creating and modifying plugins.
hgoor
Regular
Posts: 297
Joined: Thu Jan 06, 2005 11:46 am

serendipity_event_backup.php (small) output error

Post by hgoor »

Hi,

I have been able to almost validate my blog 100% in accordance with W3C rules by eliminating plugins with wrong output and cleaning up my own messy HTML blobs.

When I now validate my blog I only get 2 errors.

They are related to something I see in the code, but I have NO clue where it comes from??

Code: Select all

<img src="http://zion.demon.nl/plugin/checkautobackup" width="1" height="1" border="0"> 
The code misses the required "ALT" attribute and the closing tag />

Can anyone point me to where I can get this fixed?
Last edited by hgoor on Tue Aug 29, 2006 11:27 pm, edited 1 time in total.
"If life is worth living, it's worth documenting" -- Adam Curry ("Podfather")

Bloggers@large: http://www.vandegoor.com
iLounge Radio: http://www.hostingperfect.net:8004/listen.pls
hgoor
Regular
Posts: 297
Joined: Thu Jan 06, 2005 11:46 am

Post by hgoor »

I think I found the problem: its in a plugin called

serendipity_event_backup.php

Since I have no knowlegde of PHP: what do I need to change to the following code to have it have the required ALT tag and /> ?

Code: Select all

case 'frontend_footer':
					echo "<img src=\"".$serendipity['baseURL'] . ($serendipity['rewrite'] == "none" ? $serendipity['indexFile'] . "?/" : "") . "plugin/checkautobackup\" width=\"1\" height=\"1\" border=\"0\">";
					break;
Thanks!

ps: btw what does this do?? Is it part of the backup interface plugin? If so what does this do in the front-end? Though that was a back-end plugin only?
"If life is worth living, it's worth documenting" -- Adam Curry ("Podfather")

Bloggers@large: http://www.vandegoor.com
iLounge Radio: http://www.hostingperfect.net:8004/listen.pls
mgroeninger
Regular
Posts: 546
Joined: Mon Dec 20, 2004 11:57 pm
Contact:

Post by mgroeninger »

Changing the echo command like this should add the alt tag:

Code: Select all

               echo "<img src=\"".$serendipity['baseURL'] . ($serendipity['rewrite'] == "none" ? $serendipity['indexFile'] . "?/" : "") . "plugin/checkautobackup\" width=\"1\" height=\"1\" border=\"0\" alt=\"\">";
Would you mind giving it a try? If that works I can change the plugin in CVS.
As to what it is doing, I have no idea... (I don't use the backup plugin)

What does the image look like?
mgroeninger
Regular
Posts: 546
Joined: Mon Dec 20, 2004 11:57 pm
Contact:

Post by mgroeninger »

Ok, I based on the size of the image and a quick glance at the code the plugin is using a call to an image to run updates (so you don't have to remember to run updates manually in the backend.

checkautobackup runs these functions:

Code: Select all

                        	$this->CheckAutoSQLBackup();
                        	$this->CheckAutoDelSQLBackup();
                        	$this->CheckAutoHTMLBackup();
                        	$this->CheckAutoDelHTMLBackup();
Which seem to be pretty well named.
hgoor
Regular
Posts: 297
Joined: Thu Jan 06, 2005 11:46 am

Post by hgoor »

mgroeninger wrote:Ok, I based on the size of the image and a quick glance at the code the plugin is using a call to an image to run updates (so you don't have to remember to run updates manually in the backend.

checkautobackup runs these functions:

Code: Select all

                        	$this->CheckAutoSQLBackup();
                        	$this->CheckAutoDelSQLBackup();
                        	$this->CheckAutoHTMLBackup();
                        	$this->CheckAutoDelHTMLBackup();
Which seem to be pretty well named.
Ah ok: so instead of running a cron job it triggers the function based on if anyone visits your site...

Nifty!
"If life is worth living, it's worth documenting" -- Adam Curry ("Podfather")

Bloggers@large: http://www.vandegoor.com
iLounge Radio: http://www.hostingperfect.net:8004/listen.pls
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Thanks for notiung that. The backup and forum plugins are two of the most complex plugins not done by me, bearing the worst code formatting and the worst HTML output of all plugins I know ;)

But still the plugin works, and only because of code formatting and HTML output I did not want to block this plugin. But since the plugins are very complex and very large, I have no time to go through them fully.

I fixed that <img> bug in the backup plugin right now.

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
hgoor
Regular
Posts: 297
Joined: Thu Jan 06, 2005 11:46 am

Post by hgoor »

garvinhicking wrote:Hi!

Thanks for notiung that. The backup and forum plugins are two of the most complex plugins not done by me, bearing the worst code formatting and the worst HTML output of all plugins I know ;)
Sorry... It's not fixed yet...
Error Line 573 column 97: required attribute "alt" not specified.
...="1" height="1" style="border: 0px" />

The attribute given above is required for an element that you've used, but you have omitted it. For instance, in most HTML and XHTML document types the "type" attribute is required on the "script" element and the "alt" attribute is required for the "img" element.

Typical values for type are type="text/css" for <style> and type="text/javascript" for <script>.
It should be:

Code: Select all

<img src="http://zion.demon.nl/plugin/checkautobackup" width="1" height="1" border="0" alt="check auto back-up" />
Note the required alt=""

I'm not a programmer, but would this work?

Code: Select all

case 'frontend_footer':
                    echo "<img src="".$serendipity['baseURL'] . ($serendipity['rewrite'] == "none" ? $serendipity['indexFile'] . "?/" : "") . "plugin/checkautobackup" width="1" height="1" border="0" alt="checkautobackup" />";
                    break; 
"If life is worth living, it's worth documenting" -- Adam Curry ("Podfather")

Bloggers@large: http://www.vandegoor.com
iLounge Radio: http://www.hostingperfect.net:8004/listen.pls
hgoor
Regular
Posts: 297
Joined: Thu Jan 06, 2005 11:46 am

Post by hgoor »

Ok, I can confirm: the code above works and now my blog validates 100%

This Page Is Valid XHTML 1.0 Transitional!
"If life is worth living, it's worth documenting" -- Adam Curry ("Podfather")

Bloggers@large: http://www.vandegoor.com
iLounge Radio: http://www.hostingperfect.net:8004/listen.pls
mgroeninger
Regular
Posts: 546
Joined: Mon Dec 20, 2004 11:57 pm
Contact:

Post by mgroeninger »

Yes, that is equivelent (the alt tag is just not empty) to what I posted earlier...

However, Garvin also made another change to the html:

Code: Select all

				case 'frontend_footer':
					echo "<img src=\"".$serendipity['baseURL'] . ($serendipity['rewrite'] == "none" ? $serendipity['indexFile'] . "?/" : "") . "plugin/checkautobackup\" width=\"1\" height=\"1\" style=\"border: 0px\" />";
					break;
The new code uses a style tag rather than the border tag.

Could you test this? I am sure Garvin will submit this patch once he has a chance.

Code: Select all

				case 'frontend_footer':
					echo "<img src=\"".$serendipity['baseURL'] . ($serendipity['rewrite'] == "none" ? $serendipity['indexFile'] . "?/" : "") . "plugin/checkautobackup\" width=\"1\" height=\"1\" style=\"border: 0px\"  alt=\"checkautobackup\">";
					break;
Glad your page is all valid! (And that the plugins you are using are getting updated!)
mgroeninger
Regular
Posts: 546
Joined: Mon Dec 20, 2004 11:57 pm
Contact:

Post by mgroeninger »

Well, since I don't see Garvin online right now I just submitted the patch myself...

It should be updated in CVS... if you can check the code I posted above (or the cvs version) I would appreciate it..
hgoor
Regular
Posts: 297
Joined: Thu Jan 06, 2005 11:46 am

Post by hgoor »

mgroeninger wrote:Well, since I don't see Garvin online right now I just submitted the patch myself...

It should be updated in CVS... if you can check the code I posted above (or the cvs version) I would appreciate it..
Downloaded, uploaded, checked and validates in W3C.

So we can put a bagdge on this one for being Valid XHTML 1.0 Transitional.

Next!

:D
"If life is worth living, it's worth documenting" -- Adam Curry ("Podfather")

Bloggers@large: http://www.vandegoor.com
iLounge Radio: http://www.hostingperfect.net:8004/listen.pls
mgroeninger
Regular
Posts: 546
Joined: Mon Dec 20, 2004 11:57 pm
Contact:

Post by mgroeninger »

Progress! :D
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Actually, having alt="checkautobackup" will put that word on a blog. Look at http://zion.demon.nl/archives/P2.html, bottom of the page. So using alt="" would IMHO be more appropriate?

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
mgroeninger
Regular
Posts: 546
Joined: Mon Dec 20, 2004 11:57 pm
Contact:

Post by mgroeninger »

I think then a blank alt makes more sense...
*grin* See what I mean about not knowing html/xhtml? :D

Garvin, do you want to change it or should I?
hgoor
Regular
Posts: 297
Joined: Thu Jan 06, 2005 11:46 am

Post by hgoor »

garvinhicking wrote:Hi!

Actually, having alt="checkautobackup" will put that word on a blog. Look at http://zion.demon.nl/archives/P2.html, bottom of the page. So using alt="" would IMHO be more appropriate?

Best regards,
Garvin
Hmm, of course it can be empty right... But it doesn't show up unless you look at the source.

Also: it identifies what the heck it is....

I don't care: it at least doesn't invalidates the code...
"If life is worth living, it's worth documenting" -- Adam Curry ("Podfather")

Bloggers@large: http://www.vandegoor.com
iLounge Radio: http://www.hostingperfect.net:8004/listen.pls
Post Reply