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
into the two blocks of page parameter code - beneath the lines
and
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.