Another stupid suggestion / question?!

Discussion corner for Developers of Serendipity.
Post Reply
Kzar

Another stupid suggestion / question?!

Post by Kzar »

Hi all,

I'm sorry if I'm a buch of lazyness folk with brainless attitude, but a question keeps me sleeping all night long - so short they are :

why s9y PHP code is full of copy/paste ?

Well, let me explain my complain (using those poor english I've managed to keep in mind after having learn it many year ago with kind french teachers but somewhat unhappy at doing their job) :

First, my internet service provider let me use s9y v0.71 but without URL rewrite use of any sort. Ok, not that cool, but ! I can play with request_uri, and so the following URL:

http://fgilles.free.fr/serendipity/inde ... ries/9-s9y

can be accessed with this one :

http://fgilles.free.fr/serendipity/inde ... ries/9-s9y

See the trick ?

Marvellous I said: I used to remove that trivial '?' from URL on s9y and my blog will be search engine/crowler/spider/fuckingspamleacher friendly... Hurray !

So I have had a look to s9y source... Great !!

And then I have opened serendipity_config.inc.php... Nice !

So I stared at $serendipity['rewrite'] value, it said 'none', so as it had to be. Yep !

So I have opened all serendipity_* at root folder. Well !

And did a search with "'rewrite'" keyword. Hurr...ay ?

"Oh." I said. "That's funny, it was found nearly 27 times."

So I write down the first search result on my screen :

Code: Select all

"ftp(0):/serendipity/serendipity_admin.php"(85,104):                        • <a href="<?php echo $serendipity['serendipityHTTPPath'] . ($serendipity['rewrite'] == 'none' ? $serendipity['indexFile'] . '?/' : '') . PATH_ENTRIES; ?>"><?php echo AUTHOR_SUITE; ?></a><br />
Here is this freaky '?' ! Hehe, man, I will kick your ass !

Second search result :

Code: Select all

"ftp(0):/serendipity/serendipity_admin_entries.inc.php"(192,101):                        $cats[] = '<a href="' . $serendipity['serendipityHTTPPath'] . ($serendipity['rewrite'] == 'none' ? $serendipity['indexFile'] . '?/' : '') . 'categories/' . $cat['categoryid'] . '_' . serendipity_makeFilename($cat['category_name']) . '">' . $cat['category_name'] . '</a>';
Well, I have to kick ass to your friends also.

So the question is simple as you can compare both results : why s9y is full of copy/paste of virtualy the same part of code everywhere ?

What I did to remove that ? is :

- created $serendipity['__flo_urlAddOn'] variable in s9y config file
- replaced '?/' by $serendipity['__flo_urlAddOn'] for all search occurences
- $serendipity['__flo_urlAddOn'] can contain '/' or '?/'

Outch... Image now that I want to upgrade someday to s9y X, where X > 0.71 ...

So now I'm wondering if next release will contain an URL writer function, to witch you could pass params like $cat_id, $cat_name, or whatever is needed to create an s9y url.

Or I may be mad/wrong/tasteless/asshole ? :)

(and at 2 am it's late to investigate further than that URL pb... oh, yes, I did some rss/atom url writer modification as they seemed to be wrong for comments entry, it was funny too)

Anyway, s9y is a great blog engine, It's easy to post and manage your blog and add plugins :)

Regards,

Kzar, aka Florent, a bloody french guy
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Another stupid suggestion / question?!

Post by garvinhicking »

Hi Kzar!

Before you actually complain and start developing, you should always get the latest Version of Serendipity. What you complain about has been taken care of mostly in our Serendipity 0.8 version (CVS / Development) - just as you presume in your question :-)

There are only few occassions remaining. I will gladly include any patches you contribute to fix those remaining ones. We're OpenSource, so everyone's free to contribute. :-)

There is not much copy+paste code left in Serendipity. And if you maintain a large project with several people, that always happen. Help improve Serendipity so that this doesn't happen anymore, we would appreciate that very much!

Thanks,
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/
Kzar

Post by Kzar »

Hi garvinhicking !

I'm glad (shame on me) to hear that my complain had been resolved in CVS s9y version :->

Well, I'll download latest build and try it :]

Actually, if I find any revelant problem, I will post another loosy complain ;-)

Thank you !
Post Reply