[HTML/PHP] Zoek de fout

Pagina: 1
Acties:
  • 465 views sinds 30-01-2008
  • Reageer

  • quakerix
  • Registratie: Februari 2003
  • Laatst online: 29-11 13:44
Beste tweakers,

Allereerst, ik gebruike Firefox, laatste versie. En ben druk bezig met m'n CMS. En ik kom deze weirde fout tegen. Ben ik nou blind? of is dit een random-render fout? Ik weet het niet meer. Ik hoop dat ik gewoon dom ben en dat jullie zeggen: EY kijk dit is. En dat ik weer kan zeggen "oohh", stom stom.

succes..

Zie screenshot wat het probleem is: screenshot 1 en screenshot 2

Je kan duidelijk zien op de screenshots dat wanneer er een "rood" plaatje staat in de kolom status dat de regel hoogte goed is. Maar zodra er een groen plaatje is dat de regel hoogte verkeerd is en dat het plaatje aan de bovenkant zit.

Dit probleem komt 'random' voor. 1 op de 10 keer bijvoorbeeld. En voor m'n gevoel komt dit probleem vaak (of alleen maar) tevoorschijn als je bijv. 'terug' gaat naar een pagina waar je net vandaan komt. Of dit nou met back gebeurd of dat de site het doet.

Als je de code bekijkt, moet er dus op de 1 of andere manier een verschil zitten tussen het plaatje resolved.png en unresolved.png. Beide zijn trouwens 7pxl groot en op de kleur na zover ik weet identiek hetzelfde. Dus ook qua grootte etc.

