We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 34162
    • 1 Posts
    Thank you for this great snippet laugh but it’s just a shame you need the hacks in this forum to make it work. Why isn’t the full working snippet in the repository? Would be nice wink

    Well, besides that, it’s a very usefull snippet. For my site I only missed an option to show only the summary (introtext) in the tooltips, because the text in the content can be to long.

    So, I decided to make an addition to the snippet and added the parameter &showInfo, which values can be `intro` to show only the summary (introtext), `content` to show only the content and `both` to show both introtext and content (duh...), which is the default value. Added this little explanation in the snippet itself.

    If anyone has use for it, I post it here. It’s only the part of the snippet you should copy/paste into the Manager.
      • 34162
      • 1 Posts
      I had this snippet working, but suddenly I got this error:

      « MODx Parse Error »
      MODx encountered the following error while attempting to parse the requested resource:
      « PHP Parse Error »

      PHP error debug
      Error: Unknown(): URL file-access is disabled in the server configuration
      Error type/ Nr.: Warning - 2
      File: /home/vhosts/betaalbaresite.nl/subdomains/montessori/httpdocs/manager/includes/document.parser.class.inc.php(748) : eval()’d code
      Line: 225

      Parser timing
      MySQL: 0.0540 s (5 Requests)
      PHP: 0.1166 s
      Total: 0.1706 s

      Is this something my provider has changed, or can I do something to get it working again? huh

      I use Modx version: 0.9.5 with PHP version: 4.3.11
        • 34162
        • 1 Posts
        I contacted my provider and this is their answer (partly, translated from dutch):

        ’From this moment on, it’s not possible anymore to include external URLs in PHP with the command "fopen" (allow_url_fopen). This is done for security reasons (...). There are possibilities to include urls by using Perl. The include variable should be altered with a Perl script, which takes care of the include.’

        Then they give this Perl example:
        #!/usr/bin/perl
        
        use LWP::Simple;
        $ext = "http://extern.url";
        print get($ext);
        


        and the php-code how to use this:

        <?
        $string = "perl /home/vhosts/uwdomein.nl/cgi-bin/include.cgi";
        exec ($string, $buffer);
        $result = implode("\n", $buffer);
        $result = str_replace("Content-type: text/html\n", "", $result);
        echo $result;
        ?>
        


        What I don’t understand is in which way the Kalender snippet uses an ’external’ url call? Or is the url http://domainname.com/index.php?id=49&mo=5&yr=2007 seen as external?

        Isn’t there another solution to this problem?

          • 34162
          • 1 Posts
          Well, I must say that the helpdesk of my provider really tries to help me. They even turned off the safety setting for external includes for 10 minutes to test the snippet smiley

          As it turned out even then the snippet doesn’t work. So, they conluded that there has to be a path that’s wrong or something like that.

          Looking into the code, I changed this code
          $pathPrefix = "[(site_url)]assets/snippets/kalender";
          $themePath = $pathPrefix."/themes/".$theme."/";
          $includePath = $assets_path.$snippetsPath."/themes/".$theme."/";


          into this:
          $pathPrefix = "assets/snippets/kalender";
          $themePath = $pathPrefix."/themes/".$theme."/";
          $includePath = $pathPrefix."/themes/".$theme."/";


          and now the calendar works again cool

          I intend to look further into the code to see if I can improve some things.

          One of them will be how to use different languages as setlocale() doesn’t seem to have any effects at all. For what I’ve seen so far is that the first characters of the days are hardcoded into the snippet...

          When I have some results, I will post it here
            • 34162
            • 1 Posts
            As promised, I looked in the code and made some changes to the snippet. smiley

            Added 4 new parameters to make it more flexible in use. Also added the newest overLib 4.21 files. Because of these changes I named it version 1.1

            I posted it in the repository, so you can find it here

            Wanted to add it to the original submission of Kalender, but since this is my first submission to the repository, it’s added as a new one (oops). undecided

            If someone can move it and add it to the original submission of Kalender, please do.
              • 29181
              • 480 Posts
              Quote from: 0ad at Feb 11, 2007, 12:55 PM

              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

              And to you oad, that worked a treat. Thanks!
                Adrian Lawley: www.adrianlawley.com
                • 4971
                • 964 Posts
                Does anybody know how to hightlite the current day in Kalender??
                THanks...
                  Website: www.mercologia.com
                  MODX Revo Tutorials:  www.modxperience.com

                  MODX Professional Partner
                  • 34162
                  • 1 Posts
                  Quote from: charliez at Apr 11, 2007, 07:46 PM

                  Does anybody know how to hightlite the current day in Kalender??
                  THanks...

                  I have the solution for you. cool Not only have I changed the snippets code, but also added a new class .kalender-dayCurrent to the css file so you can style it the way you want.

                  Now I’m looking into the code to see if I can achieve that dates with events can be made linkable to their pages. When I can get this working, I will post a new version to the repository.

                  For now, I post the new snippetcode here and also the css file which you should upload to your assets/snippets/kalender/themes/gold directory.


                    • 4971
                    • 964 Posts
                    WeBe, thanks a lot... works fine... now that I see the changes, I should have done it myself
                    instead of asking embarrassed , but thanks again anyway...
                      Website: www.mercologia.com
                      MODX Revo Tutorials:  www.modxperience.com

                      MODX Professional Partner
                      • 34162
                      • 1 Posts
                      You’re right that this addition isn’t that difficult to achieve. Only thing is that it’s not your own code, so you have to dig into it and find the right place to insert the changes.

                      This is also the hard part to find out where I can make the changes to make dates with events linkable. I’m not a php guru, so it can take a while before I figure this one out. shocked