Page 1 of 1

Bad </td> formatting in Serendipity Administration Suite

Posted: Mon Sep 16, 2013 2:10 am
by Mike_T
Hi

There is a minor HTML formatting bug in the code generated for the Serendipity Administration Suite entry page. The table row for the td colspan="2" id="serendipityAdminInfopane" data has a faulty end of row delimiter. Here is the section of HTML that is affected.

Cheers

Mike_T

<body id="serendipity_admin_page" onload="spawn()">
<table cellspacing="0" cellpadding="0" border="0" id="serendipityAdminFrame">
<tr>
<td colspan="2" id="serendipityAdminBanner">
<h1>Serendipity Administration Suite</h1>
<h2>Mike's Blog</h2>
</td>
</tr>
<tr>
<td colspan="2" id="serendipityAdminInfopane">
<span>Logged in as Mike_T (Administrator)</span>
</td>
<!--BUG missing '<' --> tr>
<tr valign="top">
<td id="serendipitySideBar">

Re: Bad </td> formatting in Serendipity Administration Suite

Posted: Mon Sep 16, 2013 9:05 am
by Timbalu
Which Serendipity Version? This is not missing in default, which is default/admin and /bulletproof/admin, btw.

Code: Select all

    <body id="serendipity_admin_page" onload="spawn()">
        <table cellspacing="0" cellpadding="0" border="0" id="serendipityAdminFrame">
             <tr>
                <td colspan="2" id="serendipityAdminBanner">
                      <h1>Serendipity Verwaltungsoberfläche</h1>
                      <h2>John Doe's personal blog</h2>
                </td>
            </tr>
            <tr>
                <td colspan="2" id="serendipityAdminInfopane">
                      <span>Angemeldet als John Doe (Administrator)</span>
                </td>
            </tr>
            <tr valign="top">
                <td id="serendipitySideBar">
See your template/admin/index.tpl to correct it.

Re: Bad </td> formatting in Serendipity Administration Suite

Posted: Mon Sep 16, 2013 12:36 pm
by Mike_T
Hi Ian

Thanks for that info.

The version of serendipity I am using is from the "serendipity-1.7.3.zip" package. I haven't installed any extra plug-ins. I downloaded it yesterday and am now working through learning how to use it. I have done a fair bit of C and Java programming, have been coding with HTML for some time with a bit of javascript and have dabbled in PHP; so would be able to make my way around the serendipity code once I become familiar with it. My main reason for getting s9y was to get into webloging as a user rather than a developer. I just thought that I'd report the bug so that those more familiar with the code could improve the product.

My installation doesn't have a "template/admin/index.tpl" file. However it has a "\serendipity\templates\default\admin\index.tpl" file.

I just double checked, and it is not the initial Serendipity Administration Suite page that is affected, it is the page that is loaded when I click on the "New Entry" side-link. Any further pointers would be appreciated.

Cheers

Mike T

Re: Bad </td> formatting in Serendipity Administration Suite

Posted: Mon Sep 16, 2013 1:42 pm
by Timbalu
But the fallback admin/index.tpl file has that closing </tr>, see
https://github.com/s9y/Serendipity/blob ... ex.tpl#L72

If I click on new entry, it is on right place also.
Maybe you need to purge the templates_c/default/some/more/dirs/aRandomNumber.file.index.tpl.php file or, at first, have a look into it, if it has that missing tag.
Which template do you use, btw?

Re: Bad </td> formatting in Serendipity Administration Suite

Posted: Mon Sep 16, 2013 1:44 pm
by onli
Thanks Mike. That code in the backend is indeed a mess and errors like the one you described are quite possible.

We are at the moment working on a new backend with modern html for serendipity 2.0, which will go into testing soon. I'm sure that the bug is fixed in there, as we got rid of the table layout.

If the bug doesn't affect your usage of that area, I'd suggest to just wait for that new version.
regards

Re: Bad </td> formatting in Serendipity Administration Suite