Hier de HTML code (ik heb alleen even paar enters weg gehaald om het wat overzichtelijker te maken):

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<table id='table-admin' class='text-default' border='1'><tr><td id='table-admin-tr-header' class='text-header' colspan='5'>Admin Modules</td></tr>      <tr id="table-admin-tr-header2"><td style="text-align: center; width: 30px;">ID</td><td>Name</td><td style="text-align: center; width: 75px;">Version</td><td style="text-align: center; width: 75px;">Status</td><td style="text-align: center; width: 75px;">Options</td></tr>
        <tr><td colspan="5">&nbsp;</td></tr>
        <tr onMouseOver="this.style.backgroundColor='#acf88c'" onMouseOut="this.style.backgroundColor='#ffffff'">
            <td align="center" onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=1'>1</td>
            <td onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=1'>News</td>
            <td align="center" onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=1'>4.0</td>
            <td align="center"><img alt="Status" border="0" src="websites/admin-panel/images/resolved.png"></td>
            <td align="center"><a href="javascript:bevestig('Are%20you%20sure%20to%20delete%20this%20item?','?site_id=2&page=admin_Modules&action=delete&id=1')"><img border="0" height="10" src="websites/admin-panel/images/delete.png" alt="Delete"></a> <a href="?site_id=2&page=admin_Modules&action=edit&id=1"><img height="10" border="0" src="websites/admin-panel/images/edit.png" alt="Edit"></a></td>
        </tr>
        <tr onMouseOver="this.style.backgroundColor='#acf88c'" onMouseOut="this.style.backgroundColor='#ffffff'">
            <td align="center" onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=8'>8</td>
            <td onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=8'>Login</td>
            <td align="center" onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=8'>4.0</td>
            <td align="center"><img alt="Status" border="0" src="websites/admin-panel/images/unresolved.png"></td>
            <td align="center"><a href="javascript:bevestig('Are%20you%20sure%20to%20delete%20this%20item?','?site_id=2&page=admin_Modules&action=delete&id=8')"><img border="0" height="10" src="websites/admin-panel/images/delete.png" alt="Delete"></a> <a href="?site_id=2&page=admin_Modules&action=edit&id=8"><img height="10" border="0" src="websites/admin-panel/images/edit.png" alt="Edit"></a></td>
        </tr>
        <tr onMouseOver="this.style.backgroundColor='#acf88c'" onMouseOut="this.style.backgroundColor='#ffffff'">
            <td align="center" onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=9'>9</td>
            <td onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=9'>Project</td>
            <td align="center" onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=9'>4.0</td>
            <td align="center"><img alt="Status" border="0" src="websites/admin-panel/images/resolved.png"></td>
            <td align="center"><a href="javascript:bevestig('Are%20you%20sure%20to%20delete%20this%20item?','?site_id=2&page=admin_Modules&action=delete&id=9')"><img border="0" height="10" src="websites/admin-panel/images/delete.png" alt="Delete"></a> <a href="?site_id=2&page=admin_Modules&action=edit&id=9"><img height="10" border="0" src="websites/admin-panel/images/edit.png" alt="Edit"></a></td>
        </tr>
        <tr onMouseOver="this.style.backgroundColor='#acf88c'" onMouseOut="this.style.backgroundColor='#ffffff'">
            <td align="center" onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=10'>10</td>
            <td onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=10'>User</td>
            <td align="center" onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=10'>4.0</td>
            <td align="center"><img alt="Status" border="0" src="websites/admin-panel/images/resolved.png"></td>
            <td align="center"><a href="javascript:bevestig('Are%20you%20sure%20to%20delete%20this%20item?','?site_id=2&page=admin_Modules&action=delete&id=10')"><img border="0" height="10" src="websites/admin-panel/images/delete.png" alt="Delete"></a> <a href="?site_id=2&page=admin_Modules&action=edit&id=10"><img height="10" border="0" src="websites/admin-panel/images/edit.png" alt="Edit"></a></td>
        </tr>
        <tr onMouseOver="this.style.backgroundColor='#acf88c'" onMouseOut="this.style.backgroundColor='#ffffff'">
            <td align="center" onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=11'>11</td>
            <td onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=11'>NewsCategory</td>
            <td align="center" onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=11'>4.0</td>
            <td align="center"><img alt="Status" border="0" src="websites/admin-panel/images/resolved.png"></td>
            <td align="center"><a href="javascript:bevestig('Are%20you%20sure%20to%20delete%20this%20item?','?site_id=2&page=admin_Modules&action=delete&id=11')"><img border="0" height="10" src="websites/admin-panel/images/delete.png" alt="Delete"></a> <a href="?site_id=2&page=admin_Modules&action=edit&id=11"><img height="10" border="0" src="websites/admin-panel/images/edit.png" alt="Edit"></a></td>
        </tr>
        <tr onMouseOver="this.style.backgroundColor='#acf88c'" onMouseOut="this.style.backgroundColor='#ffffff'">
            <td align="center" onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=12'>12</td>
            <td onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=12'>RSSreader</td>
            <td align="center" onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=12'>1.0</td>
            <td align="center"><img alt="Status" border="0" src="websites/admin-panel/images/unresolved.png"></td>
            <td align="center"><a href="javascript:bevestig('Are%20you%20sure%20to%20delete%20this%20item?','?site_id=2&page=admin_Modules&action=delete&id=12')"><img border="0" height="10" src="websites/admin-panel/images/delete.png" alt="Delete"></a> <a href="?site_id=2&page=admin_Modules&action=edit&id=12"><img height="10" border="0" src="websites/admin-panel/images/edit.png" alt="Edit"></a></td>
        </tr>
        <tr onMouseOver="this.style.backgroundColor='#acf88c'" onMouseOut="this.style.backgroundColor='#ffffff'">
            <td align="center" onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=13'>13</td>
            <td onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=13'>MenuItem</td>
            <td align="center" onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=13'>4.0</td>
            <td align="center"><img alt="Status" border="0" src="websites/admin-panel/images/resolved.png"></td>
            <td align="center"><a href="javascript:bevestig('Are%20you%20sure%20to%20delete%20this%20item?','?site_id=2&page=admin_Modules&action=delete&id=13')"><img border="0" height="10" src="websites/admin-panel/images/delete.png" alt="Delete"></a> <a href="?site_id=2&page=admin_Modules&action=edit&id=13"><img height="10" border="0" src="websites/admin-panel/images/edit.png" alt="Edit"></a></td>
        </tr>
        <tr onMouseOver="this.style.backgroundColor='#acf88c'" onMouseOut="this.style.backgroundColor='#ffffff'">
            <td align="center" onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=14'>14</td>
            <td onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=14'>Comment</td>
            <td align="center" onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=14'>1.0</td>
            <td align="center"><img alt="Status" border="0" src="websites/admin-panel/images/unresolved.png"></td>
            <td align="center"><a href="javascript:bevestig('Are%20you%20sure%20to%20delete%20this%20item?','?site_id=2&page=admin_Modules&action=delete&id=14')"><img border="0" height="10" src="websites/admin-panel/images/delete.png" alt="Delete"></a> <a href="?site_id=2&page=admin_Modules&action=edit&id=14"><img height="10" border="0" src="websites/admin-panel/images/edit.png" alt="Edit"></a></td>
        </tr>
        <tr onMouseOver="this.style.backgroundColor='#acf88c'" onMouseOut="this.style.backgroundColor='#ffffff'">
            <td align="center" onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=15'>15</td>
            <td onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=15'>File</td>
            <td align="center" onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=15'>4.0</td>
            <td align="center"><img alt="Status" border="0" src="websites/admin-panel/images/resolved.png"></td>
            <td align="center"><a href="javascript:bevestig('Are%20you%20sure%20to%20delete%20this%20item?','?site_id=2&page=admin_Modules&action=delete&id=15')"><img border="0" height="10" src="websites/admin-panel/images/delete.png" alt="Delete"></a> <a href="?site_id=2&page=admin_Modules&action=edit&id=15"><img height="10" border="0" src="websites/admin-panel/images/edit.png" alt="Edit"></a></td>
        </tr>
        <tr onMouseOver="this.style.backgroundColor='#acf88c'" onMouseOut="this.style.backgroundColor='#ffffff'">
            <td align="center" onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=16'>16</td>
            <td onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=16'>FileCategory</td>
            <td align="center" onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=16'>4.0</td>
            <td align="center"><img alt="Status" border="0" src="websites/admin-panel/images/resolved.png"></td>
            <td align="center"><a href="javascript:bevestig('Are%20you%20sure%20to%20delete%20this%20item?','?site_id=2&page=admin_Modules&action=delete&id=16')"><img border="0" height="10" src="websites/admin-panel/images/delete.png" alt="Delete"></a> <a href="?site_id=2&page=admin_Modules&action=edit&id=16"><img height="10" border="0" src="websites/admin-panel/images/edit.png" alt="Edit"></a></td>
        </tr>
        <tr onMouseOver="this.style.backgroundColor='#acf88c'" onMouseOut="this.style.backgroundColor='#ffffff'">
            <td align="center" onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=17'>17</td>
            <td onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=17'>Form</td>
            <td align="center" onClick=location.href='?site_id=2&page=admin_Modules&action=edit&id=17'>1.0</td>
            <td align="center"><img alt="Status" border="0" src="websites/admin-panel/images/unresolved.png"></td>
            <td align="center"><a href="javascript:bevestig('Are%20you%20sure%20to%20delete%20this%20item?','?site_id=2&page=admin_Modules&action=delete&id=17')"><img border="0" height="10" src="websites/admin-panel/images/delete.png" alt="Delete"></a> <a href="?site_id=2&page=admin_Modules&action=edit&id=17"><img height="10" border="0" src="websites/admin-panel/images/edit.png" alt="Edit"></a></td>
        </tr>
        <tr><td colspan=5>&nbsp;</td></tr></table>


