How to make hotlink-ing easier

reefingbuddhareefingbuddha Registered Users Posts: 8 Beginner grinner
edited August 23, 2009 in SmugMug Support
I'm a pro user and post a good amount of my pictures in forums to help get them out there. Currently I have to manual enter the URL as the link and then the IMG information. Is there anyway to combine a "share" option that includes a link back to the sales page automatically. I have added "*" in some of the code below to keep it from linking for the purposes of this forum.

Currently this is my process;
1) Find url for a picture in gallery and into "reply" window
"[url=http://thirschmann.smugmug.com/gallery/8621260_j7beW#570618464_Xtw92/[/url]"

2) Find the share link to a medium sized image and adding the required IMG brackets
[IMG]http://thirschmann.smugmug.com/photos/570618464_Xtw92-M.jpg[/IMG*]" 3) And then finally combining the two to create a hotlink-ed image in the forum "[url=http://thirschmann.smugmug.com/gallery/8621260_j7beW#570618464_Xtw92/[/img][IMG]http://thirschmann.smugmug.com/photos/570618464_Xtw92-M.jpg[/IMG*][/url*]" 4) And here is an example of the result I currently get. If you click on the image it links back to the photo in its associated gallery[/img]570618688_t7iGr-L.jpg


As you can imagine doing this for 20-30 pictures at a time takes WAY to much time. Is there a better way of going about this? Could this feature be added to the share options(seems like it would be fairly easy)?

Furthermore is there a way to only allow the "share" option to be seen by the owner rather then anyone looking at my galleries?

Thanks in advance for any advice or assistance.

Regards,
Thomas

