We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32241
    • 1,495 Posts
    Kewl, don’t you think that it will be better to have this API available for all the snippet coder? Make it as flexible as possible, so we all can use it. Btw, how do we add one more checkbox on the manager user role, for it have like "calendar admin permission", or etc?
      Wendy Novianto
      [font=Verdana]PT DJAMOER Technology Media
      [font=Verdana]Xituz Media
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      The sql file I have is nothing like the one quoted by David (I changed the double quotes to backticks, and put my own table prefix) but it’s working OK.

      CREATE TABLE `so_calendar` (
        `calid` int(11) NOT NULL auto_increment,
        `datebegin` date default NULL,
        `dateended` date default NULL,
        `timebegin` time default NULL,
        `timeended` time default NULL,
        `description` varchar(255) default NULL,
        `details` text,
        `pageid` mediumint(9) default NULL,
        `category` varchar(255) default NULL,
        PRIMARY KEY  (`calid`)
      );
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Another little oddity. If I specify that an event spans 1 day, it shows up across 2 days. That does not seem to be "intuitive"; one would think an event spanning one day would be for one day, for 2 days would be for two days, etc. Of course, unless you’re using the Jewish calendar, which runs from evening to evening... grin
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Ok, examining the caching problem. When deleting an entry, it thinks the cache file should be

          ./cache/DB_75_000000.cache.php

          when it actually is

          ./cache/DB_75_200602.cache.php
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Working on this some more, and when adding an event it can’t find the file. Where is $snippetpath defined in the db class?
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 32241
              • 1,495 Posts
              Quote from: sottwell at Feb 02, 2006, 11:20 AM

              Working on this some more, and when adding an event it can’t find the file. Where is $snippetpath defined in the db class?

              Thanks for troubleshooting this Susan. It’s being passed on class contructor. So on the editor file, you need to make sure that the class being declared is passing the right path to the object.

              Have you figure out what’s the problem with the cache?
              How about the path is not right? I think garryn doesn’t have any problem with it. If you know why it’s not working on yours, please let me know.

              I really appreciate all the help Susan.
                Wendy Novianto
                [font=Verdana]PT DJAMOER Technology Media
                [font=Verdana]Xituz Media
                • 32241
                • 1,495 Posts
                Quote from: sottwell at Feb 02, 2006, 10:28 AM

                Another little oddity. If I specify that an event spans 1 day, it shows up across 2 days. That does not seem to be "intuitive"; one would think an event spanning one day would be for one day, for 2 days would be for two days, etc. Of course, unless you’re using the Jewish calendar, which runs from evening to evening... grin

                Ehmm... laugh Dunno, when I design it, I thought that’s the way to go. How about if the user choose 0? What it’s gonna be?
                  Wendy Novianto
                  [font=Verdana]PT DJAMOER Technology Media
                  [font=Verdana]Xituz Media
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  In the db class constructor, $this->snippetPath is available (passed from the snippet). In the class member function FetchData it’s there. But in calDbNew it’s not there. It’s really wierd, because $this->dbTable is available, and $this->pageId is available huh
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    Maybe this 1 day 2 day thing is like US elevators versus European elevators. In the US the 1st floor is the ground floor, while in Europe the 1st floor is what in the US would be called the 2nd floor.
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      Aha! What’s this, in editor.db.php?

                      $calDataSource = new calSourceDatabase('', $_GET['pid']);
                      


                      Where does this get used?
                        Studying MODX in the desert - http://sottwell.com
                        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                        Join the Slack Community - http://modx.org