We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30128
    • 78 Posts
    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 smiley

    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 smiley

    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..
      • 13320
      • 245 Posts
      Hi,

      It’s not an error on the date formats.

      Look :
      (`mydb`.modx_site_tmplvar_contentvalues.tmplvarid= and
      , after the ’=’ it’s empty, it’s an MySQL error.

      Why the tmplvarid is empty ? That’s the question.

      CALx try to get the tmplvarid with the TV name you put on the snippet call.

      Do you have test the same events with pub_date/unpub date (same date as the tv’s date you put) ?

      At the beginning, CALx it’s for schedule event, not for a blog, but it’s works, may be i do add some feature to CALx works like you want.

      For your probleme, i do some test, and i pm the new class file, and you test it, ok ?
        [b]D
        • 13320
        • 245 Posts
        May be i found the problem, can you post the snippet call, who is in the "Events listing" document plz ?
          [b]D
          • 13331
          • 67 Posts
          [[CALx? &getFolder=`3` &dayStart=`0` &lang=`english` &inactDay=`6` &useTV=`true` &dateStartTVName=`StartDateofEvent` &dateEndTVName=`EndDateofEvent` &popupType=`2` &popupSize=`300` &toolTipPosition=`CENTER` &getTypeProcess=`showMultiEvent`]]
            • 13320
            • 245 Posts
            Jacob, do you use the TV’s ?
              [b]D
              • 30128
              • 78 Posts
              I went through and made sure all my documents had both publish and unblished dates, startTV and endTV, deleted all Events Listing pages and deleted multiEvents.txt. And now it works! It works both if I use TV’s, and if I do not. So I guess there were some clutter there from when I added and removed test calls and documents in the beginning.

              My remaining problems now are
              1) "show full month" have some problems when I’m not using TV’s (and I do not want to). The page lists alot of "No events schedule for this journey," and it only lists a few of the actual events (the first few).
              2) Event Listing is picked up by Ditto in my news listing :p I hope I’ll be able to filter this through some ditto:phx maybe?

              There seems to be little or none problems using TV’s. However I dont’ really want to use them, since as far as I see it is neccessary to log into backend to edit / add them, and this will just be too much for my users. If there is a way to create new events from the front end while using TV’s that would be superb.

              Tjalve

                • 13320
                • 245 Posts
                Hey !
                Okay, that’s just fine.
                CALx can use the TV’s or not (and then use the pub dates ) : you just have to choose. wink

                I’ll soon post a new version with bug corrections and 2 major changes :
                1) CALx can now handle the sub directories - and the sub-sub directories and the sub-sub-sub etc. - if they’re published.
                2) CALx does not create .txt files anymore, so you don’t need specific permissions. You create a new file with the manager and you just have to indicate its ID in the &idMultiEvent parameter - which is not optional.

                For those who have a previous version of CALx, you can indicate the ID of the document which already exists, no need to create a new one.
                If you want to use several calendars with different languages on the same website ( shown on the same page ), you must create one file for each language.

                About the problem with the display of the month, it’s one of the things I’ve corrected in the late version. You must be using an old one, right ?
                  [b]D
                  • 30128
                  • 78 Posts
                  I use CALx 0.6.1, which I downloaded just a few days ago... I’ll check again, maybe I managed to find an old download link somewhere?
                    • 30128
                    • 78 Posts
                    Now I’ve surely downloaded the newest 0.6.1 code, and I copied in the snippet code again too, and the problems with the month-display is still there.
                      • 13320
                      • 245 Posts
                      it’s strange :/

                      can you post the dates of your event?
                        [b]D