Comments

  • AndyAndy Registered Users Posts: 50,016 Major grins
    edited June 22, 2009
    Thomas, beautiful pictures you have! eek7.gif

    We're expect to make some changes along these lines very soon. Stay tuned. You'll want to subscribe to our Release Notes blog, so that you don't miss a single update from SmugMug :)http://blogs.smugmug.com/release-notes/ at the bottom, there's a link for Entries (RSS) - put that in your favorite feed reader.

    You can hide the share button from your viewers - add this to your CSS Box, Sitewide customization:

    .notLoggedIn .share_button {display: none;}
  • reefingbuddhareefingbuddha Registered Users Posts: 8 Beginner grinner
    edited June 22, 2009
    Andy wrote:
    Thomas, beautiful pictures you have! eek7.gif

    We're expect to make some changes along these lines very soon. Stay tuned. You'll want to subscribe to our Release Notes blog, so that you don't miss a single update from SmugMug :)http://blogs.smugmug.com/release-notes/ at the bottom, there's a link for Entries (RSS) - put that in your favorite feed reader.

    You can hide the share button from your viewers - add this to your CSS Box, Sitewide customization:

    .notLoggedIn .share_button {display: none;}

    Thanks Andy,

    I'll keep up on the RSS feed. I think this feature would make a lot of our lives easier.

    Thanks for getting back to me so quick and I'm glad you like my photos!

    Cheers,
    Tom
  • SamirDSamirD Registered Users Posts: 3,474 Major grins
    edited June 22, 2009
    I was running into the same problem for posting embedded slideshows. I finally just made my own javascript page that prompts for the gallery url and then spits out my html that I highlight and cut and paste. Quick and dirty, but it works.
    Pictures and Videos of the Huntsville Car Scene: www.huntsvillecarscene.com
    Want faster uploading? Vote for FTP!
  • reefingbuddhareefingbuddha Registered Users Posts: 8 Beginner grinner
    edited June 22, 2009
    SamirD wrote:
    I was running into the same problem for posting embedded slideshows. I finally just made my own javascript page that prompts for the gallery url and then spits out my html that I highlight and cut and paste. Quick and dirty, but it works.

    As I don't know anything about javascript I wouldn't know how to go about this. Any advice you could offer on how I can accomplish the task mentioned above with a task as you mentioned?

    Your help would be greatly appreciated.

    Regards,
    Tom
  • SamirDSamirD Registered Users Posts: 3,474 Major grins
    edited June 22, 2009
    Hey Tom, Javascript isn't hard if you know any programming language. Here's what I made:
    ******** type="text/javascript">
    do
    {
      var galleryURL = prompt ("Enter the Smugmug gallery URL","")
    }
    while ((galleryURL.search(/smugmug/i)>-1) || (galleryURL.length<1))
    var AlbumID = galleryURL.slice(galleryURL.length-13,galleryURL.length-6)
    var AlbumKey = galleryURL.slice(galleryURL.length-5)
    // document.write(galleryURL)
    // document.write(AlbumID)
    document.write('&lt;embed src="http://www.smugmug.com/ria/ShizamSlides-2007090601.swf?AlbumID=' + AlbumID + '&AlbumKey=' + AlbumKey + '&transparent=true&crossFadeSpeed=500&showThumbs=false&showButtons=false&showLogo=false&forceSize=MediumURL&clickUrl=' + galleryURL + '" wmode="transparent" type="application/x-shockwave-flash" allowScriptAccess="always" allowNetworking="all" height="450" width="600">')
    // document.write(galleryURL.search(/smugmug/i))
    document.write('&lt;/embed>')
    </********
    
    You can test it here:
    www.huntsvillecarscene.com/inline.htm using this url:http://newpics.huntsvillecarscene.com/gallery/8228965_obUjW

    I have written it to exclude any smugmug.com urls, so it would be simpler if it didn't do that. If I have any free time or need a break, I'll code up a javascript for your application.
    Pictures and Videos of the Huntsville Car Scene: www.huntsvillecarscene.com
    Want faster uploading? Vote for FTP!
  • reefingbuddhareefingbuddha Registered Users Posts: 8 Beginner grinner
    edited June 22, 2009
    SamirD wrote:
    Hey Tom, Javascript isn't hard if you know any programming language. Here's what I made:
    ******** type="text/javascript">
    do
    {
      var galleryURL = prompt ("Enter the Smugmug gallery URL","")
    }
    while ((galleryURL.search(/smugmug/i)>-1) || (galleryURL.length<1))
    var AlbumID = galleryURL.slice(galleryURL.length-13,galleryURL.length-6)
    var AlbumKey = galleryURL.slice(galleryURL.length-5)
    // document.write(galleryURL)
    // document.write(AlbumID)
    document.write('&lt;embed src="http://www.smugmug.com/ria/ShizamSlides-2007090601.swf?AlbumID=' + AlbumID + '&AlbumKey=' + AlbumKey + '&transparent=true&crossFadeSpeed=500&showThumbs=false&showButtons=false&showLogo=false&forceSize=MediumURL&clickUrl=' + galleryURL + '" wmode="transparent" type="application/x-shockwave-flash" allowScriptAccess="always" allowNetworking="all" height="450" width="600">')
    // document.write(galleryURL.search(/smugmug/i))
    document.write('&lt;/embed>')
    </********
    
    You can test it here:
    www.huntsvillecarscene.com/inline.htm using this url:http://newpics.huntsvillecarscene.com/gallery/8228965_obUjW

    I have written it to exclude any smugmug.com urls, so it would be simpler if it didn't do that. If I have any free time or need a break, I'll code up a javascript for your application.


    Thank you for showing me your sample code, the language looks vaguely familiar. Back in high school I was proficient in C++ and html but that was a long time ago and I don't remember much.

    If you have some free time I would obviously appreciate it but I really wouldn't want to be a bother.

    Many thanks for helping me out this far.

    Cheers,
    Tom
  • SamirDSamirD Registered Users Posts: 3,474 Major grins
    edited June 22, 2009
    Thank you for showing me your sample code, the language looks vaguely familiar. Back in high school I was proficient in C++ and html but that was a long time ago and I don't remember much.
    haha, small world. I took some C courses in college almost a decade back.

    The hard part is learning about how to do the parsing. I had to read up on that. The syntax isn't that tough. I used this link for a lot of my testing:
    http://www.w3schools.com/JS/tryit.asp?filename=tryjs_intro

    For what you are trying to do, I'd make the input be the entire url with the photo in the url past the '#' mark. Then I'd have the js parse out the photo name and add construct the photo link. (I've found that photos typically end in -M-1.jpg or something of that sort.) Then I'd have the js spit out the forum code with the bbcode and links in their respective places.

    If you want to get really fancy, you might be able to make it input a number of urls and generate one whole thing of bbcode at once. So you could simple cut and paste the urls into notepad until you have a paragraph of them, and then paste the paragraph into your javascript program. That would be pretty slick and would save you a lot of time.
    Pictures and Videos of the Huntsville Car Scene: www.huntsvillecarscene.com
    Want faster uploading? Vote for FTP!
  • reefingbuddhareefingbuddha Registered Users Posts: 8 Beginner grinner
    edited June 22, 2009
    SamirD wrote:
    haha, small world. I took some C courses in college almost a decade back.

    The hard part is learning about how to do the parsing. I had to read up on that. The syntax isn't that tough. I used this link for a lot of my testing:
    http://www.w3schools.com/JS/tryit.asp?filename=tryjs_intro

    For what you are trying to do, I'd make the input be the entire url with the photo in the url past the '#' mark. Then I'd have the js parse out the photo name and add construct the photo link. (I've found that photos typically end in -M-1.jpg or something of that sort.) Then I'd have the js spit out the forum code with the bbcode and links in their respective places.

    If you want to get really fancy, you might be able to make it input a number of urls and generate one whole thing of bbcode at once. So you could simple cut and paste the urls into notepad until you have a paragraph of them, and then paste the paragraph into your javascript program. That would be pretty slick and would save you a lot of time.

    haha. I appreciate the link and I tried having a play but I will have to do a whole lot of research before I get anything useful out of it. Through your explanation I understand the concept and what I want it to do, but I have no idea how to go about it. headscratch.gif (perfect smilie for the situation)

    It seems that the "share" link is always the url with a central portion cut out and a -L.jpeg added (or -m.jpeg depending on size) so the code should be relatively easy to put together using just a supplied URL.

    The alternative of creating a list and being able to "patch" convert a bunch of URL's would be very convinient indeed. Great idea.
  • SamirDSamirD Registered Users Posts: 3,474 Major grins
    edited June 22, 2009
    Your idea has me wanting to code it up just to see if I can. mwink.gif

    I think I can do it, but I'll have to find time mid next week. Remind me with a post here if you don't hear from me by then. :)
    Pictures and Videos of the Huntsville Car Scene: www.huntsvillecarscene.com
    Want faster uploading? Vote for FTP!
  • reefingbuddhareefingbuddha Registered Users Posts: 8 Beginner grinner
    edited June 23, 2009
    SamirD wrote:
    Your idea has me wanting to code it up just to see if I can. mwink.gif

    I think I can do it, but I'll have to find time mid next week. Remind me with a post here if you don't hear from me by then. :)

    Great! Thanks for giving it a shot.

    Cheers,
    Tom
  • SamirDSamirD Registered Users Posts: 3,474 Major grins
    edited July 6, 2009
    Do you still need this? I need a break from my normal work.
    Pictures and Videos of the Huntsville Car Scene: www.huntsvillecarscene.com
    Want faster uploading? Vote for FTP!
  • SamirDSamirD Registered Users Posts: 3,474 Major grins
    edited July 6, 2009
    Here's what I've come up with so far. You put in the full url to the picture like in your example without the trailing slash. The result on the screen is the complete forum link like you want. Simply control-a, control-c to copy and then paste it into your forum post. thumb.gif
    www.huntsvillecarscene.com/postimg.htm

    I want to make it so you can cut and paste in a bunch of urls into a text box and then hit a submit button, which will then display the forum code for all the images at the same time. But I can't seem to figure out how html textareas can be used with javascript functions. headscratch.gif

    Well, I hope this much helps.
    Pictures and Videos of the Huntsville Car Scene: www.huntsvillecarscene.com
    Want faster uploading? Vote for FTP!
  • DavidTODavidTO Registered Users, Retired Mod Posts: 19,160 Major grins
    edited July 6, 2009
    Why don't you guys use a text expansion app? I use TextExpander on the Mac. All you would need is the image ID, which you can copy from the URL, then type a shortcut, and let the expansion app do the rest of the work? I do that all the time. Or am I missing something?

    EDIT: Oh, I see. You need the gallery number as well. Hrm. I'm sure there's a way to do this with text expansion. I don't link to the image in the gallery ever.
    Moderator Emeritus
    Dgrin FAQ | Me | Workshops
  • DavidTODavidTO Registered Users, Retired Mod Posts: 19,160 Major grins
    edited July 6, 2009
    OK, I figured out what I would do:

    1) Find url for a picture in gallery and into "reply" window
    "[url=http://smugmug.com/gallery/8621260_j7beW#570618464_Xtw92/[/url]&quot;

    2) Paste it into the message.

    3) Select and copy the Image ID (570618464_Xtw92).

    4) Place my cursor right before [/*url]

    5) Invoke my text expansion snippet.

    NOTE: You don't need your name in the URLs, and I would fashion the text expansion snippet to leave it out. But that's me.
    Moderator Emeritus
    Dgrin FAQ | Me | Workshops
  • SamirDSamirD Registered Users Posts: 3,474 Major grins
    edited July 7, 2009
    I think my little javascript app is a bit quicker. No precise mousing around, just get to the url, copy and paste into the script, highlight the results (ctrl-a), then copy and paste to the forum. You don't even have to touch the mouse except when clicking on a picture to get the right url in the address bar.

    That's interesting that there is something that automates things on a Mac. Never knew of such things.
    Pictures and Videos of the Huntsville Car Scene: www.huntsvillecarscene.com
    Want faster uploading? Vote for FTP!
  • DavidTODavidTO Registered Users, Retired Mod Posts: 19,160 Major grins
    edited July 7, 2009
    SamirD wrote:
    I think my little javascript app is a bit quicker. No precise mousing around, just get to the url, copy and paste into the script, highlight the results (ctrl-a), then copy and paste to the forum. You don't even have to touch the mouse except when clicking on a picture to get the right url in the address bar.

    That's interesting that there is something that automates things on a Mac. Never knew of such things.


    Yah, the text expansion was not as easy as I thought at first. I use it all the time for embedding images, but I never provide the link to the image in the gallery, so it's simpler.

    As for Macs, just get your head out of the sand, and you'll be surprised! :hide
    Moderator Emeritus
    Dgrin FAQ | Me | Workshops
  • SamirDSamirD Registered Users Posts: 3,474 Major grins
    edited July 8, 2009
    DavidTO wrote:
    Yah, the text expansion was not as easy as I thought at first. I use it all the time for embedding images, but I never provide the link to the image in the gallery, so it's simpler.
    Linking just to the images is quite easy. But having to build this link over and over can be quite cumbersome. I hope my little script gets some use! :ivar
    DavidTO wrote:
    As for Macs, just get your head out of the sand, and you'll be surprised! :hide
    I've used them on and off, and have come to one conclusion--they're not for me. To me, Macs are 'right-brained' and PCs are 'left-brained' (or vice-versa, I can't remember which side of the brain is creative/logical). I'm the logical/technical type. I'm surprised I'm creative enough to take good photos, lol.

    PC or Mac, a keyboard and something logical works intuitively for me. There just so many more buttons on a keyboard vs the maximum 3 on a mouse. Depending on what you are doing, more buttons=more work done. thumb.gif
    Pictures and Videos of the Huntsville Car Scene: www.huntsvillecarscene.com
    Want faster uploading? Vote for FTP!
  • reefingbuddhareefingbuddha Registered Users Posts: 8 Beginner grinner
    edited July 9, 2009
    SamirD wrote:
    Linking just to the images is quite easy. But having to build this link over and over can be quite cumbersome. I hope my little script gets some use! :ivar

    I've used them on and off, and have come to one conclusion--they're not for me. To me, Macs are 'right-brained' and PCs are 'left-brained' (or vice-versa, I can't remember which side of the brain is creative/logical). I'm the logical/technical type. I'm surprised I'm creative enough to take good photos, lol.

    PC or Mac, a keyboard and something logical works intuitively for me. There just so many more buttons on a keyboard vs the maximum 3 on a mouse. Depending on what you are doing, more buttons=more work done. thumb.gif

    Sorry it took so long for me to get back to this thread.

    Awesome! it works perfectly!

    I really appreciate it. Makes things a lot easier for me. I hope that smugmug adds a feature such as this as a standard option.

    Thanks again!


    584707232_sq3Lt-M.jpg

    :D
  • reefingbuddhareefingbuddha Registered Users Posts: 8 Beginner grinner
    edited July 9, 2009
    DavidTO wrote:
    Yah, the text expansion was not as easy as I thought at first. I use it all the time for embedding images, but I never provide the link to the image in the gallery, so it's simpler.

    As for Macs, just get your head out of the sand, and you'll be surprised! :hide


    Text expansion? I've been using Macs for years and have no idea what your referring to. Any more info?
  • DavidTODavidTO Registered Users, Retired Mod Posts: 19,160 Major grins
    edited July 9, 2009
    Text expansion? I've been using Macs for years and have no idea what your referring to. Any more info?


    http://www.smileonmymac.com/TextExpander/
    Moderator Emeritus
    Dgrin FAQ | Me | Workshops
  • SamirDSamirD Registered Users Posts: 3,474 Major grins
    edited July 9, 2009
    Awesome! it works perfectly!

    I really appreciate it. Makes things a lot easier for me. I hope that smugmug adds a feature such as this as a standard option.

    Thanks again!
    Sweet! clap.gif Let me know if you ever need anything changed on it!

    I'm trying to learn about html forms being fed into a javascript function. I know it's possible, but I don't know how...yet. If I figure that out, you'll have a version that can do batch submissions, which should save you a TON of time. mwink.gif
    Pictures and Videos of the Huntsville Car Scene: www.huntsvillecarscene.com
    Want faster uploading? Vote for FTP!
  • SamirDSamirD Registered Users Posts: 3,474 Major grins
    edited August 10, 2009
    I found this which uses a form submission to do something similar for youtube videos:
    http://www.sweetheartfilms.com/YouTube_Embed_Code_Generator.html

    I'll play with it when I have time and see if I can make it work for mass SM image embedding.
    Pictures and Videos of the Huntsville Car Scene: www.huntsvillecarscene.com
    Want faster uploading? Vote for FTP!
  • James HJames H Registered Users Posts: 92 Big grins
    edited August 21, 2009
    SamirD wrote:
    Here's what I've come up with so far. You put in the full url to the picture like in your example without the trailing slash. The result on the screen is the complete forum link like you want. Simply control-a, control-c to copy and then paste it into your forum post. thumb.gif

    snip...

    Well, I hope this much helps.
    This could be really useful! Thanks for sharing it. clap.gif

    It would be awesome if something like this could be added directly to our own SM sites. It would even be something I'd consider allowing guests to use for hotlinking certain galleries. It sure beats the alternative where they just take it and you never know, or get any traffic in return.

    I believe I ran into a little bug though, or maybe I'm missing something? headscratch.gif

    When I put in this URL:
    http://www.jmhphoto.com/gallery/5862427_T8PkL/9/378473505_rt3md#378473505_rt3md

    I get this non-working result: (minus the line break and *'s.)
    [*url=http://www.jmhphoto.com/gallery/5862427_T8PkL/9/378473505_rt3md#378473505_rt3md]
    [*img]http://www.jmhphoto.com/gallery/5862427_T8photos/378473505_rt3md-M.jpg[*/img][*/url]


    Edit: I figured out the problem. For some reason "378473505_rt3md" was repeated at the end of my original URL. I navigated away then went back to the same photo, and everything worked this time.thumb.gif

    378473505_rt3md-M.jpg
    --James

    Homepage - James Hill Photography

  • SamirDSamirD Registered Users Posts: 3,474 Major grins
    edited August 23, 2009
    James H wrote:
    This could be really useful! Thanks for sharing it. clap.gif

    It would be awesome if something like this could be added directly to our own SM sites. It would even be something I'd consider allowing guests to use for hotlinking certain galleries. It sure beats the alternative where they just take it and you never know, or get any traffic in return.
    I'm glad you found my little app useful. thumb.gif I have ideas on how to expand it for multiple images. There was a discussion in another thread on how to make links display on a gallery, but it stopped working. :cry
    James H wrote:
    I believe I ran into a little bug though, or maybe I'm missing something? headscratch.gif

    When I put in this URL:
    http://www.jmhphoto.com/gallery/5862427_T8PkL/9/378473505_rt3md#378473505_rt3md

    I get this non-working result: (minus the line break and *'s.)
    [*url=http://www.jmhphoto.com/gallery/5862427_T8PkL/9/378473505_rt3md#378473505_rt3md]
    [*img]http://www.jmhphoto.com/gallery/5862427_T8photos/378473505_rt3md-M.jpg[*/img][*/url]


    Edit: I figured out the problem. For some reason "378473505_rt3md" was repeated at the end of my original URL. I navigated away then went back to the same photo, and everything worked this time.thumb.gif

    378473505_rt3md-M.jpg
    The script uses the format baseUrl/gallery/galleryNum_galKey#photoNum#photoKey as the input. Because of that "9" between the gallery name/key and the photo name/key, it doesn't calculate the gallery name to be the correct one.

    I'm trying to think under what conditions a number will be there in the url. I believe it does this on certain pages. If you can give me a list of urls that don't work with the script, I think I can re-write it to work with these also. Basically, if I get an idea of all the valid url formats that someone could throw at my script, I'll re-design it to work with all of them using a different design.
    Pictures and Videos of the Huntsville Car Scene: www.huntsvillecarscene.com
    Want faster uploading? Vote for FTP!
Sign In or Register to comment.