"share photo" in photo tools
rainforest1155
Registered Users Posts: 4,566 Major grins
Hi there,
it has always bugged me that I have to view my pictures in single-picture-view in order to get the "share photo"-button.
How about integrating this link in photo-tools?
Thanks for listening,
Sebastian
it has always bugged me that I have to view my pictures in single-picture-view in order to get the "share photo"-button.
How about integrating this link in photo-tools?
Thanks for listening,
Sebastian
Sebastian
SmugMug Support Hero
SmugMug Support Hero
0
Comments
Here's a piece of code for the co-branding footer html section, that will add 'share' button to each photo and it only works properly for 'Traditional' or 'All Thumbs' styles...
<script for="window" event="onload" defer>
try
{
var re1 = new RegExp("\/gallery\/([0-9]+)","ig");
var re2 = new RegExp("\/photos\/([0-9]+)-","ig");
re1.exec(document.location);
var sAlbumID = RegExp.$1;
if (sAlbumID != "")
{
var objCol = document.getElementsByTagName('img');
for (i = 0; i < objCol.length; i++)
{
if (objCol.className == "smborderoff")
{
re2.exec(objCol.getAttribute('src'));
var sImageID = RegExp.$1;
objParent = objCol.parentNode;
while (objParent.nodeName != "TBODY")
objParent = objParent.parentNode;
objTR = document.createElement('tr');
objParent.appendChild(objTR);
objTD = document.createElement('td');
objTR.appendChild(objTD);
objForm = document.createElement('form');
objForm.setAttribute('action', '/gallery/share.mg');
objForm.setAttribute('method', 'post');
objTD.appendChild(objForm);
objAlbum = document.createElement('input');
objAlbum.setAttribute('type', 'hidden');
objAlbum.setAttribute('name', 'AlbumID');
objAlbum.setAttribute('value', sAlbumID);
objForm.appendChild(objAlbum);
objImage = document.createElement('input');
objImage.setAttribute('type', 'hidden');
objImage.setAttribute('name', 'ImageID');
objImage.setAttribute('value', sImageID);
objForm.appendChild(objImage);
objPage = document.createElement('input');
objPage.setAttribute('type', 'hidden');
objPage.setAttribute('name', 'Page');
objPage.setAttribute('value', '1');
objForm.appendChild(objPage);
objSubmit = document.createElement('input');
objSubmit.setAttribute('type', 'submit');
objSubmit.setAttribute('value', 'share');
objSubmit.className= 'buttons';
objForm.appendChild(objSubmit);
}
}
}
} catch(e) {}
</script>
Cheers,
David
SmugMug API Developer
My Photos
many thanks for the effort!
Too bad I'm stuck with a basic account at the moment and therefore can't use it for now.
I'm sure somebody else can use it.
Sebastian
SmugMug Support Hero
I can life with anything except silence.
Thanks,
Sebastian
SmugMug Support Hero
I was thinking about an additional share photo button for easy access in photo tools.
Sebastian
SmugMug Support Hero