Didn’t mean to make you go all defensive, Jabberwock, sorry :p I of course only hold myself responsible for breaking people’s code, but I still need help to get it right...
@rajfantastic: ah-huh, so that’s what made my multiEvents screw up so badly
The format %d-%m-%Y you use not only in the multiEvents part of the code, but it’s only here it screw up (only when I click on a multiEvent that I get SQL errors). As I said earlier, I do use the default format for the Date Formatter widget. Using the TV’s worked fine as long as I didn’t click on a multiEvent date, so the TV’s themselves should be correctly named and used. Again, from the error message I already posted:
« MODx Parse Error »
MODx encountered the following error while attempting to parse the requested resource:
« Execution of a query to the database failed - 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 STR_TO_DATE(`mydb`.modx_site_tmplvar_contentvalues.value, '%d-%m-%Y')<='200' at line 1 »
SQL: SELECT * FROM `mydb`.modx_site_tmplvar_contentvalues
WHERE (`mydb`.modx_site_tmplvar_contentvalues.tmplvarid= and STR_TO_DATE(`mydb`.modx_site_tmplvar_contentvalues.value, '%d-%m-%Y')<='2007-08-10')
[Copy SQL to ClipBoard]
Parser timing
MySQL: 0.0189 s (15 Requests)
PHP: 0.0514 s
Total: 0.0703 s
it’s clear that the format of the input data is %Y-%m-&m (2007-08-10), while SQL expects data to be in %d-%m-%Y format. So the actual error is spit out when SQL tries to read 2007 as a day (it reads 200):
'and STR_TO_DATE(`mydb`.modx_site_tmplvar_contentvalues.value, '%d-%m-%Y')<='200' at line 1 »
So a quick test was of course to see if I could simply re-arrange the input, and as I further posted the result then became very buggish and randomly.
As for the publish / unpublish dates: Doesn’t MODx remove the document from the view after the unpublish date? I just assumed this would make the blog post hidden for visitors.
Has anyone combined blog-posting with the template variables? I fumbled a bit with including the TV’s I created for CALx in the FormBlog chunk, but couldn’t make it work (it was not editable).
It would be so great if I could get CALx working
The website will mostly have blog-posts about activites, but some posts will not be activity-relevant, so it would be nice to use the TV’s to control whether the post should appear on the calendar or not.
Ah, I so fear that someone soon will point out some stupid error I’ve made along the way..