Hi,
I finaly came around to test my thesis that mysql has a epoc bug. After a few
test, I managed to get ONE article from the stack. Hmm. WHat is SO spesical
about this bugger???
It seems to have a few extra fields:
adate, aldate,acalendar, and alcalandar although I suspect these are SQL
generated.
It also has the calstart field set. Is this manatory for the
mgd_get_article_calender* functions?
Could this be some undocumented feature popping up?
Tarjei
Heres the successfull query:
SELECT article.id AS id,article.name AS
name,title,abstract,content,author,Concat(firstname,If(firstname=''||lastname='','','
'),lastname) AS
authorname,article.topic AS topic,Date_format(article.created,'%d.%m.%Y') AS
date,Date_format(article.created,'%D %b. %Y') AS
adate,Date_format(article.created,'%D %M %Y') AS
aldate,url,icon,extra1,extra2,extra3,article.score AS
score,type,Unix_Timestamp(article.created) AS created,article.creator AS
creator,Unix_Timestamp(revised) AS
revised,revisor,revision,Unix_Timestamp(locked) AS
locked,locker,Unix_Timestamp(approved) AS
approved,approver,article.sitegroup,If(IsNull(calstart),'',If(caldays=0,Date_Format(calstart,'%d.%m.%Y'),Concat(Date_Format(calstart,If(Year(calstart)!=Year(From_Days(To_Days(calstart)+caldays)),'%d.%m.%Y',If(Month(calstart)!=Month(From_Days(To_Days(calstart)+caldays)),'%d.%m.','%d.'))),Date_Format(From_Days(To_Days(calstart)+caldays),'-%d.%m.%Y'))))
AS calendar,If(IsNull(calstart),'',If(caldays=0,Date_Format(calstart,'%D %b.
%Y'),Concat(Date_Format(calstart,If(Year(calstart)!=Year(From_Days(To_Days(calstart)+caldays)),'%D
%b.
%Y',If(Month(calstart)!=Month(From_Days(To_Days(calstart)+caldays)),'%D
%b.','%D'))),Date_Format(From_Days(To_Days(calstart)+caldays),'-%D %b. %Y'))))
AS
acalendar,If(IsNull(calstart),'',If(caldays=0,Date_Format(calstart,'%D %M
%Y'),Concat(Date_Format(calstart,If(Year(calstart)!=Year(From_Days(To_Days(calstart)+caldays)),'%D
%M
%Y',If(Month(calstart)!=Month(From_Days(To_Days(calstart)+caldays)),'%D
%M','%D'))),Date_Format(From_Days(To_Days(calstart)+caldays),'-%D %M %Y')))) AS
alcalendar,Unix_Timestamp(calstart) AS
startdate,Unix_Timestamp(Date_Add(calstart, INTERVAL caldays DAY)) AS
enddate,caldays,Date_Format(calstart,'%d.%m.%Y') AS
calstart,Date_Format(From_Days(To_Days(calstart)+caldays),'%d.%m.%Y') As
calstop FROM article,person WHERE (article.type=1 AND
article.topic IN
(14,15,25,35,26,27,68,96,97,146,28,29,128,129,130,30,89,150,90,32,39,40,41,42,16,23,112,123,124,147,31,66,67,70,74,75,85,94,95,17,24,33,38,73,76,79,117,125,126,34,52,119,120,121,122,141,53,54,55,86,18,56,57,19,58,59,60,20,69,98,99,100,101,102,103,104,148,21,61,62,140,63,64,87,22,36,65,88,37,43)
AND author=person.id AND article.up=0 AND Unix_Timestamp(calstart)>=946684800
AND 24*60*60-1+Unix_timestamp( Date_Add(calstart,
INTERVAL caldays DAY))<=978307200) AND (article.sitegroup in (0,1) AND
person.sitegroup in (0, 1)) ORDER BY article.created DESC
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]