Options

Gallery view questions/feature requests

jfriendjfriend Registered Users Posts: 8,097 Major grins
edited September 27, 2010 in SmugMug Support
As I was setting up a gallery for my family, I encountered several "wishes". I'm interested in whether there is a way to do these that I just haven't found or, if not, these are feature requests.

1) I want the gallery to "default" to Journal style and start out in that style, but still allow the viewer to switch to another view if they want. So far, all I can find that will start out in Journal view is to lock it in Journal view.

2) I'd like to offer a link in my introductory email that starts them in slideshow view. As it is, if I want to offer both Journal and Slideshow view, I have to send them an email with a link to the gallery. If they click on that link, the gallery will likely be in neither journal or slideshow view. If have to then explain in my email how they switch views. I'd rather just send them two links, one that starts in journal view and one that starts in slideshow view. By any chance, are there "?style=xxx" parameters that can accomplish this. When I watch the URL as I change styles, nothing changes so by default, smugmug isn't using the URL to track the current style.

3) When I offer a link to slideshow view, I'd like to be able to pre-set a bunch of default options. In this case, I'd like it to default to full screen, large size, 7 seconds per image, show captions. fade pm. The idea is that they click on a "slideshow" link I send them and the slideshow just starts with all the right options already set. They don't have to learn anything about navigating smugmug.

4) Is there a way for journal view to offer a larger view of the images. It's showing for me as a 200x300 (small size). The Elegant view shows a 299x450 (medium size). Ideally, I'd like Journal view with something a little larger than medium, but I'd take medium if I could get it.

Any helpful thoughts will be appreciated.

--John
--John
HomepagePopular
JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
«1