Posted: Mon Sep 16, 2013 2:00 pm
by Timbalu
There is also a fallback to hardcoded markup in serendipity_admin.php, if no smarty is used or did not initiate (the else part of

Code: Select all

if (!$use_installer && !$_SESSION['no_smarty'] && serendipity_smarty_init()) {
).
But this also has the "missing" </tr> set, see
https://github.com/s9y/Serendipity/blob ... n.php#L355

Re: Bad </td> formatting in Serendipity Administration Suite

Posted: Mon Sep 16, 2013 3:05 pm
by Mike_T
Thanks People

I'm just using the default template Ian. The glitch is not affecting the performance of the page (as far as I can see anyway); so I'll just keep using it as is for now. As I get more familiar with the code and the code file anatomy I will be of more use to you in nailing down any bugs I come across. I'm "retired" now, so I should have plenty of time on my hands to fiddle 8) .

Cheers

Mike T

Re: Bad </td> formatting in Serendipity Administration Suite

Posted: Mon Sep 16, 2013 4:37 pm
by Timbalu
Its still quite mysterious where you get that from... :wink:

Re: Bad </td> formatting in Serendipity Administration Suite

Posted: Mon Sep 16, 2013 11:54 pm
by Mike_T
Is there a UML map of s9y available so that I can see how it all fits together? If not, then perhaps I should make that my next project.

Mike T

Re: Bad </td> formatting in Serendipity Administration Suite

Posted: Tue Sep 17, 2013 9:50 am
by Timbalu
I don't think so, but I don't know if Garvin ever did that for the book, (see left on top).
Could be nice to have though! :)

Re: Bad </td> formatting in Serendipity Administration Suite

Posted: Tue Sep 17, 2013 9:53 am
by garvinhicking
Sadly not that I know of. :-(

Re: Bad </td> formatting in Serendipity Administration Suite

Posted: Tue Sep 17, 2013 11:04 am
by Mike_T
Leave it with me. I'll study the documentation and the code over the next couple of months, and see if I can do a UML analysis. I have several other non-programming related projects on the go, and this will have to fit between them, but it will give me something to exercise my grey matter :-P

BTW, you can see a bit of my history at http://seismo.cqu.edu.au/CQSRG/staff/MikeT/details/

Cheers

Mike T

Re: Bad </td> formatting in Serendipity Administration Suite

Posted: Tue Sep 24, 2013 1:13 pm
by garvinhicking
Hi Mike!

That sounds awesome! I'd love to see your results on this :-) Also feel free to ask for specifics, maybe we can help before you waste too much time on figuring it out ;)

Re: Bad </td> formatting in Serendipity Administration Suite

Posted: Tue Sep 24, 2013 1:54 pm
by Mike_T
No worries Garvin

I'm in the process of getting my head around the strange combination of OOP and procedural programming that is the PHP animal. Lots of global variables and lack of encapsulation - something I am not all that comfortable with (but getting used to) :-) Its almost as if PHP want's to be OOP, but can't make the commitment. The fact that it needs to intertwine with XHTML in a free fashion, as well as link in with databases (especially MySQL) in a non-OOP way, really precludes allowing it to be a pure OOP language. I accept that; but it makes it difficult to map the whole kit and kaboodle using UML. UML pretty much assumes that the components of the application are objects; which is certainly not the case with any of the PHP applications I have been looking at, including S9Y.

As I said, leave it with me while I internalise the code. Thanks for the invitation to call on your expertise when I get stuck (which I undoubtedly will do). I'll use this thread to call for a shoulder to cry on as that happens; but, I won't be beating at your door all the time - just when I simply can't understand what is going on. This is not something I will accomplish in a matter of weeks, but I'll keep at it and keep you informed from time to time how I am progressing.

Thanks for the support.

Cheers

Mike T

Re: Bad </td> formatting in Serendipity Administration Suite

Posted: Tue Sep 24, 2013 2:15 pm
by garvinhicking
Hi!

Well, PHP stems from a script-based, functional world. Many developers use its easy-of-prototyping and develop functional functionality ;) which often remains inside the code, because it simply worked. OOP is not enforced in PHP, which is IMO a good thing and makes PHP somewhat unique. But with great power comes great responsibility, so more often than not those OOP/functional approaches collide with each other. Serendipity is a fine example for this; we do many things functionally, simply because it works that way from the start. We don't have the manpower to build a complete OOP approach, because one would have to rebuild everything from scratch that way.

That's actually also a reason why there is no PHP-blog system that has full functionality AND is perfectly implemented using OOP... ;)

I hope you'll have fun doing this, it sounds like you're about to. :-)

Best regards,
Garvin