We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4463
    • 26 Posts
    Please is there someone with this snippet working?
    I also Troyed all the solutions but, i still have this problem, when i click any button or link I’m redirected to the homepage
    Any ideas?

    Thanks
      • 23383
      • 138 Posts
      This is my version with modifications listed in this topic and with locales support.
      The only thing you have to do is to change the line 10 :
      setlocale(LC_TIME, "C");
      to your locale.

      This snippets works for me, but I had to look at something on my pages: If the pages had a carriage return, the snippet doesn’t work. I’ll try to fix it soon.
        • 27
        • 117 Posts
        Heres the one I’ve ended up with after quite a few tweaks to get paths finding what its supposed to etc... Works for me, I hope it does for you too =). Much thanks to Danny van Ommen for the original snippet =).

        Big love to all you MODx-minded people

        0
          • 885
          • 14 Posts
          a little hack to have the event day linked (html link instead js event):

          find
          echo $dd;

          and replace with
          						
          // aleinside hack
          $descriptionToUse = ($monthEvent["description"]) ? $monthEvent["description"] : $monthEvent["pagetitle"] ;
          if(trim($tooltip) != '')
             echo "<a href='[~".$monthEvent["id"]."~]' title='".$descriptionToUse."'>".$dd."</a>";
          else
             echo $dd;
            • 17677
            • 7 Posts
            Hi!

            Is there someone who got this working? I have done everything that is mentioned here but stilL:

            - No links - color change at hover works
            - "next" and "previous" month arrows are somehow doubled.. So i can see second arrows below the others.. They should not be like this i guess??


            I really would like to get this work!

            Lumimies
              • 5727
              • 160 Posts
              I’ve been investigating the Kalender snippet recently, it’s a great snippet but it could use some work! wink

              Kalender
              First thing, the name confused me. If nothing shows up, not even an error, that means you typed in the name wrong. Triple check every letter that you typed for the snippet call. It’s not Kalendar, but Kalender. I know, I did.

              No tooltip
              Second problem, overLib throws an error: ’Unterminated litteral’. That’s because the content being passed to the overLib function has \r\n caracters in it. They must be filtered out, so you need to change the following lines in the Kalendar snippet:

              Around line 543, change this:
              $html.= addslashes(str_replace('"',"'",$monthEvent["description"]));
              to this:
              $html.= addslashes(str_replace('"',"'",preg_replace('/\r|\n/','',$monthEvent["description"])));


              Around line 552, change this:
              $html.= addslashes(str_replace('"',"'",$monthEvent["introtext"]));

              to this:
              $html.= addslashes(str_replace('"',"'",preg_replace('/\r|\n/','',$monthEvent["introtext"])));


              Around line 561, change this:
              $html.= addslashes(str_replace('"',"'",$monthEvent["content"]));

              to this:
              $html.= addslashes(str_replace('"',"'",preg_replace('/\r|\n/','',$monthEvent["content"])));



              Tooltip is not showing in the right place
              There might be another problem. On my template, I’m using a div position:relative to hold my content. This causes the tooltip content to show up way farther than supposed. That’s because, has stated in the overLib documentation, the <div id="overLib"> should be located right after the <body> tag. Here, the solution is to hack the snippet again.

              Cut the line, around line 379, that looks like this:
              <div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>


              and paste it in your template, right after your <body> tag. It should cause any problem on other pages since its visibility is hidden. There might be another way around this, but I don’t know it yet smiley

              Multilingual Support
              Nice addition by Pikachu, the much needed set_locale allows us to get months name in our native language. Unfortunately, I had a problem with accentuated characters showing up as question marks because I was using UTF-8 encoding for my pages. To fix this, either add the utf8_encode() function in the snippet at around line 399, change this:
              <? echo $month; ?>
              to this:
              <? echo utf8_encode($month); ?>

              and around line 661, change this:
              $html_jump .= strftime("%B %Y",strtotime($jump_rows_mm."/1/".$jump_rows_yyyy));
              
              to this:
              $html_jump .= utf8_encode(strftime("%B %Y",strtotime($jump_rows_mm."/1/".$jump_rows_yyyy)));

              Note: If you’re using another ISO character encoding, replace utf8_encode() with htmlentities() or make the switch to UTF8 wink

              Well, that’s about it. Otherwise, it’s a great kick start, I’m sure we could team up to make something really great out of it. I would invite deevio to update his code with my changes. I’m just starting with MODx and I just switched from using my home cooked CMS to MODx and I must say that it’s really great. Hope I can contribute sooner than later.

              I attached the updated source code for the snippet. The only thing you need to remember is to add the <div id="overLib"> in your template, as mentioned previously in my post. Hope this helps someone.


                Olivier Deland
                Montreal, Canada - Web Developer
              • Hope I can contribute sooner than later.
                Looks to me like you just did! 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
                  • 17677
                  • 7 Posts
                  Hi!

                  Thank You for this SuperB help - I will check these out today - hope to have my kalender working..

                  - I will get back to this later today.

                  Thank you again grin

                  Lumimies
                    • 17677
                    • 7 Posts
                    Hi!

                    grin grin grin grin

                    It works "Out of the box with Your Snippet!!! I did not even need to add <div id="overLib"> ...

                    Only one small thing..

                    - I would like to have links in calendar days (so that user can navigate to that days event by clicking the link)

                    - Do You have solution for that ?? I hope You have...

                    But anyway - You have saved my day already!

                    Thank You

                    Lumimies
                      • 11413
                      • 203 Posts
                      Thanks a lot man! I’ll try this thing ASAP! Just to know, is there still problems if I want to add the calender directly in the page or with a snippet/chunk? IIRC, it was leading to some troubles and I hope it’s fixed now: I need to manage several calendars, totally independent from each other.

                      Again thanks!
                      MODx and its community ROCKS!!! grin
                        Blaise Bernier

                        www.medialdesign.com - Solutions for small business, hosting, design and more!