Hier de PHP code die het maakt:

PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
        $colspan = "5";
        $array = $ObjectProject->get("null", $_SESSION['user_level']);
        $startViewForm = $ObjectForm->startViewForm($page_title, $colspan);
        $stopViewForm = $ObjectForm->stopViewForm($colspan);
        $max = count($array) -1;
        echo $startViewForm; ?>
        <tr id="table-admin-tr-header2"><td style="text-align: center; width: 30px;">ID</td><td>Name</td><td style="text-align: center;">User</td><td style="text-align: center; width: 75px;">Status</td><td style="text-align: center; width: 75px;">Options</td></tr>
        <tr><td colspan="<?php echo $colspan; ?>">&nbsp;</td></tr>
        <?php for ($i = 0; $i < $max; $i++ ) { $onclick = "onClick=location.href='?site_id=" . $site_id . "&page=" . $page . "&action=edit&id=" . $array[$i]['id'] . "'"; ?>
        <tr onMouseOver="this.style.backgroundColor='#acf88c'" onMouseOut="this.style.backgroundColor='#ffffff'">
            <td align="center" <?php echo $onclick; ?>><?php echo $array[$i]['id']; ?></td>
            <td <?php echo $onclick; ?>><?php echo $array[$i]['name']; ?></td>
            <td align="center" <?php echo $onclick; ?>><?php echo $array[$i]['user_login']; ?></td>
            <td align="center"><img alt="Status" border="0" src="<?php echo $site_path; ?>images/<?php if ($array[$i]['status'] == "1") { echo "resolved.png"; } else { echo "unresolved.png"; } ?>"></td>
            <td align="center"><a href="javascript:bevestig('Are%20you%20sure%20to%20delete%20this%20item?','?site_id=<?php echo $site_id; ?>&page=<?php echo $page; ?>&action=delete&id=<?php echo $array[$i]['id']; ?>')"><img border="0" height="10" src="<?php echo $site_path; ?>images/delete.png" alt="Delete"></a> <a href="?site_id=<?php echo $site_id; ?>&page=<?php echo $page; ?>&action=edit&id=<?php echo $array[$i]['id']; ?>"><img height="10" border="0" src="<?php echo $site_path; ?>images/edit.png" alt="Edit"></a></td>
        </tr>
        <?php } echo $stopViewForm;

