[EventCalendar] EC3 tripples upcoming events on trilingual blog (one per language)

Dr. Peter Troxler peter.troxler at gmx.net
Wed Oct 3 11:57:12 UTC 2007


it *should* be kind of straight forward, since gengo adds the  
wp_post2lang table to your database

now the following is just off the top of my head without testing  
anything

so the SQL query would need to be something like:

     "SELECT DISTINCT
        p.id AS id,
        post_title,
        start,
        u.$ec3->wp_user_nicename AS author,
        allday
      FROM $ec3->schedule s
      LEFT JOIN $wpdb->posts p ON s.post_id=p.id
      LEFT JOIN $wpdb->users u ON p.post_author = u.id
      LEFT JOIN $wpdb->post2lang l ON l.post_id=p.id
      WHERE p.post_status='publish'
        AND end>='$ec3->today' $and_before
        AND l.language_id='$ec3_gengo_current_language'
      ORDER BY start $limit_numposts"

I've added the third left join to get in the post2lang information  
(not tested, you'd have to see for yourself if it throws an error)
the $ec3_gengo_current_language variable would have to hold the  
language id.  You'd have to figure out how gengo "knows" about the  
current language and then you'd have to write that information into  
this variable.

I'm sorry not to be more helpful, I've not got a gengo install  
working right now and am a bit short of time

cheers

/ pt

On 3-okt-2007, at 13:17, Ralf Strandell wrote:

> Yes, indeed. There is that sql query :(
>
> Gengo faq tells: "A meta content-language tag [is added] to the  
> head of single language pages. link rel tags for all of the  
> translations of a post. a href-lang tags for all links that will go  
> to a language page."
>
> So I just need to modify that sql query (or pass its results  
> through some additional filtering) to display the heads of those  
> posts only, than have the link rel tags match with  
> the_language_code ...
>
> I am no sql master, so I do not know what to add where to compare  
> those link rel tags.
> Any ideas? Examples? Documentation? Anything?
>
> 2007/10/2, Dr. Peter Troxler < peter.troxler at gmx.net>:
> I had a look into the gengo multilingual plugin this morning.  If  
> you create a second post which is a translation then you actually  
> create a 2nd post for the same day(s) as the first one
>
> in your .fi example
>
> http://www.homoglobiini.fi/category/event-calendar/en/ lists the  
> english events (so does http://www.homoglobiini.fi/? 
> cat=7&language=en )
> http://www.homoglobiini.fi/category/tapahtumakalenteri/fi/ lists  
> the finnish events (do does  http://www.homoglobiini.fi/? 
> cat=7&language=fi)
> http://www.homoglobiini.fi/category/handelsekalender/sv/ lists the  
> swedish events (so does  http://www.homoglobiini.fi/? 
> cat=7&language=sv)
>
> also trying the  ?m=20071026&cat=7&language=en (or fi or sv) shows  
> the event in that respective language only
>
> so it looks like you have solved the problem,  except for the  
> upcoming events widget
>
> this widget uses the ec3_get_events function which contains a  
> direct database query.  this query gets all posts that are related  
> to the schedule entries, i.e. if you duplicated a post as described  
> above, it will retrieve 2 posts.  you would most probably need to  
> alter that function to make it work nicely with  (as far as I can  
> see from looking at the code).  this is, I'd assume, not such an  
> easy fix.
>
> On 2-okt-2007, at 20:38, anonymous forever wrote:
>
>> I have an example. Go to the homoglobiini.fi domain and look at  
>> the two-column sidebar to the right. The upcoming events widget  
>> "Tulossa" lists the same event three times on 26th october and  
>> also on 2nd november.
>>
>>
>> On 10/2/07, Ralf Strandell <ralf.strandell at gmail.com> wrote:  
>> WordPress 2.2.3 (i.e. NOT 2.3)
>> ec3 version 3.1.1_RC1
>>
>> 2007/10/2, Dr. Peter Troxler < peter.troxler at gmx.net>:
>> Ralf, if you give us a bit more information we might be able to help
>>
>> -- wp version
>> -- ec3 version
>> -- link to your site
>>
>> / pt
>> On 2-okt-2007, at 6:53, Ralf Strandell wrote:
>>
>>> Hi
>>>
>>> I am using this splendid EventCalendar3 plugin together with  
>>> Gengo multilingual plugin.
>>>
>>>
>>> The EC3 sidebar calendar correctly takes me either to:
>>>
>>> - domain.com?m=20071026&cat=7&language=en
>>>  or
>>> - domain.com?m=20071026&cat=7&language=fi
>>> ...
>>>
>>> depending on the language I have chosen to view my site in.
>>>
>>>
>>> The upcoming events widget however, lists all the event posts. It  
>>> does not take into consideration the_language or  
>>> the_language_code or anything. So... Each of my events produces  
>>> three rows of upcoming events. One in finnish. One in swedish.  
>>> One in english. What a nuisance!
>>>
>>> Could someone please instruct me, as to how to correct this  
>>> problem. I guess that I just need to modify some little function  
>>> to filter by language, but I am no PHP wizard yet.
>>>
>>> Thanks
>>>
>>> _______________________________________________
>>> Blog: http://wpcal.firetree.net /
>>> EventCalendar at firetree.net mailing list
>>> Unsubscribe: http://penguin.firetree.net/eventcalendar
>>
>>
>> _______________________________________________
>> Blog: http://wpcal.firetree.net/
>> EventCalendar at firetree.net mailing list
>> Unsubscribe: http://penguin.firetree.net/eventcalendar
>>
>>
>>
>> _______________________________________________
>> Blog: http://wpcal.firetree.net/
>> EventCalendar at firetree.net mailing list
>> Unsubscribe: http://penguin.firetree.net/eventcalendar
>>
>>
>> _______________________________________________
>> Blog: http://wpcal.firetree.net/
>> EventCalendar at firetree.net mailing list
>> Unsubscribe: http://penguin.firetree.net/eventcalendar
>
>
> _______________________________________________
> Blog: http://wpcal.firetree.net/
> EventCalendar at firetree.net mailing list
> Unsubscribe: http://penguin.firetree.net/eventcalendar
>
>
> _______________________________________________
> Blog: http://wpcal.firetree.net/
> EventCalendar at firetree.net mailing list
> Unsubscribe: http://penguin.firetree.net/eventcalendar




More information about the EventCalendar mailing list