We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25215
    • 32 Posts
    Hi there,

    I’m playing about with Jot (the default version with 0.9.5) for the first time and I seem to be getting an error just calling the snippet. I’ve got a chunk called inside my template which includes following Jot call:

    [!Jot? &customfields=`name,email` &subscribe=`1` &pagination=`4` &badwords=`dotNet` &canmoderate=`Site Admins` !]


    When viewing the page, I’m getting the error:

    Fatal error: Call to undefined function: file_get_contents() in /home/httpd/vhosts/freeagentcentral.co.uk/httpdocs/assets/snippets/jot/includes/chunkie.class.inc.php on line 45

    The offending section of the chunkie.class.inc.php file is

    function getTemplate($tpl){
    		global $modx;
    		$template = "";
    		if ($modx->getChunk($tpl) != "") {
    			$template = $modx->getChunk($tpl);
    		} else if(is_file($tpl)) {
    			$template = file_get_contents($tpl);
    		} else {
    			$template = $tpl;
    		}
    		return $template;
    	}


    I haven’t tried to customise the snippet in any way so I’m thinking the error my be a set up issue. Anyone got any ideas?

    Thanks in advance.

    EDIT: Using PHP Version 4.2.2 if that’s of any use?
      • 11975
      • 2,542 Posts
      The file_get_contents requires php>= 4.3

      :-)
        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
        • 25215
        • 32 Posts
        ahh...that’ll explain it then smiley

        Is there any sort of workaround?

        Thanks for your help
          • 4626
          • 57 Posts
          You could probably download PHP_Compat from: http://pear.php.net/package/PHP_Compat
          and copy the file_get_contents function to the Jot-folder. In the jot.class.inc.php-file add:
          include_once('file_get_contents.php');

          at the top, before the line with:
          class CJot {


          Hope this works (haven’t tested it because I have PHP 4.3)... You can probably do it with a plugin or directly in the Jot-snippet aswell...