Thomas Sutton | 26 Jun 04:17

Re: SPIP sites with multiple domain names


On 24/06/2009, at 3:34 PM, Fil wrote:

>>> You'll also probably need to change the urls/xxx.php file so that it
>>> gives the absolute URL with the correct domain too (I can send you
>>> survivreausida.net's urls file).
>>
>> That would be very helpful! Thanks!
>
> I've sent it to you. But be warned; this file is "old" in the sense
> that it doesn't use the most recent API for URLs. Anyway, it might
> give you an idea -- and in any case this functionality is something we
> need to find in the new plugin, if we're all going to use it.

It certainly does. Thanks.

>>> There are examples in
>>> plugins/zone/exclure_secteur/exclure_sect_fonctions.php:
>>> function boucle_RUBRIQUES($id_boucle, &$boucles) {
>>
>> I've seen this, but haven't had cause to look at the Boucle AST or  
>> the
>> boucle_* functions before. Is there not some global variable to  
>> add criteria
>> to loops as there is to add filters to all uses of a certain tag?
>
> No, but when a BOUCLE is defined, a few default SQL criteria are set
> (like e.g. statut='publie' ); this function boucle_XXXX is where it
> happens, and this is where you would add the new default criteria
> (like e.g. lang='zh' or id_secteur NOT IN (xxx)).

It looks like I have some more "SPIP-learning" to do then. :-)

I probably won't bother too much at the moment, but it would probably  
be a good idea for this to be very general and allow the web-master  
to add rules like:

If hostname == 'my.domain.com' then all RUBRIQUES loops should have:
	lang='zh'
	id_secteur=23
	id_mot=16

>>> No, but once it's coded it will be useful for many people!  (hence,
>>> tested and supported)
>>
>> The site this is for will be supported long-term and we're  
>> expecting to use
>> it on multiple projects in the future, so we will be developing and
>> maintaining it for the foreseeable future.
>
> Yes, same here. A good reason to develop it on the Zone :-)

Indeed it is. Once I something working for my purposes, I'll commit  
it. What do you think is a good name? "Microsites" might be a little  
bit too restricted given the uses others have for it (especially the  
domain-based translation).

Can someone point me to a good example of the "state of the art" for  
writing plug-ins (I've seen the thread on spip-dev@, but haven't  
bothered to feed it to Google Translate yet). In particular, I've  
seen two or three different ways to handle installation, creating  
tables, etc. Which is the newest, best, most future-proof way?

Regards,

Thomas Sutton

Web Developer
bouncingorange
graphic + web design

Gmane