[ Voor 35% gewijzigd door quakerix op 18-04-2007 00:28 ]


  • Blaise
  • Registratie: Juni 2001
  • Niet online
Zal wel een bug zijn. Heeft in ieder geval niks te maken met je PHP.

  • quakerix
  • Registratie: Februari 2003
  • Laatst online: 29-11 13:44
Blaise schreef op woensdag 18 april 2007 @ 00:28:
Zal wel een bug zijn. Heeft in ieder geval niks te maken met je PHP.
argh wat een vervelende bug dan, het is namelijk echt geen porum als zo iets gebeurd. Ik heb m'n HTML gedeelte al paar x door een validator laten heengaan maar krijg ook nergens foutmeldingen.

  • RobIII
  • Registratie: December 2001
  • Niet online

RobIII

Admin Devschuur®

^ Romeinse Ⅲ ja!

(overleden)
Waarom 'quote' je attributen soms met ' en dan weer met " en dan weer helemaal niet?

There are only two hard problems in distributed systems: 2. Exactly-once delivery 1. Guaranteed order of messages 2. Exactly-once delivery.

Je eigen tweaker.me redirect

Over mij


Verwijderd

quakerix schreef op woensdag 18 april 2007 @ 00:30:
[...]


argh wat een vervelende bug dan, het is namelijk echt geen porum als zo iets gebeurd. Ik heb m'n HTML gedeelte al paar x door een validator laten heengaan maar krijg ook nergens foutmeldingen.
Een validator heeft dan ook niets met fouten te maken.

Je kan prima valide HTML schrijven en nog niet de layout krijgen die je bedoelt had.

Ook kun je valide HTML hebben, 2 standard compliant browsers die toch beiden niet dezelfde weergave hebben.

HTML is nu eenmaal niet perfect, in dit geval lijkt het me beter niet zozeer te richten op standaarden maar eerder op goede werking onder de doelgroep. Dat de output van je CMS standard compliant moet zijn lijkt me logisch, maar dit is de beheeromgeving toch?

Ik kan in ieder geval ook geen fout vinden in de code, maar FireFox heeft net zoals ieder stuk software ook z'n deel aan bugs.

  • quakerix
  • Registratie: Februari 2003
  • Laatst online: 29-11 13:44
RobIII schreef op woensdag 18 april 2007 @ 00:34:
Waarom 'quote' je attributen soms met ' en dan weer met " en dan weer helemaal niet?
dat komt dus omdat het formulier gegenereert word en ik in mijn eerste 'form-generator' daar nog niet erg netjes in ben geweest. Maar dat ben ik atm dus aan het fixxen.

  • Blaise
  • Registratie: Juni 2001
  • Niet online
Misschien als je voor Firefox de mouseover met CSS maakt, dat het dan wel werkt:
­
Cascading Stylesheet:
1
2
3
tr:hover td{
   background-color: #acf88c
}

  • quakerix
  • Registratie: Februari 2003
  • Laatst online: 29-11 13:44
Blaise schreef op woensdag 18 april 2007 @ 00:46:
Misschien als je voor Firefox de mouseover met CSS maakt, dat het dan wel werkt:
­
Cascading Stylesheet:
1
2
3
tr:hover td{
   background-color: #acf88c
}
Werkt dit CSS stukje dan niet in IE? Persoonlijk gebruik ik FF, maar 99% van m'n klanten helaas IE.

Ik heb inmiddels de form generator gefixt en maakt dus alleen nog maar gebruik van ""

  • Blaise
  • Registratie: Juni 2001
  • Niet online
IE6 ondersteunt geen hover op andere elementen dan <a>, maar dat kan hiermee worden opgelost.
IE7 ondersteunt wel :hover, maar alleen in Strict mode.

[ Voor 29% gewijzigd door Blaise op 18-04-2007 00:58 ]

Pagina: 1