An Error Was Encountered
Error Number: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ':) AND c.typeid != 109 AND ( if(c1.validfrom is not null, c1.validfrom' at line 34
SELECT c.id AS id, c.nodeID AS nodeID, c.typeID as originalTypeID, if(c.typeID = 119, 111, c.typeID) AS typeID, c.name as contentName, coalesce(lx.title,if(((c.typeID = 111) or (c.typeID = 119)),concat(n.name,' » ',c.name),c.name)) AS name, c.bodytext AS bodytext, coalesce(t_method.name,t.name) AS method, t.cmsname AS typeName, lx.contentID AS contentID, lx.title AS title, lx.notes AS notes, concat( if((c.typeID = 120),sNode.controller,n.controller), '/', coalesce(t_method.name,t.name,'page'), '/', if((c.typeID = 120),sContent.nodeID,n.id),':', ifnull(nx.pageID,if(c.typeID = 120,lx.contentID,c.id)), if(complex.rank is not null and c.typeID = 111,concat(':',complex.rank),''), if(c.typeid = 103,'/product',''), if(c.typeID <> 119 and c.typeID <> 111,concat('/',c.id),'') ) AS page_url, if(c.typeid = 112, if(left(c.custom0,4) != 'http', concat('http://',c.custom0), c.custom0 ), null) as external_url, n.controller AS controller, c.date0, if(c.date0 != c.date1, date_format( c.date0, if(year(c.date0) = year(c.date1), if(month(c.date0) = month(c.date1) , '%D', '%D %M'),'%D %M %Y')), date_format(c.date0,'%W, %D %M %Y')) AS startDate, if(c.date0 != c.date1, date_format(c.date1,'%D %M %Y'),null) AS endDate, if(c.typeid=104,c.custom0,null) as address, if(c.typeid=104,c.custom1,null) as telephone, if(c.typeid=104, c.custom2, null) email, if(c.typeid = 101, eventType.name, null) as eventTypeName, if(c.typeid = 101, eventComplex.rank, null) as locationRank, if(c.typeid = 101, c.custom2, null) as timetable, if(c.typeid = 101, c.title0, null) as buildingName, if(c.typeID = 103,coalesce(c.custom1,c.custom0),null) AS price, if(c.typeID = 128,c.title0,NULL) AS abstract, lx.rank as rank FROM (`linkxrefs` lx) JOIN `content_live` c ON c.id = lx.linkID JOIN `content` c1 ON c1.id = c.id and c1.online = 1 JOIN `type` t ON t.id = c.typeID JOIN `node` n ON n.id = c.nodeID JOIN `nodetypexrefs` nx ON nx.nodeID=c.nodeID and nx.typeID=c.typeID JOIN `content` sContent ON sContent.id = lx.contentID JOIN `node` sNode ON sNode.id = sContent.nodeID LEFT JOIN `category` complex ON complex.id = c.cat0ID LEFT JOIN `category` t_method ON t_method.id = c.custom9 and (c.typeid = 111 or c.typeid = 119) LEFT JOIN `category` eventLocation ON eventLocation.id = c.cat1ID LEFT JOIN `category` eventComplex ON eventComplex.id = eventLocation.custom0 LEFT JOIN `category` eventType ON eventType.id = c.cat2Id WHERE lx.tableid = 'content' AND (lx.contentid = 5116http:) AND c.typeid != 109 AND ( if(c1.validfrom is not null, c1.validfrom <= now(), 1) and if(c1.validuntil is not null, c1.validuntil >= now(), 1) and if(c.typeId = 102, if(c.date1 is not null, c.date1 >= now(), 1), 1) ) GROUP BY c.id ORDER BY t.name, lx.rank