Quote from: jdelight at Jan 05, 2007, 02:58 AM
Next thumb problem is that I want to link to a gallery and also go to the first image. (i.e. not ’index’ page with just the thumbs).
I didn’t fully understand that what you want to list as the links? Thumbs from certain galleries and then when user clicks, it would open the picture itself straigth away? MaxiGallerySolo has that ability.. there is a parameter called "open" what you can use to define how you want to open the picture and use gallery_browser as the value..
Quote from: jdelight at Jan 05, 2007, 02:58 AM
If I want to then show the thumbs on the same page as the full image how can I do that...just dumping the template code in the space beneath the image in the picturetpl file doesn’t work.
any ideas anyone?
Currently, the snippet can’t do this by itself.. not sure if this will work, but you could try to do another snippet with this content:
<?php
$output ="";
if ($_REQUEST['pic']) {
$output = $modx->runSnippet("MaxiGallerySolo", array("galIDs" => $_REQUEST['gal_id'], "open" => "gallery_browser"));
}
return $output;
?>
and put it below your MaxiGallery snippet call..
Then create a new snippet with name "MaxiGallerySolo" and use this content:
//<?//////////////////////////////////////////////////////////////////////////////////////////
// MaxiGallerySolo by XriS (modified by doze) v.1.1.1b (to be used with maxigallery v0.5 betas)
// -------------------------------------------------------------------------------------------
//
// This snippet gets the latest or random pictures from selected galleries
//
// Call like [!MaxiGallerySolo? &galIDs=`23,51,61` &pics_to_show=`5` &type=`random` &open=`gallery_browser`!]
//
// Parameters:
// &galIDs = Comma delimitted IDs of the documents that has [MaxiGallery] calls
// &pics_to_show = [ number ] : How many pics to show. Default: 1
// &type = [ "random" | "latest" ] : Show random pics or latest pics? Default: "latest"
// &open = [ "lightbox" | "gallery_browser" | "gallery_overview" ] : When clicking the link, should it open in lightbox,
// gallery browser or should it open the gallery overview where that picture is. Default: "lightbox"
// &language = [ "en" | "fr" | etc.. ] : Lightboxv2 language (you have to have the language files in maxigallery ligthboxv2 folder. Defaul: "en"
if(!function_exists(MGSoloRegClientScripts)) {
function MGSoloRegClientScripts($language){
global $modx;
//lightbox scripts
$lightboxv2_css_link = '<link rel="stylesheet" href="' . $modx->config['base_url'] . 'assets/snippets/maxigallery/lightboxv2/css/lightbox.css" type="text/css" media="screen" />';
$lightboxv2_script_link1 = $modx->config['base_url'] . 'assets/snippets/maxigallery/lightboxv2/js/lightbox_setup.js';
$lightboxv2_settings = 'assets/snippets/maxigallery/lightboxv2/js/lightbox_lang_'.$language.'.js';
if(file_exists($modx->config['base_path'].$lightboxv2_settings)){
$lightboxv2_script_link2 = $modx->config['base_url'] . $lightboxv2_settings;
}else{
$lightboxv2_script_link2 = $modx->config['base_url'] . 'assets/snippets/maxigallery/lightboxv2/js/lightbox_lang_en.js';
}
$lightboxv2_script_link3 = $modx->config['base_url'] . 'assets/snippets/maxigallery/lightboxv2/js/prototype.js';
$lightboxv2_script_link4 = $modx->config['base_url'] . 'assets/snippets/maxigallery/lightboxv2/js/scriptaculous.js?load=effects';
$lightboxv2_script_link5 = $modx->config['base_url'] . 'assets/snippets/maxigallery/lightboxv2/js/lightbox.js';
$modx->regClientCSS($lightboxv2_css_link);
$modx->regClientStartupScript($lightboxv2_script_link1);
$modx->regClientStartupScript($lightboxv2_script_link2);
$modx->regClientStartupScript($lightboxv2_script_link3);
$modx->regClientStartupScript($lightboxv2_script_link4);
$modx->regClientStartupScript($lightboxv2_script_link5);
}
}
$returnstring="";
if(isset($galIDs)){
$pics_to_show = isset($pics_to_show) ? $pics_to_show - 1 : "all";
$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");
$i=0;
if($type == "random"){
shuffle($pics);
}
if ($pics_to_show =="all" || $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><br />".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);
}
}
return $returnstring;
Quote from: jdelight at Jan 05, 2007, 02:58 AM
oh...lastly, if when I’m using MaxiGallerySolo to pull out the image can I also pull out content from the document a gallery is associated with.
Unfortunately no.. The next version of maxigallery will have the maxigallerysolo features in it, just in a enhanced way and the output will be totally templateable.. and you will be possible to access the target gallery document data.