-
- 70 Posts
Hi to all,
first at all, I would like to thank you all for creating THE best CMS ever...I have tried many (mambo, yoomla,...), and even created my own (with my team) but nothing can be compared to MODx...Great, great, great....
About MaxiGallerySolo: I had Solo call in template, and everything worked great...Today, I have tried to change pictures in gallery from test pictures to real ones, and site stop responding...
Problem was that MaxyGallerySolo needs at least one picture in real gallery (the one linked in Solo &galIDs=`xx’ tag). If you delete all gallery pictures, whole site will crash...
Sorry if this issue is already discussed earlier...
With regards,
Ivan Mandic
Kragujevac, Serbia
www.imandic.com (modx playground site)
--
www.spotkg.com
-
- 4,213 Posts
Yea, it sucks..
Hopefully you don’t need it after next MaxiGallery release.
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
-
- 1 Posts
To Resolve this problem just insert a check:
if(isset($galIDs)){
$pics_to_show = isset($pics_to_show) ? $pics_to_show - 1 : 0;
$type = isset($type) ? $type : "latest";
$open = isset($open) ? $open : "lightbox";
$language = isset($language) ? $language : "en";
$galIDs = str_replace(",", "’,’", $galIDs);
$pics=$modx->getIntTableRows("*","maxigallery", "gal_id IN (’" . $galIDs . "’)","pos,date","DESC");
if(count($pics)!=’0’){
if($type == "random"){
shuffle($pics);
}
if($open=="lightbox"){
$forcount = count($pics);
}else{
$forcount = $pics_to_show+1;
}
for($i = 0; $i < $forcount; $i++) {
$pic = $pics[$i];
$path_to_gal = "assets/galleries/".$pic[’gal_id’]."/";
$file = $modx->config[’site_url’] . $path_to_gal . $pic[’filename’];
$tn_file = $modx->config[’site_url’] . $path_to_gal . "tn_" . $pic[’filename’];
if($open=="lightbox"){
$returnstring .= "<a href=\"$file\" rel=\"lightbox[maxigallery]\" title=\"<b>".htmlentities(stripslashes($pic[’title’]))."</b>
".htmlentities(stripslashes($pic[’descr’]))."\">";
}else if($open=="gallery_browser"){
$returnstring .= "<a href=\"".$modx->makeUrl($pic[’gal_id’], ’’, "&pic=".$pic[’id’])."\">";
}else{
$returnstring .= "<a href=\"".$modx->makeUrl($pic[’gal_id’], ’’, ’’)."\">";
}
$returnstring .= ($i > $pics_to_show ? "" : "<img src=\"$tn_file\" class=\"thumbnail\">" ) . "</a>";
}
if($open=="lightbox"){
MGSoloRegClientScripts($language);
}
}