thank-you!
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.
[!MaxiGallery? &display=`childgalleries` &manager_webgroups=`Registered`!]
[!MaxiGallery? &display=`embedded` &embedtype=`slimbox` &pics_per_row=`3` &max_thumb_size=`110` &max_pic_size=`0` &thumb_use_dropshadow=`1`!]
wow
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.
'cacheable' =>$nocache
// 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'));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.
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.
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
// 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)
);'cacheable' => '0',
// 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)
);