We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22687
    • 19 Posts
    How i got the instructions for ’MaxiGallery: Front end user created galleries’ from the wiki to work.

    I decided to post this to save a few newbies like myself too much searching.
    I am using modx 0.9.6.3 rev 4565
    on a hosted server running -
    Apache version 1.3.41 (Unix)
    PHP version 5.2.5
    MySQL version 4.1.22-standard


    My first attempt to get the front end user galleries working went horribly wrong because i made some stupid assumptions.
    The first of these was that the NewsPublisher snippet was an update of the snippets mentioned on the old wiki page - Wrong... NewsPublisher is something completely different.
    Where the wiki says that you need the snippets:
    * MaxiGallery v0.4.1
    * MaxiGallerySolo v1.1
    * Ditto v1.0.2
    * NewsEditor v1.0
    * NewsManager v1.3
    * TinyMCE v2.0.8
    It means that you will need them ALL - even though MaxiGallerySolo is deprecated according to the modx download page.
    I spent ages looking for NewsEditor - don’t bother, it is included with the NewsManager download.

    Many of the snippet calls that the wiki provides use outdated syntax - luckily the snippets seem to have been written to reparse these old calls.

    Once I had all of these snippets installed - something resembling a working setup could be seen. it just didnt work properly, blank pages loading on create, and no front end editing.
    --------
    First of all I found that MaxiGallerySolo, as it is downloaded, is broken.
    Thankfully Doze and Dimmy have posted fixes here - thanks Guys.
    Dimmy’s fix
    http://modxcms.com/forums/index.php?action=dlattach;topic=7293.0;attach=4286
    Doze’s fix
    http://modxcms.com/forums/index.php/topic,7293.msg69217.html#msg69217

    you will need one of these fixes if you get an error something like this

    « MODx Parse Error »

    MODx encountered the following error while attempting to parse the requested resource:
    « `` is not numeric and may not be passed to makeUrl() »

    Or if the create page leads to a blank page.
    I recommend Dimmy’s rewrite.

    Once mended with this fix the gallery will begin to work - with the exception that a front end user will only be able to edit or load images onto a page that has had its cacheable checkbox unchecked. The page that gets created by the NewsEditor routine is made cacheable by default - no matter what the parent container is set to - and this means that the frontend user wont be able to edit it.
    ---------
    Secondly to make the NewsEditor snippet create an uncached page every time it is called you will need to add two lines of code.
    like so:

    add the code
    'cacheable'   => '0',


    into the two blocks of page parameter code - beneath the lines
    287 	'parent'      => $folder, 

    and
    309 	'parent'      => $folder, 


    so that it looks like this

      // 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)
            );
            $redirectid = $modx->db->insert($flds,$modx->getFullTableName('site_content'));


    I will attach the whole altered text of the snippet below.

    Once I had done this the front end system worked really well, at least so far, I will amend this If I find any more glitches.

    I have noticed that the cacheable problem seems to crop up a lot in forums dealing with this installation, and that the solutions offered range from changing ini.php files to using other snippets just to uncheck the cacheable box from the frontend. But most commonly the advice that is offered is to make sure that &clearcache=`1` is used - while it is neccessary, it doesn’t cure the problem, whereas altering the NewsEditor snippet does.

    I hope that this is useful.
    If you have any other fixes that you have needed to do to make this basic installation work - please add them to this post.
      • 7923
      • 4,213 Posts
      Good job, thanks for the write up!

      That wiki article is indeed quite old.. MaxiGallery can now do anything that MaxiGallerySolo did, so that’s why MaxiGallerySolo is deprecated. Also FDM snippet is now used instead of NewsEditor AFAIK. I haven’t used FDM my self and have read that there are some bugs in it that you need to work around, but your setup is as good as any other if it works ok.

      So thanks for this, I’ll note this thread in the sticky topic.


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 7155
        • 160 Posts
        nice. its parfitt perfect for now wink

        (couldnt help it)
          • 22687
          • 19 Posts
          Quote from: designetic at Jul 22, 2009, 08:43 AM

          nice. its parfitt perfect for now wink

          (couldnt help it)

          Erm... no-one has made a joke like that since I was at school. and that was ages ago - I suppose I should thank you for making me feel young again. lol.