Nothing just get text.. It is a custom domain does that matter?
The latest version should work with a custom domain (earlier versions did not). You might try creating some hits when visiting nickname.smugmug.com just to see if that works and it is an issue with the custom domain.
Are you sure you have the latest version of the code? You can get the latest version here.
The latest version should work with a custom domain (earlier versions did not). You might try creating some hits when visiting nickname.smugmug.com just to see if that works and it is an issue with the custom domain.
Are you sure you have the latest version of the code? You can get the latest version here.
Got it working.. .One question though, can it be made to work with the "Recent Visitor Activity" page too?
It is the same format (at least it looks like it...) Just showing the entry and exit page...
The reason I asked is that most of mine show an entry page of my home page or a category so there's no thumb to show anyway (it has to be a gallery link or specific image link to get a thumb).
And for the exit page, it didn't seem all that informative to see a thumb for the image they looked at last.
The reason I asked is that most of mine show an entry page of my home page or a category so there's no thumb to show anyway (it has to be a gallery link or specific image link to get a thumb).
And for the exit page, it didn't seem all that informative to see a thumb for the image they looked at last.
Mine can show the main page but the exit page is usually the picture. Also the entry is a gallery sometime too...
This is what I'm running with. It's been slightly fixed for nicenames, though there is still more that could be done. I am not supporting this script, just offering what I have "as is".
// ==UserScript==
// @namespace http://nimai.smugmug.com/statcounterthumbs
// @name StatCounter SmugMug Thumbs
// @description Adds thumbnails to the detailed view of StatCounter
// @include http://*.statcounter.com/project/standard/*
// ==/UserScript==
// Updated on 9-10-29009 by John Friend
// Modified script to work with some of the new nicename URLs
// Modified script so it works with any domain, including custom domains
// Added support for image Keys so it works with new galleries that required image Keys
// Added support for a number of addition URL formats that didn't previously work
// Added a thumbnail display for URLs that only have a gallery ID and key in them (and made them left aligned to distinguish them)
// Removed support for URLs that do not have an imageKey in them (they would only work on old galleries anyway)
// Added support for date query URLs that have an imageID and imageKey
// Combined popular, date and keyword regEx into one common expression
//--------------------------------------------------------------------------------
function getElementsByClass(searchClass,node,tag) {
var classElements = new Array();
if (node == null)
node = document;
if (tag == null)
tag = '*';
var els = node.getElementsByTagName(tag);
var elsLen = els.length;
var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
for (i = 0, j = 0; i < elsLen; i++) {
if (pattern.test(els[i].className) ) {
classElements[j] = els[i];
j++;
}
}
return classElements;
}
//--------------------------------------------------------------------------------
//var imgRegExp = new RegExp('([^\.]+\.smugmug\.com/)(?:gallery/[0-9/]+#([0-9]+)|keyword/[^/]+(?:/[0-9]+/|#)([0-9]+)|popular/(?:[0-9]+/|#)([0-9]+))');
//var imgRegExp = new RegExp('(^[^/]+/)(?:gallery/[0-9_a-zA-Z/]+#([0-9]+_[0-9a-zA-Z]+)|gallery/[0-9]+_[0-9a-zA-Z]+/[0-9]+/([0-9]+_[0-9a-zA-Z]+)|keyword/[^/]+(?:/[0-9]+/|#)([0-9]+)|popular/(?:[0-9]+/[0-9_a-zA-Z]+#|#)([0-9]+_[0-9a-zA-Z]+|[0-9]+))');
//var imgRegExp = new RegExp('(^[^/]+/)(?:gallery/[0-9_a-zA-Z/]+#([0-9]+_[0-9a-zA-Z]+)|gallery/[0-9]+_[0-9a-zA-Z]+/[0-9]+/([0-9]+_[0-9a-zA-Z]+)|keyword/[^/]+(?:/[0-9]+/|#)([0-9]+)|popular/.*(?:#|/)([0-9]+_[0-9a-zA-Z]+)$)');
//var imgRegExp = new RegExp('(^[^/]+/)(?:gallery/[0-9]+_[0-9a-zA-Z]+(?:#|/[0-9]+/)([0-9]+_[0-9a-zA-Z]+)|keyword/[^/]+(?:/[0-9]+/|#)([0-9]+)|popular/.*(?:#|/)([0-9]+_[0-9a-zA-Z]+)$)');
//var imgRegExp = new RegExp('(^[^/]+/)(?:gallery/[0-9]+_[0-9a-zA-Z]+(?:#|/[0-9]+/)([0-9]+_[0-9a-zA-Z]+)|keyword/[^/]+(?:/[0-9]+/|#)([0-9]+)|popular/.*(?:#|/)([0-9]+_[0-9a-zA-Z]+)(?:(?:/|\-)[A-Za-z\-]+)*$)');
//var imgRegExp = new RegExp('(^[^/]+/)(?:gallery/[0-9]+_[0-9a-zA-Z]+(?:#|/[0-9]+/)([0-9]+_[0-9a-zA-Z]+)|(?:popular|date|keyword)/.*(?:#|/)([0-9]+_[0-9a-zA-Z]+)(?:(?:/|\-)[A-Za-z\-]+)*$)');
var imgRegExp = new RegExp('(^[^/]+/)(?:gallery/[0-9]+_[0-9a-zA-Z]+(?:[^#]*#|/[0-9]+/)([0-9]+_[0-9a-zA-Z]+)|(?:popular|date|keyword)/.*(?:#|/)([0-9]+_[0-9a-zA-Z]+)(?:(?:/|\-)[A-Za-z\-]+)*$)');
var galleryRegExp = new RegExp('(^[^/]+/)(?:gallery(/[0-9]+_[0-9a-zA-Z]+)(?:$|#P[\-0-9]+$))');
// http://jfriend.smugmug.com/Portfolio/Wildlife/879694_PGHnN#39934670_buaG8
var nicenameImageRegExp = new RegExp('(^[^/]+/).*#([0-9]+_[0-9a-zA-Z]+)');
// http://jfriend.smugmug.com/Portfolio/Wildlife/879694_PGHnN
var nicenameGalleryRegExp = new RegExp('(?:$|#)');
var cells = getElementsByClass( 'tableContent1Left|tableContent2Left' );
for( i=2; i<cells.length; i+=3 ) {
var links = cells[i].getElementsByTagName('a');
var link = links?((links.length>1)?links[1]:links[0]):null;
if( link ) {
// strip off any parameters on the end of the link
var matches = link.textContent.match(/(^.*?)(?:\?|$)/);
var shortLink = matches[1];
var imgID = imgRegExp.exec(shortLink);
if (!imgID) {
imgID = galleryRegExp.exec(shortLink);
}
if (!imgID) {
imgID = nicenameImageRegExp.exec(shortLink);
}
if( imgID ) {
var host = imgID[1];
// get the first match from the array that isn't null
var ID = imgID[2]?imgID[2]:imgID[3];
var ID = ID?ID:imgID[4];
if (ID) {
host = imgID[1];
var thumb = document.createElement('img');
// if ID starts with a / char, then it's a gallery ID
if (ID.substr(0,1) == "/") {
ID = ID.substr(1); // remove leading slash
var splitStr = ID.split("_"); // split id and key apart
thumb.setAttribute( 'src', 'http://' + host + 'photos/random.mg?AlbumID=' + splitStr[0] + '&Size=Tiny&AlbumKey=' + splitStr[1] + '&rand=1');
thumb.setAttribute( 'align', 'left' );
} else {
thumb.setAttribute( 'src', 'http://'+host+'photos/'+ID+'-Ti-100.jpg');
thumb.setAttribute( 'align', 'left' );
}
thumb.setAttribute( 'border', '0' );
thumb.setAttribute( 'alt', '' );
var img = cells[i].getElementsByTagName('img');
if( img && img[0] ) cells[i].removeChild( img[0] );
cells[i].appendChild( thumb );
}
}
}
}
This is what I'm running with. It's been slightly fixed for nicenames, though there is still more that could be done. I am not supporting this script, just offering what I have "as is".
...
Thanks John
It looks like where your site is used is just a comment example of the
nicename format. Any suggestion about putting in my own or even deleting
those comments? Or just leave it as is.
Thanks John
It looks like where your site is used is just a comment example of the
nicename format. Any suggestion about putting in my own or even deleting
those comments? Or just leave it as is.
All comments except the first six lines can be removed or left as is - it won't make any difference in functionality.
All comments except the first six lines can be removed or left as is - it won't make any difference in functionality.
Upgraded to FF3.6 and now get some thumbs, only for non NiceName
links though. Also only every third thumb shows, none in between.
Something in code causing skipping two showing one skipping two
showing one ..... ?
Upgraded to FF3.6 and now get some thumbs, only for non NiceName
links though. Also only every third thumb shows, none in between.
Something in code causing skipping two showing one skipping two
showing one ..... ?
I'm sorry Allen, but I'm just not working on this script any more and not even using it myself. I find that with nicenames, I don't really need it anymore because I can see which gallery the hits are in from the URL and if I really want to know which image it is, I can just click on the link. What I needed most at a glance was which gallery and we mostly have that now with nicenames.
Comments
I added Greasemonkey to FF.
I added the script in the main message to my scripts
I see nothing...
Thanks...
Web: www.robsirotaphotography.com • www.k9-pix.com • www.rsirota.com
Nikon... All Nikon (D4/D810/Dƒ)
... OK I do have a PhaseOne 645DF+ w/IQ250
That's what I see. Does it work?
When you do a "Visitor Paths" view in StatCounter, do you get any thumbnails to show you which image people are hitting?
If it's working, you should see something like this:
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Nothing just get text.. It is a custom domain does that matter?
Web: www.robsirotaphotography.com • www.k9-pix.com • www.rsirota.com
Nikon... All Nikon (D4/D810/Dƒ)
... OK I do have a PhaseOne 645DF+ w/IQ250
Are you sure you have the latest version of the code? You can get the latest version here.
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Got it working.. .One question though, can it be made to work with the "Recent Visitor Activity" page too?
Web: www.robsirotaphotography.com • www.k9-pix.com • www.rsirota.com
Nikon... All Nikon (D4/D810/Dƒ)
... OK I do have a PhaseOne 645DF+ w/IQ250
It could be made to work with that page. I don't know if I have time, but what would you want it to show thumbs for?
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
It is the same format (at least it looks like it...) Just showing the entry and exit page...
Web: www.robsirotaphotography.com • www.k9-pix.com • www.rsirota.com
Nikon... All Nikon (D4/D810/Dƒ)
... OK I do have a PhaseOne 645DF+ w/IQ250
The reason I asked is that most of mine show an entry page of my home page or a category so there's no thumb to show anyway (it has to be a gallery link or specific image link to get a thumb).
And for the exit page, it didn't seem all that informative to see a thumb for the image they looked at last.
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Mine can show the main page but the exit page is usually the picture. Also the entry is a gallery sometime too...
Web: www.robsirotaphotography.com • www.k9-pix.com • www.rsirota.com
Nikon... All Nikon (D4/D810/Dƒ)
... OK I do have a PhaseOne 645DF+ w/IQ250
Wish Smug would kick out something that SC would sence for the map_this or Full screen show.
My Website index | My Blog
This isn't working for me... is this script still up to date? Looks kinda handy and I'd like to try it out...
Edit: Now it's working! Thanks anyway!
www.morffed.com
My Website index | My Blog
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
It looks like where your site is used is just a comment example of the
nicename format. Any suggestion about putting in my own or even deleting
those comments? Or just leave it as is.
My Website index | My Blog
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
My Website index | My Blog
links though. Also only every third thumb shows, none in between.
Something in code causing skipping two showing one skipping two
showing one ..... ?
My Website index | My Blog
Homepage • Popular
JFriend's javascript customizations • Secrets for getting fast answers on Dgrin
Always include a link to your site when posting a question
Maybe connection why liked photo thumbs don't show on FB?
My Website index | My Blog