We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36592
    • 970 Posts
    Quote from: LFK at Nov 14, 2008, 05:55 AM

    I’ve tried to install FDM and it doesn’t work. When I click on module to install snippet...
    Why ’module’ ?
    It’s a ’snippet’ ! wink
      • 36624
      • 535 Posts
      Quote from: LFK at Nov 14, 2008, 06:44 AM

      I tried, but anyway snippet doesn’t work correctly... Smth wrong... but what?! huh
      hum hum .. we cannot really help you with this kind of sentences smiley




      try to change the [[ to [!
      grin

        CTRL+SHIFT+U - Clear Cache
        CTRL+SHIFT+H - Hiding Heft Panel
        CTRL+SHIFT+N - Fast Create Resource
        CTRL+ALT+P - Preview Recource (in edit resorce window)
        CTRL+ALT+S - Save
        • 18206
        • 59 Posts
        Hello,
        I think I’ve found a bug on line 330 in the file fdm.class.inc.php:

        [tt]
        foreach ($out[0] as $word){
        if (strlen($word)>3)
        {
        $rest = substr($word, 1, strlen($word)-2);
        $val= $docObj->Get($rest);
        $newalias=str_replace($word,$val, $newalias);
        } else {
        $rest = substr($word, 0, strlen($word)-1);
        $val=strftime ( $rest  ,$datefield);
        $newalias=str_replace($word,$val, $newalias);
        }
        [/tt]

        I assume $datefield contains a string (’createdon’, ’publishedon’ and so forth..) when it in fact needs to contain a timestamp.
        A simple work around solution is to just remove the , $datefield part, but then it will always insert the current time (essentially ’createdon’, plus some milliseconds)

        edit: possible fix?
        [tt]
        $newalias=$_SESSION[’fdm’][’aliastype’]; // ie:%pagetitle_le%d-%m-%y
        $datefield=$_SESSION[’fdm’][’aliasdate’]; // ie:editedon ,createdon, publishedon or deletedon
        $dateval = $docObj->Get($datefield);
        preg_match_all(’/%[^%]+%/’,$newalias,$out);
        if (is_array($out))
        {
        foreach ($out[0] as $word){
        if (strlen($word)>3)
        {
        $rest = substr($word, 1, strlen($word)-2);
        $val= $docObj->Get($rest);
        $newalias=str_replace($word,$val, $newalias);
        } else {
        $rest = substr($word, 0, strlen($word)-1);
        $val=strftime ( $rest ,$dateval);
        $newalias=str_replace($word,$val, $newalias);
        }
        }
        [/tt]
          • 26931
          • 2,314 Posts
          Hi there,

          when i call the snippet with [!FDM!] and i try to edit the document i get this error-message:
          Fatal error: Non-static method CFDM::mergeFields() cannot be called statically in c:\programme\e-novative\WAMP\www\modxtest\assets\snippets\eform\eform.inc.php on line 604
          does anybody know what this means, and how to solve it? btw. to unpublish the document works

          ...first i tried to install it as a module, but it didn’t work...so i deleted the module and kept it as a snippet, so i wonder what would be the benefit of having it installed as a module rather than just the snippet?

          thank you & regards, j

          ** and this was the error i got installing the module, although the snippet and chunk were created and the install directory erased...:
          c:/programme/e-novative/WAMP/www/modxtest2/assets/snippets/FDM/install/[snippet]FDM.php not found.
          Installation des Chunks.

          c:/programme/e-novative/WAMP/www/modxtest2/assets/snippets/FDM/install/[chunk]FDMeFormTpl_FR.html not found.

          Warning: opendir(c:/programme/e-novative/WAMP/www/modxtest2/assets/snippets/FDM/install/) [function.opendir]: failed to open dir: Invalid argument in c:\programme\e-novative\WAMP\www\modxtest2\assets\snippets\FDM\includes\install.class.inc.php on line 103

          Warning: readdir(): supplied argument is not a valid Directory resource in c:\programme\e-novative\WAMP\www\modxtest2\assets\snippets\FDM\includes\install.class.inc.php on line 104

          Warning: closedir(): supplied argument is not a valid Directory resource in c:\programme\e-novative\WAMP\www\modxtest2\assets\snippets\FDM\includes\install.class.inc.php on line 112

          Can’t erase c:/programme/e-novative/WAMP/www/modxtest2/assets/snippets/FDM/install/ This directory is no more needed
            • 10076
            • 1,024 Posts
            probably doing something wrong, wrong perception of stuff.
            I would like to be able to define:

            • the template used by document one adds
            • fill a title for the document, got that.
            • use a summary (introtext)
            • give it content, got that.
            • make it not show in menu
            • make it published, got that.

            This is the call I use
            [!FDM? &parent=`2` &disablepublish=`1`&disabledelete=`1`&eform_tpl=`fdmEform` &disableunpublish=`0`&canpost=`WebUsers` !]


            And the fdmEform code

            [+validationmessage+]
            <form method="post" action="[~[*id*]~]"  id="fdmEform">
            <fieldset>
            	<legend>Document</legend>
            	<input type="hidden" name="formid" value="fdmEForm" />
            	<p><label for="pagetitle">Titel</label><input name="pagetitle" id ="pagetitle" value="[+pagetitle+]" type="text" eform="Titel:string:1" /></p>
            	<p><label for="summary">Summary</label><input name="summary" id ="summary" value="[+summary+]" type="text"  /></p>
            		<p><label for="description">Description</label><br /><textarea name="description" id="description" rows="5" cols="50"  eform="Description:html:1">[+description+]</textarea></p>
            	</fieldset>
            	<p>
            	<input name="fdmsubmit" value="Post" type="submit" />  
            	</p>
            </form>
            
            
            <script language="JavaScript" src="manager/media/script/datefunctions.js"></script>
            <script type="text/javascript">
            	var elm_txt = {}; // dummy
            	var pub = document.forms["fdmForm"].elements["pub_date"];
            	var nwpub_cal1 = new calendar1(pub,elm_txt);
            	nwpub_cal1.path="[(base_url)]manager/media/";
            	nwpub_cal1.year_scroll = true;
            	nwpub_cal1.time_comp = true;
            </script>
            


            The created pages reside in a container and are displayed by this ditto call
            [[Ditto? &debug=`0` &startID=`2` &summarize=`10` &depth=`1` &total=`20` &paginate=`1` &tpl=`techniek` &sortDir=`ASC` &mode=`development´ &paginateAlwaysShowLinks=`read more` &extenders=`summary` &sortBy=`menuindex` &trunc=`0`]] 


            Problem is that there is no summary, therefor no link to the text. And the FDM shows in these docs as well.
            I dont want that. I want subscribed users to be able to add "small adds" to the site.
              • 9941
              • 65 Posts
              Hey I’m working with FDM and when I use it via IE6 or 7 the PHP session is not working. Anyone else have this experience.... ie: when I go to add a page it just reloads without submitting anything. It really looks like the session is not going through but it’s hard to tell since IE gives no feedback and there is not a firebug type app to see the post/response data.

              I’ve checked all the usual problems with IE and session data, ie: no underscores in my host name, the server time is set properly and it’s using the ModX session so all the headers are set properly.... Iv’e got no idea and just want to make sure that I’m the only one or not... so anyone else have issues with IE and this snippet?



                • 23515
                • 40 Posts
                After back reading I’m still a little confused.

                Is it possible to make an upload field that drops the file into a predetermined folder, that cannot be seen by the user? It looks like people are using tiny mce, is it possible to create a tiny mce instance that just has an upload form in it, with no file browsing capabilities? Obviously this needs to be accessible by web users rather than just managers. Apologies if this has allready been covered, Friday afternoon and all that.

                Ahh where are my manners; thanks very much to soda and everyone involved for making this awesome snippet, could be very influential in pushing modx (even further) forward.
                  • 9941
                  • 65 Posts
                  Hey all, just replying to my own post, see a few back.... I was having trouble with IE and FDM.... well I solved my problem and I’m posting now to help others avoid this issue and possibly receive a workaround suggestion.

                  SO I had been using an IMAGE input, ie: input type="image" which apparently does not ’just work’ in IE. I believe it needs to send the x/y coordinates for IE to utilize it correctly though I had thought this only applied to .Net postbacks in ASP applications - not PHP sessions.

                  In any case as soon as I switched my submit button to an input type="submit" everything worked perfectly. I finally turned on debug to see what the session array was being set to and seeing the same results in IE as other browsers made me question my initial hypothesis, which reminded me of the x/y thing with image inputs and prompted me to try changing to a standard input. Thank goodness, cause my app is due for functional review next wednesday and I’ve been looking for the fix for 2 weeks now.

                  Any Microsoft familiar developers know what specific quirks IE needs to allow PHP session data to be posted using an image input? Do I need to add in variables to hold the x/y of the click (which BTW happens automatically with a GET) or what?




                    • 27147
                    • 53 Posts
                    You could use <button> instead. Article
                      • 9941
                      • 65 Posts
                      Quote from: shuriken at Dec 20, 2008, 02:29 AM

                      You could use <button> instead. Article

                      Nice article, thanks.