Getting all your popular photos in a list (JavaScript)
Hi everyone,
I'll post this in the JavaScript section as well.
Here is sample code that retrieves the list of your popular photos and stores it into a JavaScript Array. Depending on your site, you can show this array in your logo, for example.
Note, this is for JavaScripters. You'll have to know how to integrate this code into your own header/logo/banner. In my case that means updating the JavaScript array g_logoImgs.
[B]var g_logoImgs = new Array();[/B]
g_logoImgs[g_logoImgs.length] = "/photos/1111111-Th.jpg"; // Bell Lady
g_logoImgs[g_logoImgs.length] = "/photos/2222222-Th.jpg"; // Downtown Statue
g_logoImgs[g_logoImgs.length] = "/photos/3333333-Th.jpg"; // Hyannis Boat
// etc...
// etc...
var g_popularList = null;
var g_listsMerged = false;
[B]function getPopularList()[/B]
{
if (g_popularList)
return;
var list = document.getElementById("popularPhotosList");
if (!list)
{
var strList = [I]_getCookie[/I]("T_popList");
if (strList && strList.length > 0)
g_popularList = strList.split(",");
return;
}
var imgs = list.getElementsByTagName("IMG");
if (!imgs || imgs.length == 0)
return null;
var i;
var ret = new Array();
for (i = 0; i < imgs.length; i++)
ret[ret.length] = imgs.src.replace(/Ti/, "Th").replace(/.*\/photos\//, "/photos/");
g_popularList = ret;
[I]_setCookie[/I]("T_popList", ""+g_popularList);
}
[B]function mergeLists()[/B]
{
if (g_listsMerged)
return;
if (!g_popularList)
return;
// Append popular list to end of g_logoImgs.
[B] var i;[/B]
[B] for (i = 0; i < g_popularList.length; i++)[/B]
[B] {[/B]
[B] g_logoImgs[g_logoImgs.length] = g_popularList[I];[/I][/B]
[B] }[/B]
g_listsMerged = true;
}
Then call this code to make it all happen (during a <body> onload event, for example).
getPopularList();
mergeLists();
Now the list of logo/banner images g_logoImgs is updated with the most popular images.
(PS: There are two other functions called by this code: _getCookie and _setCookie. I wrote my own, but i think that SmugMug already has some implementation of this)
2 wishes
1. Be able to move the popular photo list Up or Down (no tricky CSS/Javascript should be required. It should work just like the 'galleries box', the 'keyword list', etc.)
2. Be able to assign a gallery style to your popular photo list.
You can easily move the popular photos section around your page, you are a power or pro user. It's just some css, easily doable with the good folks in the customization forum.
How can I make the popular thumbs small just like at bigwebguy's site?
Linkage in my siggy. Firefox, and the firefox web developer tool - both are FREE. Get them - and then you can easily see the CSS, and you can edit your CSS on your site, WITHOUT yet making any changes to your live site.
Once you have the tools, make a post in the customization forum, and we'll get your sorted out.
I noticed that the new "Photorank" setting under Customize Gallery can't be saved as a settings template. So you can't enable/disable Photorank for a bunch of galleries at once using "Bulk settings".
I like the Photorank idea, but I don't like that the thumbs icons show up over an image when you mouse over it. I also don't like how Smugmug keeps making it difficult to revert things to the way they were before. New features should be disabled by default.
I noticed that the new "Photorank" setting under Customize Gallery can't be saved as a settings template. So you can't enable/disable Photorank for a bunch of galleries at once using "Bulk settings".
I'll report this. Should be able to apply it to a template as the other settings.
I like the Photorank idea, but I don't like that the thumbs icons show up over an image when you mouse over it. I also don't like how Smugmug keeps making it difficult to revert things to the way they were before. New features should be disabled by default.
Thanks for the feedback, smugbug. We hope you'll like it enough to use it!
Without revealing too much about how the system works (both because I don't want people to abuse it and because it's a fast moving target at the moment), relying on views and comments would limit your ability to benefit from this (unless you're in Critique style, where you'd probably get some traction).
Mind explaining what you don't like about the thumbs deal, and if there's a way we can improve it?
No worries if it's just not your thing - but if you think it COULD be your thing with a little work, I'm all ears.
Don
The number one thing would be the gawdy colors again, more on this later though, it has been a normal two wheeled tuesday, I am not exactly sober. and I should put a little though into this one.
I browsed smugmug after midnight and popular keywords told me that it's got nothing, because it's a new day. That prompts a suggestion. Could the "day's" popular keywords be made the most popular keywords in the last rolling 24 hours instead? It would prevent the daily emptying of the list, and you would also avoid having a smugmug member in some part of the world staring at an empty popular keywords list at 3 in the afternoon local time.
Other than that...wow, the new changes rock!
0
BaldyRegistered Users, Super ModeratorsPosts: 2,853moderator
I browsed smugmug after midnight and popular keywords told me that it's got nothing, because it's a new day. That prompts a suggestion. Could the "day's" popular keywords be made the most popular keywords in the last rolling 24 hours instead? It would prevent the daily emptying of the list, and you would also avoid having a smugmug member in some part of the world staring at an empty popular keywords list at 3 in the afternoon local time.
Other than that...wow, the new changes rock!
We debated that intensely and aren't wedded to the current scheme. I stayed up tonight to watch what would happen and it seemed kindof exciting, no? It empties and then fills with all kinds of new stuff in a hurry.
One of the things we were stumbing over was the wording for the last 24 hours. It would have to be longer as Today's photos didn't seem to be clear enough if it was a rolling 24.
We debated that intensely...I stayed up tonight to watch what would happen and it seemed kindof exciting, no? It empties and then fills
I can think of a widespread precedent, and that is forum post listings. When I come across a new forum, I immediately look for the "recent posts" link because it's a fast way to see what's hot across the entire board. I quickly realized that forums fell into two categories: Those that use a rolling Recent Posts link, and those that cut off at midnight in some time zone. The latter were less fun to use, because if you happened to log in just after somebody's midnight, you lost the ability to see any activity from just a few minutes ago!
Dgrin has such a link (New Stuff), which is what I bookmark...and it's a rolling list.
While it may be exciting to see it empty and fill up after midnight, I would counter that we can watch it shift continuously throughout the day, anyway. There's just that one span of time when keywords just...disappear, and I thought that might make it look like nothing's going on at smugmug.
You can do it the way you feel is best, this is not a critical function (to me) and it's fair enough that we can post and discuss our opinions on this great service that keeps gaining value.
There is still that issue of what to call a rolling keyword list...no ideas here yet.
Order of critique galleries in smugmug browse page?
This is a place where randomization or just plain rotation would be good since it would give everyone an equal chance at critiques, good or bad, popular or not. Shots that are not popular would get the visibility they need to have a chance.
Right now, it seems the algorithm is "Andy first then everyone else."
This is a place where randomization or just plain rotation would be good since it would give everyone an equal chance at critiques, good or bad, popular or not. Shots that are not popular would get the visibility they need to have a chance.
Right now, it seems the algorithm is "Andy first then everyone else."
Gee, thanks, Rutt. You know better than that, c'mon. I'm under the same rules as anyone else.
My boids gallery is just the last new gallery set to "critique" style. Go ahead and make one of your own, and soon you will supplant me.
Let's keep the discussions on the new browse/popular features here in this thread. I had to move your post.
I thought about this. Why not make the voting record of pictures available to their owners? I don't see how this gives away any important secret about how the data is used to calculate rankings. I think it would be very helpful input to the photographers, just as useful as comments and the stars.
I understand this might not happen right away. Take it as a feature request, please. I also understand that means you won't comment on it very much.
I had noticed that since this was added browseing was dragging on some systems. So I turned it off and sure enough it speed back up, bummr that it is causeing a speed issue.
Right now it seems as long as a photo has a vote selected it will show up in my gallery. Is there any way to limit the number of photos, like it does for the homepage?
Right now it seems as long as a photo has a vote selected it will show up in my gallery. Is there any way to limit the number of photos, like it does for the homepage?
i have
If it's a truly awful photo that truly looks like a poor snapshot, I give it a thumbs down. I must admit-- I wasn't thrilled about this new feature but it's sucked me in... it's a little like passing a car wreck... I just can't resist looking!
You didn't look carefully enough for the invisible smiley.
Seriously, rotation or randomization would really be good here. There are tons of critique galleries and when I dug through, not many comments.
I second that. I would love for my titchy galleries to be critiqued. I guess this is a new option in customise galleries? I'm looking for it, but cannie find it...I go look under the bed
I had noticed that since this was added browseing was dragging on some systems. So I turned it off and sure enough it speed back up, bummr that it is causeing a speed issue.
James.
As an update, I am only noticing the drag on older machines running XP, my macs and newer XP systems are not affected. On an older XP system it is a really annoying amount of drag. All of these are running firefox.
Comments
Hi everyone,
I'll post this in the JavaScript section as well.
Here is sample code that retrieves the list of your popular photos and stores it into a JavaScript Array. Depending on your site, you can show this array in your logo, for example.
Note, this is for JavaScripters. You'll have to know how to integrate this code into your own header/logo/banner. In my case that means updating the JavaScript array g_logoImgs.
Then call this code to make it all happen (during a <body> onload event, for example).
Now the list of logo/banner images g_logoImgs is updated with the most popular images.
(PS: There are two other functions called by this code: _getCookie and _setCookie. I wrote my own, but i think that SmugMug already has some implementation of this)
When I hear the earth will melt into the sun,
in two billion years,
all I can think is:
"Will that be on a Monday?"
==========================
http://www.streetsofboston.com
http://blog.antonspaans.com
1. Be able to move the popular photo list Up or Down (no tricky CSS/Javascript should be required. It should work just like the 'galleries box', the 'keyword list', etc.)
2. Be able to assign a gallery style to your popular photo list.
Thanks!
When I hear the earth will melt into the sun,
in two billion years,
all I can think is:
"Will that be on a Monday?"
==========================
http://www.streetsofboston.com
http://blog.antonspaans.com
Well I'm glad it wasn't just me imagining something! That happens occasionally Thx for the quick fix!
Smug since 2006
SmugMug Help
PhotoscapeDesign
http://www.datewealthypeople.com
Linkage in my siggy. Firefox, and the firefox web developer tool - both are FREE. Get them - and then you can easily see the CSS, and you can edit your CSS on your site, WITHOUT yet making any changes to your live site.
Once you have the tools, make a post in the customization forum, and we'll get your sorted out.
Portfolio • Workshops • Facebook • Twitter
I like the Photorank idea, but I don't like that the thumbs icons show up over an image when you mouse over it. I also don't like how Smugmug keeps making it difficult to revert things to the way they were before. New features should be disabled by default.
Thanks for the feedback, smugbug. We hope you'll like it enough to use it!
Portfolio • Workshops • Facebook • Twitter
The number one thing would be the gawdy colors again, more on this later though, it has been a normal two wheeled tuesday, I am not exactly sober.
and I should put a little though into this one.
James.
http://www.jamesjweg.com
Other than that...wow, the new changes rock!
One of the things we were stumbing over was the wording for the last 24 hours. It would have to be longer as Today's photos didn't seem to be clear enough if it was a rolling 24.
I can think of a widespread precedent, and that is forum post listings. When I come across a new forum, I immediately look for the "recent posts" link because it's a fast way to see what's hot across the entire board. I quickly realized that forums fell into two categories: Those that use a rolling Recent Posts link, and those that cut off at midnight in some time zone. The latter were less fun to use, because if you happened to log in just after somebody's midnight, you lost the ability to see any activity from just a few minutes ago!
Dgrin has such a link (New Stuff), which is what I bookmark...and it's a rolling list.
While it may be exciting to see it empty and fill up after midnight, I would counter that we can watch it shift continuously throughout the day, anyway. There's just that one span of time when keywords just...disappear, and I thought that might make it look like nothing's going on at smugmug.
You can do it the way you feel is best, this is not a critical function (to me) and it's fair enough that we can post and discuss our opinions on this great service that keeps gaining value.
There is still that issue of what to call a rolling keyword list...no ideas here yet.
This is a place where randomization or just plain rotation would be good since it would give everyone an equal chance at critiques, good or bad, popular or not. Shots that are not popular would get the visibility they need to have a chance.
Right now, it seems the algorithm is "Andy first then everyone else."
Gee, thanks, Rutt. You know better than that, c'mon. I'm under the same rules as anyone else.
My boids gallery is just the last new gallery set to "critique" style. Go ahead and make one of your own, and soon you will supplant me.
Let's keep the discussions on the new browse/popular features here in this thread. I had to move your post.
Portfolio • Workshops • Facebook • Twitter
I understand this might not happen right away. Take it as a feature request, please. I also understand that means you won't comment on it very much.
Then, you know where it goes
http://www.dgrin.com/showthread.php?t=29858
Portfolio • Workshops • Facebook • Twitter
You didn't look carefully enough for the invisible smiley.
Seriously, rotation or randomization would really be good here. There are tons of critique galleries and when I dug through, not many comments.
Jeez, I need telepathy lessons to figure out where to post. It seems you'll move stuff where you want it anyway.
Where the sun don't shine?
James.
http://www.jamesjweg.com
I was able to pull mine off the home page and create a new link. Works nice!!
www.newenglanddigitalphotography.com
Okay, I got the link working!
Right now it seems as long as a photo has a vote selected it will show up in my gallery. Is there any way to limit the number of photos, like it does for the homepage?
http://www.raptorcaptor.com/popular/
My website | NANPA Member
Hi Glenn,
No not for that link - that's all of your Popular photos. The Popular Photos Box on the homepage though, can be set in terms of number of photos.
And may I say - WOWOWOW your work is stunning! ----> I'm going back for more!
Portfolio • Workshops • Facebook • Twitter
Thanks Andy!
My website | NANPA Member
Dgrin FAQ | Me | Workshops
If it's a truly awful photo that truly looks like a poor snapshot, I give it a thumbs down. I must admit-- I wasn't thrilled about this new feature but it's sucked me in... it's a little like passing a car wreck... I just can't resist looking!
Portland, Oregon Photographer Pete Springer
website blog instagram facebook g+
I second that. I would love for my titchy galleries to be critiqued. I guess this is a new option in customise galleries? I'm looking for it, but cannie find it...I go look under the bed
http://www.samuelbedford.com
Having said that, I am a bit blind. anyone point me in the right direction?
http://www.samuelbedford.com
Did you force the gallery style to the critique style?
http://photos.mikelanestudios.com/
err...Im a standard user, I dont think I can force gallery styles. Does that mean Im out?
http://www.samuelbedford.com
As an update, I am only noticing the drag on older machines running XP, my macs and newer XP systems are not affected. On an older XP system it is a really annoying amount of drag. All of these are running firefox.
James.
http://www.jamesjweg.com