PDA

View Full Version : "Most Popular Photos" gallery - possible to customise?


newzealandscape
Jun-20-2009, 06:07 PM
Hi guys

I've almost got my site just how I want it, and would really appreciate it if someone could help with these two customisation queries relating to the "Most Popular Photos" gallery.

Is it possible to:

1) Force the viewing style to filmstrip - for this gallery only?

2) Turn the "Most popular photos" photos on my HOMEPAGE (http://www.newzealandscape.com) into a filmstrip - with an arrow at each end that viewers can hover their cursor over to get the film strip moving to cycle through further popular photos in the strip. (Note: clicking on any photo in the strip needs to take viewers to the full photo on the popular gallery page, rather than reveal the larger size photo on the homepage itself.)

Thank you!

Ryan

Allen
Jun-20-2009, 08:16 PM
Hi guys

I've almost got my site just how I want it, and would really appreciate it if someone could help with these two customisation queries relating to the "Most Popular Photos" gallery.

Is it possible to:

1) Force the viewing style to filmstrip - for this gallery only?

2) Turn the "Most popular photos" photos on my HOMEPAGE (http://www.newzealandscape.com) into a filmstrip - with an arrow at each end that viewers can hover their cursor over to get the film strip moving to cycle through further popular photos in the strip. (Note: clicking on any photo in the strip needs to take viewers to the full photo on the popular gallery page, rather than reveal the larger size photo on the homepage itself.)

Thank you!

Ryan
The popular gallery will come up in what ever style is set in a cookie from a
previous page visited. That's why I left the style box on my popular page,
hated not being able to change it.

The filmscript thing might be accomplished with some special js hack, post in
that forum might help.

PBolchover
Jun-20-2009, 09:28 PM
There used to be a string you could append to the URL, to change the user's viewing style. Unfortunately, this caused a security hole in smugmug, so the functionality was disabled.

newzealandscape
Jun-22-2009, 12:41 AM
Thanks for the feedback Al and PBolchover. I thought there may have been a js hack floating around, but maybe not. As convenient as it is, I guess copying and pasting code only takes you so far!

brandofamily
Jun-22-2009, 05:03 AM
here's some JS code that will force smugmug style.... I think it can be adjusted to force any style you wish... (put it in the upper JS box)
/*================================================= =====*/
/*== Force Non-Customizable Galleries to Smugmug view ==*/
/*================================================= =====*/

function ForceSmugmugView()
{
// if we're on a galleryPage, and the view isn't already smugmug
if (!YD.hasClass(document.body, "smugmug"))
{
var url = window.location.toString();
var re = new RegExp(/forceView=(\d+)/);
var match = re.exec(url);
var curTime = new Date();
if (match && (match.length > 1))
{
var prevTime = new Date();
prevTime.setTime(match[1]);
// check to see if we've already done this in the last 60 seconds to avoid loops
if (curTime - prevTime < (60*1000))
{
return;
}
}
var postData = 'tool=setCookie&value=3&type=Template';
var broken = function() {};
var reloadPage = function()
{
var newUrl;
if (match)
{
newUrl = url.replace(/forceView=\d+/, "forceView=" + curTime.getTime());
}
else if (url.indexOf("?") != -1)
{
newUrl = url.replace("?", "?forceView=" + curTime.getTime());
}
else if (url.indexOf("#") != -1)
{
newUrl = url.replace("#", "?forceView=" + curTime.getTime() + "#");
}
else
{
newUrl = url + "?forceView=" + curTime.getTime();
}
window.location.replace(newUrl);
};
var callback = {
success: reloadPage,
failure: broken,
scope: this
};
YAHOO.util.Connect.asyncRequest('POST','/rpc/settings.mg', callback, postData);
}
}

// only trigger this function if there is a stylebar because that means the gallery isn't locked into a particular view
YE.onAvailable("stylebar", ForceSmugmugView);

newzealandscape
Jun-23-2009, 01:39 AM
Thanks for trying to help out Anthony. I gave it a shot - I changed any instance of "smugmug" that I could see in your code to "filmstrip" - hoping that the code would be applicable to forcing any view (in this case Filmstrip). Didn't seem to work ... wonder if there was anything obvious I overlooked?

PBolchover
Jun-23-2009, 03:10 AM
You need to change the value=3 in the postdata line.

I believe that possible values are

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

pjspics
Jun-24-2009, 01:55 AM
You need to change the value=3 in the postdata line.

I believe that possible values are

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

Just to say it worked for me - Many thanks :clap

newzealandscape
Jun-25-2009, 12:37 AM
Ahhh, so that's it - many thanks!