Page 1 of 2
serendipity_event_backup.php (small) output error
Posted: Tue Aug 29, 2006 11:10 pm
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?
Posted: Tue Aug 29, 2006 11:20 pm
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?
Posted: Wed Aug 30, 2006 12:49 am
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?
Posted: Wed Aug 30, 2006 12:56 am
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.
Posted: Wed Aug 30, 2006 8:02 am
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!
Posted: Wed Aug 30, 2006 12:55 pm
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
Posted: Wed Aug 30, 2006 6:46 pm
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;
Posted: Wed Aug 30, 2006 6:55 pm
by hgoor
Ok, I can confirm: the code above works and now my blog validates 100%
This Page Is Valid XHTML 1.0 Transitional!
Posted: Wed Aug 30, 2006 7:07 pm
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!)
Posted: Wed Aug 30, 2006 7:13 pm
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..
Posted: Wed Aug 30, 2006 8:48 pm
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!

Posted: Wed Aug 30, 2006 11:31 pm
by mgroeninger
Progress!

Posted: Wed Aug 30, 2006 11:36 pm
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
Posted: Wed Aug 30, 2006 11:42 pm
by mgroeninger
I think then a blank alt makes more sense...
*grin* See what I mean about not knowing html/xhtml?
Garvin, do you want to change it or should I?
Posted: Wed Aug 30, 2006 11:44 pm
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...