Yes. Try this and let me know how it goes:
Is it possible to select pictures by they owner ids (own_id in maxigallery sql base).
I dont find anyresponse for this , do i have to create a snippet to fill the &pic_query_ids field? If the answer is yes, could you help me to write it?
<?php
//Snippet: GetWebUserPicIds
//Usage: [!GetWebUserPicIds? &username=`somewebuser`!] or to save db queries [!GetWebUserPicIds? &userid=`99`!] where 99 is the web users id.
$mgTblName = (isset($mgTblName)) ? $mgTblName : "maxigallery"; // MaxiGallery database table name
$username = (isset($username)) ? $username : '';
$userid = (isset($userid)) ? $userid : '';
if ($userid = '' && $username == ''){
$modx->logEvent(1, 3, "GetWebUserPicIds: Error - Neither username or user id was supplied");
return;
}
$own_id = 0;
$picsTbl = $modx->db->config['dbase'].".".$modx->db->config['table_prefix'].$mgTblName;
if ($userid == '') {
$sql = "SELECT id FROM ".$modx->getFullTableName("web_users")." WHERE username='$username'";
if(!$rs = $modx->db->query($sql)){
$modx->logEvent(1, 3, "GetWebUserPicIds: Error - Could not execute the query to select id for username ($sql)");
return;
}
$limit = $modx->db->getRecordCount($rs);
if($limit>0) {
$row = $modx->fetchRow($rs);
$own_id = $row['id'];
} else {
$modx->logEvent(1, 1, "GetWebUserPicIds: Username ($username) was not found from MODx web users");
return;
}
} else {
$own_id = $userid;
}
$sql = "SELECT id FROM ".$picsTbl." WHERE own_id=".$own_id;
$picIdArr = array();
if(!$rs = $modx->db->query($sql)){
$modx->logEvent(1, 3, "GetWebUserPicIds: Error - Could not execute the query to find pictures for set web user ($sql)");
return;
}
$limit = $modx->db->getRecordCount($rs);
if($limit>0) {
while ($row = $modx->db->getRow($rs)) {
array_push($picIdArr, $row['id']);
}
return implode(",", $picIdArr);
} else {
$modx->logEvent(1, 1, "GetWebUserPicIds: No pictures for supplied username/id ($username/$own_id) found.");
return;
}
?>
<?php
$username = (isset($username)) ? $username : '';
$params = array();
$params['username'] = $username;
$picIds = $modx->runSnippet('GetWebUserPicIds', $params);
$params = array();
$params['pic_query_ids'] = "$picIds";
$params['display'] = "embedded";
$params['embedtype'] = "slimbox";
$params['pics_per_row'] = "3";
$params['clearerTpl'] = "";
$params['galleryPictureTpl'] = "tpl2";
$params['galleryOuterTpl'] = "tpl1";
$params['css'] = "xxx.css";
$galleryOutput = $modx->runSnippet('MaxiGallery', $params);
return $galleryOutput;
?>

Try setting the document not cacheable and set every snippet call cached