[ewiki] Re: Blogging (calendar commit)

> Particularly I would like your input on my decision to make the calendar
> page divider configurable.  I did this by implementing a set of defines like
> so:

I'd like to see that one called EWIKI_NAME_SEP and not _DIVIDER, but else
there is no real problem with it.

However you will get into trouble, because that constant should
ultimatively be defined in ewiki.php, which then however prevents it
use in plugins' define() statements - because those are typically
executed beforehand (forcing plugins to be loaded after ewiki is not
a good workaround).

> define("EWIKI_NAME_DIVIDER", "_");
> define("CALENDAR_NAME_DIVIDER", EWIKI_NAME_DIVIDER);

Therefore, you would just use CALENDAR_NAME_SEP here (?) not depending
upon a possible main EWIKI_NAME_SEP.

On the other hand most users are already used to our re-define() practice
and would hopefully define() that constant in their config.php and not
edit 'ewiki.php' for this (too late).


>
> The search call also respects them like this:
>
> && ($result = ewiki_database("SEARCH", array("id" =>
> $id.CALENDAR_NAME_DIVIDER.'20')))
>
> The .'20' is a horrible hack that I would like to fix before I commit.  It
> is there(and in a few other places) to differentiate between calendar pages
> and other types of subpages such as from my aview_posts plugin which appear
> as $id.'_POST'.$postnumber.  Perhaps it is necessary to check the SEARCH
> results against the regex, but if there is another option please tell me.

I don't see the problem with it, however we could rediscuss implementation
of a REGEXP db search variant - which would at least work for SQL databases;
but only mean a speed advantage if it was used wisely (since flat file
databases had to emulate it).


mario

Other related posts: