We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7923
    • 4,213 Posts
    Yes.. just like it has always been. You just need to setup a system what creates a document that has maxigallery call in it with &web_users parameter and it has the current web user name to the parameter value.

    You could for example create a TV where you store the username, for example tv named "gallerywebuser". When you create the new document from frontend with FDM for example, have it put the currently logged in webuser name to the "gallerywebuser" TV. The make the document use a template that has the maxigallery call in it like:

    [!MaxiGallery? &manager_webusers=`[*gallerywebuser*]`!]

    Now when a web user creates the new gallery document with FDM from front end, he will be able to manage the pictures in that gallery.


      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
      • 7155
      • 160 Posts
      Quote from: doze at Jul 01, 2009, 04:34 PM

      Yes.. just like it has always been. You just need to setup a system what creates a document that has maxigallery call in it with &web_users parameter and it has the current web user name to the parameter value.

      You could for example create a TV where you store the username, for example tv named "gallerywebuser". When you create the new document from frontend with FDM for example, have it put the currently logged in webuser name to the "gallerywebuser" TV. The make the document use a template that has the maxigallery call in it like:

      [!MaxiGallery? &manager_webusers=`[*gallerywebuser*]`!]

      Now when a web user creates the new gallery document with FDM from front end, he will be able to manage the pictures in that gallery.
      thank-you!
        • 7155
        • 160 Posts
        Sorry to nag you once gain, but still on the same issue. I did read through the WIKI

        I want to have users create and manage their own galleries.

        My snippet call on the protected document accessible to the group "Registered" is:

        [!MaxiGallery? &display=`childgalleries` &manager_webgroups=`Registered`!]
        (belongs to a document group associated with "Registered" users)

        Then I have a child document which is also protected likewise, with this call:

        [!MaxiGallery? &display=`embedded` &embedtype=`slimbox` &pics_per_row=`3` &max_thumb_size=`110` &max_pic_size=`0` &thumb_use_dropshadow=`1`!] 


        Is that sufficient for users to be able to create and manage their own website?

        How do I also have a setup where I have one document to contain links/thumbnails to all submitted user galleries BUT the submission page is not a child of that document.

        Something like this:

        Galleries (overall container)
        -User Galleries( container for all user submitted galleries)
        -Submit Gallery (page used when a user submits)

        Or maybe it is not necessary?

        Thanks for your patience!
          • 7923
          • 4,213 Posts
          What do you mean by user submitted galleries? Do you mean that:

          1. there would be a single gallery where users belonging to certain web group could upload and manage their own pictures?
          2. there would be a single gallery where users belonging to certain web group could upload and manage all pictures?
          3. there would be separate gallery documents for each web user?

          The setup for above galleries is:

          1. In each maxigallery call, use &manager_webgroups=`Registered`. Then web users belonging to a web group called "Registered" can upload and manage their own pictures in this gallery.
          2. In each maxigallery call, use &admin_webgroups=`Registered`. Then web users belonging to a web group called "Registered" can upload and manage all pictures in this gallery.
          3. You need a separate snippet to create new MODx documents from front end, for example FDM. Then you would create a new template that has maxigallery call like this [!MaxiGallery? &manager_webusers=`[*mg_webuser*]`!]. Then you would create a new text type template variable named "mg_webuser" and assign it the previously created template. Then you would configure the snippet that creates new MODx documents from front end to set the currently logged in web user name to the "mg_webuser" TV for new documents and use that site template that you created.


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."
            • 7155
            • 160 Posts
            Quote from: doze at Jul 02, 2009, 02:40 PM

            What do you mean by user submitted galleries? Do you mean that:

            1. there would be a single gallery where users belonging to certain web group could upload and manage their own pictures?
            2. there would be a single gallery where users belonging to certain web group could upload and manage all pictures?
            3. there would be separate gallery documents for each web user?

            The setup for above galleries is:

            1. In each maxigallery call, use &manager_webgroups=`Registered`. Then web users belonging to a web group called "Registered" can upload and manage their own pictures in this gallery.
            2. In each maxigallery call, use &admin_webgroups=`Registered`. Then web users belonging to a web group called "Registered" can upload and manage all pictures in this gallery.
            3. You need a separate snippet to create new MODx documents from front end, for example FDM. Then you would create a new template that has maxigallery call like this [!MaxiGallery? &manager_webusers=`[*mg_webuser*]`!]. Then you would create a new text type template variable named "mg_webuser" and assign it the previously created template. Then you would configure the snippet that creates new MODx documents from front end to set the currently logged in web user name to the "mg_webuser" TV for new documents and use that site template that you created.
            wow

            thanks doze. helpful as always

            I wanted option 1 but could consider option 3.

            have a great day!
              • 22687
              • 19 Posts
              It seems that maxiGallerySolo is marked as deprecated - and that NewsEditor no longer exists on the modx site.

              edit: OK so I’m just a bit slow on the uptake - maxiGallerySolo as got from the modx reposiory is broken, but doze has added a fix in the forums - and there is a flourish on the fix by Dimmy - cant remember the exact thread though.

              I have spent several days trying to get the frontend user galleries working and am now absolutely confused - there are so many contradictory threads about it, the wiki appears to be so out of date that it is quite misleading. At least that is the conclusion that I have reached.

              Edit: spent ages looking for a ’newseditor’ snippet - didn’t read the small print - its included with the newsmanager snippet.

              I would be happy to update the wiki - but am reluctant to do it until I have actually got something working.

              So my question is - Is it still possible to create a frontend user gallery?
              and if so do you still need to find a copy of newseditor somewhere - or has its functionality been superceeded by something else.

              Edit: The result of this is i finally got the thing to work - except that the new pages are being generated as cacheable - so frontend users cant add images until someone has made the pages uncacheable from the back end. (yep I tried changing the system settings too) - so delighted that the thing works that I think I’ll just learn to live with it for now - thanks Doze.

                • 22687
                • 19 Posts
                Looking a bit deeper into this caching problem that seems to affect the newly generated pages that NewsEditor creates. I have noticed that the NewsEditor snippet sets almost all of the parameters for the newly created page except whether or not it is cacheable. The &clearchache=`1` directive clears the cache but it doesn’t set the page cacheable flag to 0 or uncacheable.

                I mention this in the hope that some genius will take a look and say something like...
                add the parameter &nocache=0 and insert
                'cacheable' =>$nocache


                to the snippet just after the ’parent’ lines below:
                      // post news content
                      if ($docrs) {
                        $flds = array(
                          'pagetitle'   => $title,
                          'longtitle'   => $longtitle,
                          'description' => $description,
                          'introtext'   => $introtext,
                          'alias'       => $alias,
                          'parent'      => $folder, 
                          'editedon'    => $createdon,
                          'editedby'    => ($userid>0 ? $userid * -1:0),
                          'published'   => $published,
                          'pub_date'    => $pub_date,
                          'unpub_date'  => $unpub_date,
                          'deleted'     => '0',
                          'hidemenu'    => $hidemenu,
                          'menuindex'   => $mnuidx,
                          'template'    => $template,
                          'content'     => mysql_escape_string($header.$content.$footer)
                        );
                        $modx->db->update($flds, $modx->getFullTableName('site_content'), "id =$editid");
                      }
                      else {
                        $flds = array(
                          'pagetitle'   => $title,
                          'longtitle'   => $longtitle,
                          'description' => $description,
                          'introtext'   => $introtext,
                          'alias'       => $alias,
                          'parent'      => $folder, 
                          'createdon'   => $createdon,
                          'createdby'   => ($userid>0 ? $userid * -1:0),
                          'editedon'    => '0',
                          'editedby'    => '0',
                          'published'   => $published,
                          'pub_date'    => $pub_date,
                          'unpub_date'  => $unpub_date,
                          'deleted'     => '0',
                          'hidemenu'    => $hidemenu,
                          'menuindex'   => $mnuidx,
                          'template'    => $template,
                          'content'     => mysql_escape_string($header.$content.$footer)
                        );
                        $redirectid = $modx->db->insert($flds,$modx->getFullTableName('site_content'));


                sadly My knowledge of modx, and scripting for that matter, isn’t up to the challenge.
                any thoughts?
                  • 3749
                  • 24,544 Posts
                  Quote from: parfitt at Jul 19, 2009, 07:02 AM

                  Edit: The result of this is i finally got the thing to work - except that the new pages are being generated as cacheable - so frontend users cant add images until someone has made the pages uncacheable from the back end. (yep I tried changing the system settings too) - so delighted that the thing works that I think I’ll just learn to live with it for now - thanks Doze.
                  Have you tried having the pages created under a container that is set to uncached? I’m not sure, but I think the new pages will inherit that setting.

                  If not, there’s a version of NewsPublisher attached to this forum message that has a &clearcache=`1` parameter: http://modxcms.com/forums/index.php/topic,920.msg5912.html#msg5912
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting
                    • 22687
                    • 19 Posts
                    Quote from: BobRay at Jul 20, 2009, 03:54 AM

                    BobRay said...
                    Have you tried having the pages created under a container that is set to uncached? I’m not sure, but I think the new pages will inherit that setting.

                    If not, there’s a version of NewsPublisher attached to this forum message that has a &clearcache=`1` parameter: http://modxcms.com/forums/index.php/topic,920.msg5912.html#msg5912


                    Yes Bob, I have tried having the pages created under a container that is set to uncached. The gallery container is set to uncached - the container doesn’t seem to affect the new gallery page, I think its because they are created by newsEditor from scratch, using a different template and then added as children.

                    My point was that all the parameter &clearcache=`1` does is purge the cache at the time of the documents creation - it doesn’t alter the other cache parameter, namely whether the doc is cachable or not.
                    With the ’maxigallery as front end...’ setup, the user galleries can only be edited if the cacheable flag is set to `0` (which is different from just clearing the cache)- and this can only be done from the backend it seems.
                      • 22687
                      • 19 Posts
                      OK, after my last post I decided to bite the bullet and try out the code i suggested above, or something similar. And what do you know... It seems to work.
                      So to rid the ’Create front-end user galleries’ setup of the dreaded cache problem ~ do this...

                      I made a copy of the newsEditor snippet (just in case) and called it NewsEditor2.
                      Then changed all references to the older NewsEditor to read NewsEditor2 (in the gallery creator page)

                      Then open the NewsEditor2 snippet and find this code:

                       // set menu index
                            $mnuidx = $modx->db->getValue('SELECT MAX(menuindex)+1 as \'mnuidx\' FROM '.$modx->getFullTableName('site_content').' WHERE parent=\''.$folder.'\'');
                            if($mnuidx<1) $mnuidx = 0;
                      
                            // post news content
                            if ($docrs) {
                              $flds = array(
                                'pagetitle'   => $title,
                                'longtitle'   => $longtitle,
                                'description' => $description,
                                'introtext'   => $introtext,
                                'alias'       => $alias,
                                'parent'      => $folder, 
                                'editedon'    => $createdon,
                                'editedby'    => ($userid>0 ? $userid * -1:0),
                                'published'   => $published,
                                'pub_date'    => $pub_date,
                                'unpub_date'  => $unpub_date,
                                'deleted'     => '0',
                                'hidemenu'    => $hidemenu,
                                'menuindex'   => $mnuidx,
                                'template'    => $template,
                                'content'     => mysql_escape_string($header.$content.$footer)
                              );
                              $modx->db->update($flds, $modx->getFullTableName('site_content'), "id =$editid");
                            }
                            else {
                              $flds = array(
                                'pagetitle'   => $title,
                                'longtitle'   => $longtitle,
                                'description' => $description,
                                'introtext'   => $introtext,
                                'alias'       => $alias,
                                'parent'      => $folder, 
                                'createdon'   => $createdon,
                                'createdby'   => ($userid>0 ? $userid * -1:0),
                                'editedon'    => '0',
                                'editedby'    => '0',
                                'published'   => $published,
                                'pub_date'    => $pub_date,
                                'unpub_date'  => $unpub_date,
                                'deleted'     => '0',
                                'hidemenu'    => $hidemenu,
                                'menuindex'   => $mnuidx,
                                'template'    => $template,
                                'content'     => mysql_escape_string($header.$content.$footer)
                              );


                      Add this code
                                'cacheable'   => '0',

                      underneath BOTH lines that read: ’parent’ => $folder,
                      So you end up with this (the added code is not indented here, so you can find it):
                       // set menu index
                            $mnuidx = $modx->db->getValue('SELECT MAX(menuindex)+1 as \'mnuidx\' FROM '.$modx->getFullTableName('site_content').' WHERE parent=\''.$folder.'\'');
                            if($mnuidx<1) $mnuidx = 0;
                      
                            // post news content
                            if ($docrs) {
                              $flds = array(
                                'pagetitle'   => $title,
                                'longtitle'   => $longtitle,
                                'description' => $description,
                                'introtext'   => $introtext,
                                'alias'       => $alias,
                                'parent'      => $folder, 
                      'cacheable'   => '0',
                                'editedon'    => $createdon,
                                'editedby'    => ($userid>0 ? $userid * -1:0),
                                'published'   => $published,
                                'pub_date'    => $pub_date,
                                'unpub_date'  => $unpub_date,
                                'deleted'     => '0',
                                'hidemenu'    => $hidemenu,
                                'menuindex'   => $mnuidx,
                                'template'    => $template,
                                'content'     => mysql_escape_string($header.$content.$footer)
                              );
                              $modx->db->update($flds, $modx->getFullTableName('site_content'), "id =$editid");
                            }
                            else {
                              $flds = array(
                                'pagetitle'   => $title,
                                'longtitle'   => $longtitle,
                                'description' => $description,
                                'introtext'   => $introtext,
                                'alias'       => $alias,
                                'parent'      => $folder, 
                      'cacheable'   => '0',
                                'createdon'   => $createdon,
                                'createdby'   => ($userid>0 ? $userid * -1:0),
                                'editedon'    => '0',
                                'editedby'    => '0',
                                'published'   => $published,
                                'pub_date'    => $pub_date,
                                'unpub_date'  => $unpub_date,
                                'deleted'     => '0',
                                'hidemenu'    => $hidemenu,
                                'menuindex'   => $mnuidx,
                                'template'    => $template,
                                'content'     => mysql_escape_string($header.$content.$footer)
                              );


                      Then save the snippet.

                      The gallery creator page will now create a page that has the cacheable tickbox unticked - and the frontend user will be able to edit the gallery (without the need to have the new page made uncacheable from the backend first).

                      Of course there is a problem with this change - It means that NewsEditor2 will always make an uncacheable page, which may well interfere with its functionality for uses other than with maxigallery.
                      Ideally the change should have been added as a parameter that could be set through the snippet call - something like: &cacheable=`0` But it works for what I need it for, so I will leave that for someone else.