Comments

  • Options
    Matthew SavilleMatthew Saville Registered Users, Retired Mod Posts: 3,352 Major grins
    edited June 4, 2005
    jfriend wrote:
    As I was setting up a gallery for my family, I encountered several "wishes". I'm interested in whether there is a way to do these that I just haven't found or, if not, these are feature requests.

    1) I want the gallery to "default" to Journal style and start out in that style, but still allow the viewer to switch to another view if they want. So far, all I can find that will start out in Journal view is to lock it in Journal view.

    2) I'd like to offer a link in my introductory email that starts them in slideshow view. As it is, if I want to offer both Journal and Slideshow view, I have to send them an email with a link to the gallery. If they click on that link, the gallery will likely be in neither journal or slideshow view. If have to then explain in my email how they switch views. I'd rather just send them two links, one that starts in journal view and one that starts in slideshow view. By any chance, are there "?style=xxx" parameters that can accomplish this. When I watch the URL as I change styles, nothing changes so by default, smugmug isn't using the URL to track the current style.

    3) When I offer a link to slideshow view, I'd like to be able to pre-set a bunch of default options. In this case, I'd like it to default to full screen, large size, 7 seconds per image, show captions. fade pm. The idea is that they click on a "slideshow" link I send them and the slideshow just starts with all the right options already set. They don't have to learn anything about navigating smugmug.

    4) Is there a way for journal view to offer a larger view of the images. It's showing for me as a 200x300 (small size). The Elegant view shows a 299x450 (medium size). Ideally, I'd like Journal view with something a little larger than medium, but I'd take medium if I could get it.

    Any helpful thoughts will be appreciated.

    --John
    John, these are all really good ideas! I've also wished I could give people links that automatically change the "user adjustable" viewing style to what I want them to initially view it even though they can change it later... This is something that would be cool but it might requre a lot of deep, complicated re-working in the smugmug system that I don't know is possible. Let's wait for an "official" reply though...

    Good luck!

    -Matt-
    My first thought is always of light.” – Galen Rowell
    My SmugMug PortfolioMy Astro-Landscape Photo BlogDgrin Weddings Forum
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited June 5, 2005
    John,

    To set a different default gallery style via a hyperlink, using the following format...
     http://www.smugmug.com/homepage/templatechange.mg?TemplateID=<template>&origin=<album url>
    
    where <template> is as follows...

    3 - SmugMug
    4 - Traditional
    7 - All Thumbs
    8 - Slideshow
    9 - Journal
    10 - SmugMug Small
    11 - Filmstrip
    12 - Critique

    eg.
    http://introversion.smugmug.com/homepage/templatechange.mg?TemplateID=4&origin=http://introversion.smugmug.com/gallery/389624

    Hope this helps,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    BaldyBaldy Registered Users, Super Moderators Posts: 2,853 moderator
    edited June 5, 2005
    Nice answer, devbobo, and great suggestions. We discussed them some this a.m. as we were fighting off the unbelievable traffic generated by Rafael Nadal.

    There are some potholes we need to think about in order to pull these suggestions off, but we will mull them over.

    We love getting clear feedback like this.

    All the best,
    Chris
  • Options
    Mac WriteMac Write Registered Users Posts: 208 Major grins
    edited June 5, 2005
    While we are on the topic of gallery suggestions, it would be nice if categories/galleries could have different looks. Basicly you can have multiple styles for your site and then assign them accordingly. An example would be if you have another site that showcases photos, but want to sell some of them, you point the people to the URL on Smugmug for sales, while retaining the look of X site.
    My Photos | Use this referral code and get $5 off your first year of Smugmug! PIKZSgEQUVtu2 or just click here
    Get busy living or get busy dying
    --Stephen King
  • Options
    jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited June 5, 2005
    Great!
    Thanks. This helps a bunch. This works to get someone started in the right style, while still letting them switch to other styles. So, as is, I can use this to get someone started in the Journal style.

    For starting them in the slideshow style, I wish I could start them out in a full screen slideshow. The default size slideshow doesn't show them anything more than they see with other views (images are small). I'd really like to start them out in a full screen slideshow. Any hidden parameters for that one?

    --John
    devbobo wrote:
    John,

    To set a different default gallery style via a hyperlink, using the following format...

    http://www.smugmug.com/homepage/templatechange.mg?TemplateID=<template>&origin=<album url>

    where <template> is as follows...

    3 - Elegant
    4 - Traditional
    7 - All Thumbs
    8 - Slideshow
    9 - Journal
    10 - Elegant Small

    eg.
    http://introversion.smugmug.com/homepage/templatechange.mg?TemplateID=4&origin=http://introversion.smugmug.com/gallery/389624

    Hope this helps,

    David
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited June 5, 2005
    jfriend wrote:
    Thanks. This helps a bunch. This works to get someone started in the right style, while still letting them switch to other styles. So, as is, I can use this to get someone started in the Journal style.

    For starting them in the slideshow style, I wish I could start them out in a full screen slideshow. The default size slideshow doesn't show them anything more than they see with other views (images are small). I'd really like to start them out in a full screen slideshow. Any hidden parameters for that one?

    --John
    Hey John,

    Glad it helped. Unfortunately, things aren't as easy to do with the full screen version of the slideshow, it's a fair bit more complex.

    David
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited June 5, 2005
    A suggested implementation for "default gallery style"
    devbobo wrote:
    Hey John,

    Glad it helped. Unfortunately, things aren't as easy to do with the full screen version of the slideshow, it's a fair bit more complex.

    David
    For the smugmug folks. I've been thinking about this "starting style" for a gallery some more. What we want is the ability to set the default style for a gallery, but still allow the user to change it themselves if they want. In my particular case today, this would let me set the default style to Journal, but still let people use slideshow or elegant if they want.

    What would work for me would be to take the "Style" drop-down in the customize gallery page and make it be the "Default Style". Then, add an item right below it that says "Allow User to Change Style" and make that a Yes/No option with a default for Yes. Existing settings for the current field that are NOT viewer controlled would set "Allow User to Change Style" to No and get the same behavior they have today (thus maintaining backward compatibility, but giving everyone more choice going forward).

    This would let you set the "starting style" for a gallery and would allow you to either let users see other styles or not.

    I'm also still interested in a link that starts a full screen slideshow with captions on.

    --John
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
  • Options
    pat.kanepat.kane Registered Users Posts: 332 Major grins
    edited November 15, 2005
    devbobo wrote:
    To set a different default gallery style via a hyperlink, using the following format...
    David, this is indeed a handy tip. I created a "player locator" that utilizes keywords and wanted to show the team picture in the journal style, e.g.,

    http://www.koalaplayhouse.com/gallery/906894

    The problem was that once someone clicked on a link, the player's pictures were only shown in journal style (it doesn't look like we can allow the user to set the style for a keyword search).

    I used your code above to create a link for each player, e.g., like this my son.

    This way, I ended up with the team photo in journal view and the resulting player's pictures in smugmug small.

    Thanks!
    Pat
  • Options
    AndyAndy Registered Users Posts: 50,016 Major grins
    edited May 25, 2006
    Hey, it appears to work with a Sharegroup, too thumb.gif


    http://NICKNAME.smugmug.com/homepage/templatechange.mg?TemplateID=8&origin=http://NICKNAME.smugmug.com/share/SHAREGROUP#
    

    This question came by email today.
  • Options
    dmcdmc Registered Users Posts: 427 Major grins
    edited May 25, 2006
    jfriend wrote:
    ...
    4) Is there a way for journal view to offer a larger view of the images. It's showing for me as a 200x300 (small size). The Elegant view shows a 299x450 (medium size). Ideally, I'd like Journal view with something a little larger than medium, but I'd take medium if I could get it.
    --John
    Since you can force a style, you must be a power user.... The following code will make ALL your journal pics Large, and sets Large Portraits to 600 tall (via the cool new custom size url feature). This also fixes the problem of having old Portrait pics (800 tall) and new portrait pics (600 tall) to be consistant.

    I forced all my galleries to journal... and the user still has access to the slideshow since there is a button for it in journal view.

    Example here

    This code goes in the footer section... (it's a little hacked up right now, but it works) Check out the customization forum for more advanced versions.
    <script>        
            var medium_scale = 1.5;
            var large_scale = 2.0;
            var small_max_height = 300;
            var small_max_width = 400;
            var upsize_re = /Journal(Small|Medium|Large)Rule/;
            function upsize_scale(target) {
                    switch(target) {
                    case 'M':
                            return medium_scale;
                    case 'L':
                            return large_scale;
                    default:
                            return null;
                    }
            }
            function upsize_image(img, prefix, suffix, img_num, target) {
                    var caption = document.getElementById('caption'+img_num);
                    if (caption && upsize_re.test(caption.innerHTML)) {
                            target = RegExp.$1;
                    }
                    target = target.substr(0,1).toUpperCase();
                    img.src = prefix + target + suffix; // target always L in this prog
                    // if Image has at least one dimension large enough
                    if(img.width == small_max_width) {  // landscape image
                      img.height = Math.round(2 * img.height);
                      img.width  = Math.round(2 * img.width);
                    }
                    if(img.height == small_max_height) {  // New portrait image
                      img.height = Math.round(2 * img.height);
                      img.width  = Math.round(2 * img.width);
                      img.src = prefix + "800x600" + suffix;
                    } 
    /*              if(img.height == small_max_height) {  // old portrait image
                      img.height = Math.round(2.6666667 * img.height);
                      img.width  = Math.round(2.6666667 * img.width);
                    } */
            }
            function upsize_journal_entry(div,target) {
                    var imgs = div.getElementsByTagName('IMG');
                    var re = /(http:\/\/[^\/]*\/photos\/(\d+)-)S((-\d+)?.jpg)/
                    for(var i=0; i<imgs.length; i++) {
                            if(re.test(imgs[i].src)) {
                                    upsize_image(imgs[i], RegExp.$1, RegExp.$3, RegExp.$2, target);
                            }
                    }
            }       
            function upsize_journal_entries(target) {
                    var divs = document.getElementsByTagName('DIV');
                    for (var i=0; i<divs.length; i++) {
                            if (divs[i].className=='journal_entry') {
                                    upsize_journal_entry(divs[i], target);
                            }
                    }
            }
            function isClass(sClass) {
                    var sClassName = document.body.className;
                    var re = new RegExp(sClass + "( |$)") 
                    if (!sClassName)
                            return false;
                    return re.test(sClassName);
            }
            if (isClass("journal")) {
                    /* Journal Large Always */
                    var upsize_target = 'L';
                    upsize_journal_entries(upsize_target);
            }    
    </script>
     
    
  • Options
    GaryBakkerGaryBakker Registered Users Posts: 266 Major grins
    edited May 25, 2006
    I hope I'm not out of line here, but I'd like to echo all of jfriend's requests.

    I'm a new Smugmug user and while navigation is fine once you're familiar with Smugmug, it'd be great if we could better control the viewer's initial experience to make it simple. And to make our photos be delivered to the viewer in the manner we think best suits them (with, of course, the option for the user to change.)

    Regards,
    Gary
    SmugMug site => The Bakker Chautauqua
    "The difference between stupidity and genius is that genius has its limits." (Einstein)
  • Options
    jeffbridgesjeffbridges Registered Users Posts: 10 Big grins
    edited June 15, 2006
    Awesome - where do I call the script?
    Where do I call this script? I put it in the footer, but my image sizes didn't change...
    dmc wrote:
    This code goes in the footer section... (it's a little hacked up right now, but it works) Check out the customization forum for more advanced versions.
    <script>        
            var medium_scale = 1.5;
            var large_scale = 2.0;
            var small_max_height = 300;
            var small_max_width = 400;
            var upsize_re = /Journal(Small|Medium|Large)Rule/;
            function upsize_scale(target) {
                    switch(target) {
                    case 'M':
                            return medium_scale;
                    case 'L':
                            return large_scale;
                    default:
                            return null;
                    }
            }
            function upsize_image(img, prefix, suffix, img_num, target) {
                    var caption = document.getElementById('caption'+img_num);
                    if (caption && upsize_re.test(caption.innerHTML)) {
                            target = RegExp.$1;
                    }
                    target = target.substr(0,1).toUpperCase();
                    img.src = prefix + target + suffix; // target always L in this prog
                    // if Image has at least one dimension large enough
                    if(img.width == small_max_width) {  // landscape image
                      img.height = Math.round(2 * img.height);
                      img.width  = Math.round(2 * img.width);
                    }
                    if(img.height == small_max_height) {  // New portrait image
                      img.height = Math.round(2 * img.height);
                      img.width  = Math.round(2 * img.width);
                      img.src = prefix + "800x600" + suffix;
                    } 
    /*              if(img.height == small_max_height) {  // old portrait image
                      img.height = Math.round(2.6666667 * img.height);
                      img.width  = Math.round(2.6666667 * img.width);
                    } */
            }
            function upsize_journal_entry(div,target) {
                    var imgs = div.getElementsByTagName('IMG');
                    var re = /(http:\/\/[^\/]*\/photos\/(\d+)-)S((-\d+)?.jpg)/
                    for(var i=0; i<imgs.length; i++) {
                            if(re.test(imgs[i].src)) {
                                    upsize_image(imgs[i], RegExp.$1, RegExp.$3, RegExp.$2, target);
                            }
                    }
            }       
            function upsize_journal_entries(target) {
                    var divs = document.getElementsByTagName('DIV');
                    for (var i=0; i<divs.length; i++) {
                            if (divs[i].className=='journal_entry') {
                                    upsize_journal_entry(divs[i], target);
                            }
                    }
            }
            function isClass(sClass) {
                    var sClassName = document.body.className;
                    var re = new RegExp(sClass + "( |$)") 
                    if (!sClassName)
                            return false;
                    return re.test(sClassName);
            }
            if (isClass("journal")) {
                    /* Journal Large Always */
                    var upsize_target = 'L';
                    upsize_journal_entries(upsize_target);
            }    
    </script>
     
    
  • Options
    dmcdmc Registered Users Posts: 427 Major grins
    edited July 9, 2006
    Where do I call this script? I put it in the footer, but my image sizes didn't change...

    did you get this working? I just noticed your question.... I know, almost a month later...<img src="https://us.v-cdn.net/6029383/emoji/rolleyes1.gif&quot; border="0" alt="" >

    Check a couple gallery settings...
    Make sure you don't have "hide owner" set on the gallery (stops customization)

    make sure the 'appearance' setting is set to custom

    also, make sure the url you are using uses your nickname.smugmug, not www.smugmug...

    last thing I can think of is make sure you are viewing a gallery, not a keyword, I've had trouble getting my keywords results to be displayed in my custom journal view. (I thought this had worked before, but recently I noticed it doesn't.... I asked here on dgrin about it, but nobody responded.)

    lastly again, the hack I had above has been improved, by the customization gods, try this one now:

    css code
    #Journal800x600Rule {}
    


    footer code
    <script>
    // Journal inline size control script.
    // ===================================
    //
    // Add this to the Footer section of your smugmug coustomization.  Then you
    // can control the size of inline journal images in a number of different
    // ways.
    //
    //  1. Default gallery rules via CSS.  Add a CSS rule with a name containing
    //     one or more of the following:
    //
    //          JournalSIZERule
    //
    //     where size is WIDTHxHEIGHT and gives the maximum dimensions of the
    //     image. // The image will be made as large as possible while respecting
    //     these limits.
    //
    //     For example, the css rule:
    //
    //          #Journal600x600Rule {}
    //
    //     Specifies that images should be as large as possible without either
    //     dimension exceeding 600px.
    //
    //  2. Default gallery rules via the gallery Description.  To do this, specify
    //     rules as above in the gallery description.  You can prevent them from
    //     being displayed by encasing in spans.  For example:
    //
    //          <span name="Journal600x600Rule"></span>
    //
    //     The rules don't all have to be contained in one span name (unlike CSS
    //     rules).  If there is at least one such rule in a gallery's Description,
    //     the CSS isn't searched for rules and thus it takes precedence over any
    //     rules specified there.  In fact, specifying the rules in the gallery
    //     Description is essentially a little faster than using CSS.
    //
    //  3. Individual image rules.  The description of any image can contain a
    //     JournalSIZERule.  Use the <span> trick to hide it.  If present, such a
    //     rule take s precedence over the above.
    //
    //  4. Depricated support of specifying Medium or Large as a default and for
    //     landscape and/or portrait orientations.  Basically, if you used this
    //     before, it should still owrk.  So you can use Small, Medium, or Large
    //     in place of the dimension limits above.  Additionally you can use add
    //     Portrait or Landscape to specify that the Small, Medium, or Large size
    //     only applies to that orientation.  For example
    //
    //          #JournalMediumRule_JournalPortraitLargeRule {}
    //
    //     Specifies Medium as teh default but Large for portrait orientaion.
    //     rule take s precedence over the above.
     
    var medium_scale = 1.5;
    var large_scale = 2.0;
    var small_max_height = 300;
    var small_max_width = 400;
    var medium_max_height = 450;
    var medium_max_width = 600;
    var large_max_height = 600;
    var large_max_width = 800;
    var upsize_re = /Journal(Small|Medium|Large)Rule/;
    var portrait_resize_re = /JournalPortrait(Small|Medium|Large)Rule/;
    var landscape_resize_re = /JournalLandscape(Small|Medium|Large)Rule/;
    var custom_resize_re = /Journal(\d+)[xX](\d+)Rule/;
    // ScaleRules is a class that has the job of figuring out just what to do with
    // each image depending on the various rules present and the dimensions of the
    // image.
    function ScaleRules()
    {
      this.default_rule = "";
      this.portrait_rule = "";
      this.landscape_rule = "";
      this.image_rule = "";
      this.has_custom_size = false;
    }
    function ScaleRules_hasGalleryRule()
    {
      with (this) {
        return has_custom_size || default_rule || portrait_rule || landscape_rule;
      }
    }
    ScaleRules.prototype.hasGalleryRule = ScaleRules_hasGalleryRule;
    function ScaleRules_MaybeSetGalleryRules(str)
    {
      if (str) {
        if (custom_resize_re.test(str)) {
          this.has_custom_size = true;
          this.max_width = parseInt(RegExp.$1);
          this.max_height = parseInt(RegExp.$2);
          this.custom_size_string = RegExp.$1 + "x" + RegExp.$2;
        }
        else {
          if (upsize_re.test(str)) {
            this.default_rule = RegExp.$1.charAt(0);
          }
          if (portrait_resize_re.test(str)) {
            this.portrait_rule = RegExp.$1.charAt(0);
          }
          if (landscape_resize_re.test(str)) {
            this.landscape_rule = RegExp.$1.charAt(0);
          }
        }
      }
    }
    ScaleRules.prototype.maybeSetGalleryRules = ScaleRules_MaybeSetGalleryRules;
    function ScaleRules_SetImageRule(str)
    {
      this.image_rule = "";
      this.image_has_custom_size = false;
      if (str) {
        if (custom_resize_re.test(str)) {
          this.image_has_custom_size = true;
          this.image_max_width = parseInt(RegExp.$1);
          this.image_max_height = parseInt(RegExp.$2);
          this.image_custom_size_string = RegExp.$1 + "x" + RegExp.$2;
        }
        else if (upsize_re.test(str)) {
          this.image_rule = RegExp.$1.charAt(0);
        }
      }
    }
    ScaleRules.prototype.setImageRule = ScaleRules_SetImageRule;
     
    function ScaleRules_CalculateScale(height,max_height,width,max_width,
                                       size_string)
    {
      var height_scale = max_height / height;
      var width_scale = max_width / width;
      // Optimization, we'll use SM S,M,L images if they happen to be the right
      // size (and we can be sure of it!  Because of the change in L size in 2006,
      // we have to be careful about L
      if (height_scale < width_scale) {
        this.scale = height_scale;
        if (max_height == small_max_height)
          this.image_size_string = "S";
        else if (max_height == medium_max_height)
          this.image_size_string = "M";
        else
          this.image_size_string = size_string;
      }
      else {
        this.scale = width_scale;
        if (max_width == small_max_width)
          this.image_size_string = "S";
        else if (max_width == medium_max_width)
          this.image_size_string = "M";
        else if (max_width == large_max_width)
          this.image_size_string = "L";
        else
          this.image_size_string = size_string;
      }
    }
    ScaleRules.prototype.calculateScale = ScaleRules_CalculateScale;
    scale_table = {'M': medium_scale, 'L': large_scale, 'S': 1};
    function ScaleRules_SetImageSize(height,width)
    {
      this.image_height = height;
      this.image_width = width;
      this.image_size_string = 'S';
      // Backward compatibility (mixing L,M and YxZ rules) makes this more hairy
      // than we'd like
      if (height == small_max_height || width == small_max_width) {
        if (this.image_has_custom_size) {
          this.calculateScale(height,this.image_max_height,
                              width,this.image_max_width,
                              this.image_custom_size_string);
        }
        else if (this.image_rule != "") {
          this.image_size_string = this.image_rule;
          this.scale = scale_table[this.image_size_string];
        }
        else if (this.has_custom_size) {
          this.calculateScale(height,this.max_height,
                              width,this.max_width,
                              this.custom_size_string);
        }
        else {
          if (this.portrait_rule != "" && height > width) {
            this.image_size_string = this.portrait_rule;
          }
          else if (this.landscape_rule != "" && height < width) {
            // Landscape
            this.image_size_string = this.landscape_rule;
          }
          else if (this.default_rule != "") {
            this.image_size_string = this.default_rule;
          }
          this.scale = scale_table[this.image_size_string];
          // Ugh, smugmug changed the meaning of L, so we have to be on our toes
          // about this.  Anything over 600px high, we can't tell if it's L or
          // not.  (uploads before a certain date are, after not).  So if we can't
          // know, we'll use the explicit custom size that corresponds to current
          // smugmug L.
          if (this.image_size_string == "L")
            this.calculateScale(height,600,width,800,"600x800");
     
        }
      }
    }
    ScaleRules.prototype.setImageSize = ScaleRules_SetImageSize;
    function ScaleRules_ImageHeight()
    {
      return Math.round(this.image_height * this.scale);
    }
    ScaleRules.prototype.imageHeight = ScaleRules_ImageHeight;
    function ScaleRules_ImageWidth()
    {
      return Math.round(this.image_width * this.scale);
    }
    ScaleRules.prototype.imageWidth = ScaleRules_ImageWidth;
     
    function upsize_image(img, prefix, suffix, img_num, rule) {
      rule.setImageRule(document.getElementById('caption'+img_num).innerHTML);
      rule.setImageSize(img.height,img.width);
        if (rule.scale != 1) {                              
        img.src = prefix + rule.image_size_string + suffix;
        img.height = rule.imageHeight();
        img.width = rule.imageWidth();
      }
    }
    function upsize_journal_entry(div,rule) {
      var imgs = div.getElementsByTagName('IMG');
      var re = /(http:\/\/[^\/]*\/photos\/(\d+)-)S((-\d+)?.jpg)/
        for(var i=0; i<imgs.length; i++) {
          if(re.test(imgs[i].src)) {
            upsize_image(imgs[i], RegExp.$1, RegExp.$3, RegExp.$2, rule);
          }
        }
    }
    function upsize_journal_entries(rule) {
      var divs = document.getElementsByTagName('DIV');
      for (var i=0; i<divs.length; i++) {
        if (divs[i].className=='journal_entry') {
          upsize_journal_entry(divs[i], rule);
        }
      }
    }
    function isClass(sClass) {
      var sClassName = document.body.className;
      var re = new RegExp(sClass + "( |$)")
        if (!sClassName)
          return false;
      return re.test(sClassName);
    }
    if (isClass("journal")) {
      var rule = new ScaleRules();
      /* Check for a default journal size in the description */
      var description = document.getElementById('albumDescription');
      rule.maybeSetGalleryRules(description.innerHTML);
      if (! rule.hasGalleryRule()) {
        // Look for Journal(Medium|Large) CSS Rule */
        //
        // Unfortunately, document.getElementById('pickedTheme').sheet.cssRules[]
        // only seems to work on Mozilla; so we iterate */
        // skip first sheet assuming it's always smugmug's big choice */
        //
        // Now that we are looking for portrait and landscape rules as well, we
        // have to search completely.  I suppose we could fix by requiring
        // a single css rule to set all the options, for example:
        //
        //  #JournalMediumRule_JournalPortraitLargeRule {}
        //
        //  I don't know how big a performance problem we'd be fixing.
        for (var k = 1; k < document.styleSheets.length; ++k) {
          var objStyleSheet = document.styleSheets[k];
          var rules = objStyleSheet.cssRules ? objStyleSheet.cssRules :
            (objStyleSheet.rules ? objStyleSheet.rules : objStyleSheet.css);
          for (var j = 0; j < rules.length; ++j) {
            rule.maybeSetGalleryRules(rules[j].selectorText);
            if (rule.hasGalleryRule()) {
              k = document.styleSheets.length; // Break outer loop, too
              break;
            }
          }
        }
      }
      upsize_journal_entries(rule);
    }
    </script>
     
    
  • Options
    dmcdmc Registered Users Posts: 427 Major grins
    edited July 9, 2006
    just thought of another gotcha, make sure the gallery you are viewing is not part of a community.... some communities are configured to display 'their' way, and will not use your customization.
  • Options
    AndyAndy Registered Users Posts: 50,016 Major grins
    edited July 9, 2006
    dmc wrote:
    just thought of another gotcha, make sure the gallery you are viewing is not part of a community.... some communities are configured to display 'their' way, and will not use your customization.
    15524779-Ti.gif

    And thank you, dmc, for the help here in this thread thumb.gif
  • Options
    MichaelKirkMichaelKirk Registered Users Posts: 427 Major grins
    edited December 8, 2006
    Call me blind, but
    I donot see anywhere in the code where what galleries are specified?
    tried entering the code and nada.

    Michael
    Where do I call this script? I put it in the footer, but my image sizes didn't change...
  • Options
    dmcdmc Registered Users Posts: 427 Major grins
    edited December 8, 2006
    I donot see anywhere in the code where what galleries are specified?
    tried entering the code and nada.

    Michael

    Any gallery viewed in Journal style will use this hack...
    if (isClass("journal")) {
    ....
    

    Also, double check for the gotcha's here
    http://www.dgrin.com/showpost.php?p=340736&postcount=14
    and here
    http://www.dgrin.com/showpost.php?p=340771&postcount=15

    and lastly, make sure the gallery has some description defined for it. The code has a bug that if there is no description to read, it doesn't work.
  • Options
    jcpjcp Registered Users Posts: 81 Big grins
    edited January 20, 2007
    Hello,

    I was also hoping to be able to force a visitor to a particular viewing style (filmstrip) but still want them to be able to change to their choice. Is this possible? At the moment I have everyone forced on the filmstrip and they can't change. I have a pro account: e.g: http://jcp.smugmug.com/gallery/2337120

    In the beginning of this thread, it shows a way to do this by URL, but what if I just want a hack so that everytime any gallery is opened, it opens in the filmstrip, then the viewer can change if they like to another viewing style.

    Many thanks in advance.
  • Options
    SystemSystem Registered Users Posts: 8,186 moderator
    edited January 20, 2007
    Please permit me to second not only the feech, but jfriend's recommended implementation of the solution; uncoupling "force" into a checkbox is precisely the right solution, UI wise.
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited January 20, 2007
    dmc wrote:
    if (isClass("journal")) {
    ....
    

    dmc,

    get rid of the isClass function...and use the built-in yui version.

    YD.hasClass(document.body, 'journal')

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    g1r2e3gg1r2e3g Registered Users Posts: 15 Big grins
    edited January 31, 2007
    devbobo wrote:

    This link is great, it half solves my my problems of linking to my site externally direct to keywords, but unfortunately people who wander in via a non gallery link still wont get this forced style.

    Knowing this hack exists now however raises the question to me that if this code exists within the smugmug codebase why can it not be worked into the system so that when any page of photos is called (gallery or keywords or other), if its not a gallery with its own settings then it calls this code with default settings that the user can customize. Voila!

    If we can now set a default theme, why not a default style?

    Greg.
  • Options
    dmcdmc Registered Users Posts: 427 Major grins
    edited January 31, 2007
    devbobo wrote:
    dmc,

    get rid of the isClass function...and use the built-in yui version.

    YD.hasClass(document.body, 'journal')

    Cheers,

    David

    umm... well I just happened to peruse this thread and noticed this posting directed at me! I made the change and my pics look much better now, thanks! mwink.gif

    congrats on your new job! looking forward to you making quick work of the many outstanding feature requests! especially the easy ones like, "gee... why can't I download my own pic when I'm logged in??" and such.

    let me know when you have the "configurable journal" style working... You know, the one that lets me pick how many pics per page, and what size, etc... and some other cool features that even I haven't thought of :D ... I can test it for you!
  • Options
    dcyphertdcyphert Registered Users Posts: 219 Major grins
    edited February 9, 2007
    devbobo wrote:
    John,

    To set a different default gallery style via a hyperlink, using the following format...
     http://www.smugmug.com/homepage/templatechange.mg?TemplateID=<template>&origin=<album url>
    
    where <template> is as follows...

    3 - SmugMug
    4 - Traditional
    7 - All Thumbs
    8 - Slideshow
    9 - Journal
    10 - SmugMug Small
    11 - Filmstrip
    12 - Critique

    eg.
    http://introversion.smugmug.com/homepage/templatechange.mg?TemplateID=4&origin=http://introversion.smugmug.com/gallery/389624

    Hope this helps,

    David
    David,

    I'm having a little trouble w/the syntax in my navbar...can you see what I'm doing wrong here. Thanks.

    <li><a href="http://www.smugmug.com/homepage/templatechange.mg?TemplateID=<smugmug small>&origin=<<A href="http://propointmedia.smugmug.com/popular/#124342349/">Most">http://propointmedia.smugmug.com/popular/#124342349/">Most Popular Photos</a></li>
    Dave
    __________________
    http://www.propointmedia.com
    http://propointmedia.smugmug.com/


    Canon EOS 30D, EOS Rebel XT, (2) Canon 430ex ETTL Flash, Canon 70-200mm IS USM L, 28-135mm IS USM lenses, Canon ST-E2 Wireless transmitter, Stroboframe flash bracket, Off camera shoe, Canon Remote Timer
  • Options
    AndyAndy Registered Users Posts: 50,016 Major grins
    edited February 9, 2007
    dcyphert wrote:
    David,

    I'm having a little trouble w/the syntax in my navbar...can you see what I'm doing wrong here. Thanks.

    <li><a href="http://www.smugmug.com/homepage/templatechange.mg?TemplateID=<smugmug small>&origin=<<A href="http://propointmedia.smugmug.com/popular/#124342349/">Most">http://propointmedia.smugmug.com/popular/#124342349/">Most Popular Photos</a></li>

    use this:
    <li><a href="http://www.smugmug.com/homepage/temp...ateID=<10>&origin=<<A href="http://propointmedia.smugmug.com/popular/#124342349/">Most">http://propointmedia.smugmug.com/popular/#124342349/">Most Popular Photos</a></li>

    NOT the words, smugmug small, rather the number "10"
  • Options
    bskaranbskaran Registered Users Posts: 127 Major grins
    edited February 12, 2007
    Andy wrote:

    I want to set the popular gallery to smugmug small. I tried this but it is not working. Could you please check if I am missing something? <img src="https://us.v-cdn.net/6029383/emoji/headscratch.gif&quot; border="0" alt="" >

    My link www.bskaran.com
    Cheers - Karan

    WWW.bskaran.com
  • Options
    AndyAndy Registered Users Posts: 50,016 Major grins
    edited February 12, 2007
    bskaran wrote:
    I want to set the popular gallery to smugmug small. I tried this but it is not working. Could you please check if I am missing something? headscratch.gif

    My link www.bskaran.com


    your link should look like this:
    http://www.smugmug.com/homepage/templatechange.mg?TemplateID=10&origin=http://www.bskaran.com/popular
    
  • Options
    bskaranbskaran Registered Users Posts: 127 Major grins
    edited February 12, 2007
    Andy wrote:
    your link should look like this:
     
    http://www.smugmug.com/homepage/templatechange.mg?TemplateID=10&origin=http://www.bskaran.com/popular
    


    Thanks Andy. Its working now
    wings.gif
    Cheers - Karan

    WWW.bskaran.com
  • Options
    CelsoDinizCelsoDiniz Registered Users Posts: 146 Major grins
    edited February 18, 2007
    CAN'T GET IT: different default gallery style via a hyperlink
    Hi, I can't get this to work... Can you please give me the command to my case ?

    I want to make the gallery
    http://www.celsodiniz.com/keyword/favorite
    always start as Film Strip whenever they click on "MyFavorites" on my navbar.

    Thank you !!!
    Celso.

    Originally Posted by devbobo
    John,

    To set a different default gallery style via a hyperlink, using the following format...

    http://www.smugmug.com/homepage/templatechange.mg?TemplateID=<template>&origin=<al bum url>

    where <template> is as follows...

    3 - Elegant
    4 - Traditional
    7 - All Thumbs
    8 - Slideshow
    9 - Journal
    10 - Elegant Small

    eg.
    http://introversion.smugmug.com/home...gallery/389624

    Hope this helps,

    David
  • Options
    AndyAndy Registered Users Posts: 50,016 Major grins
    edited February 18, 2007
    CelsoDiniz wrote:
    Hi, I can't get this to work... Can you please give me the command to my case ?

    I want to make the gallery
    http://www.celsodiniz.com/keyword/favorite
    always start as Film Strip whenever they click on "MyFavorites" on my navbar.

    Thank you !!!
    Celso.
    New thread not needed. I merged here, where Devbobo will see it :D
    He's traveling today, and tomorrow.
  • Options
    jfriendjfriend Registered Users Posts: 8,097 Major grins
    edited February 18, 2007
    CelsoDiniz wrote:
    Hi, I can't get this to work... Can you please give me the command to my case ?

    I want to make the gallery
    http://www.celsodiniz.com/keyword/favorite
    always start as Film Strip whenever they click on "MyFavorites" on my navbar.

    Thank you !!!
    Celso.
    This one works if you follow the instructions in devbobo's posting #3 in this thread. Here's the link that starts you out in filmstrip mode:
    http://www.celsodiniz.com/homepage/templatechange.mg?TemplateID=11&origin=http://www.celsodiniz.com/keyword/favorite#121591048
    
    http://www.celsodiniz.com/homepage/templatechange.mg?TemplateID=11&origin=http://www.celsodiniz.com/keyword/favorite#121591048
    --John
    HomepagePopular
    JFriend's javascript customizationsSecrets for getting fast answers on Dgrin
    Always include a link to your site when posting a question
Sign In or Register to comment.