Smugmug & Drupal?
TazzyTazzy
Registered Users Posts: 32 Big grins
Has anyone worked on a module for Drupal? I would really like to use smugmug vs Flickr since Flickr doesn't allow subcategories like smugmug does.
Would anyone be interested in such a module? I'm not an expert programmer, but I can do some stuff. Perhaps a few of us could get something together?
-Mitch
Would anyone be interested in such a module? I'm not an expert programmer, but I can do some stuff. Perhaps a few of us could get something together?
-Mitch
0
Comments
Okay, so I finally got my SmugMug API key whipped out a quick Drupal (4.7.x) module. The module does two things:
1) Acts like a text filter for nodes/pages/etc. Simply put in {{smugmug:ImageID}} (where, imageID is the ID of the image you want. This will create a link to the proper album where the image is in, and use the thumbnail version of the image as the link where you click on. You can also use {{smugmugX:imageID}} where X = t (tiny), s (small), m (medium), l (large) and o (original). This will display a dffierent size image in your node. This is much like the flickr.module.
2) Acts like a remote gallery browser. Allows to you browse the categories, and subcategories within your drupal site, as if you were hosting the images. However, at the bottom of the page i put "Photos powered by smugmug". You can check out what I have so far at: http://www.warmy.com/smugmug (which has been aliased to /gallery in my alias module).
I still have a little bit of work to do on this module. Would be nice to be able to view your gallery within your drupal site. Since i've whipped this together in a few days, i haven't finished this portion yet.
A bit on the backend. I've implemented a caching system so as not to clobber smugmug and to speed things up. Basicially, every call to smugmug gets saved in a local table. When making an API call, the module first checks to see if a local cache is available, if not, fetch it, then save it in the cache for later use. Right now, i've set the cache timeout to 60 minutes. I think this is more than enough to handle most photo albums since I only upload a few pictures a week right now.
The cache system works on EVERY API call. Image urls, albums, categories, etc. :-) It's a very simple, but slick system.
Let me know what you think. Please keep in mind, I just put this together in a couple days, and as such, doesn't have a solid look/feel. But, it should be functional. If you find a bug, please let me know here.
-Mitch (Warmy)
Even though I've not really looked into what this Drupal really is. This is something you put on your webserver and which provides your site with blogging features? Do you still need MySQL databases to run a blog? Or am I completely wrong?
Whatever - I saw that you were complaining that there's no real image size for blogging pictures. Are you aware that you can request any image size you want from smugmug and they serve it to you on the fly? Just add the image size instead of the S, M or L like this:
123456789-800x800.jpg
This would give you a picture with 800px at the longest side no matter what aspect ratio it has and works for both landscape and portrait orientation. Here's the thread about that.
Sebastian
SmugMug Support Hero
Yes, you need MySQL (or some sort of SQL). Check out drupal.org. Yahoo.Com runs on a modified version of drupal. :-)
Drupal can be used for blogging, or store fronts, or whatever. It's very powerful system with easy to write/add modules.
Thanks really helpful. I combined this with a CSS hack that allows mouse over. So, now not only can you see a bigger version simply by putting the mouse over the image, you can click on it to go to the album! Spiffy!
It's very rough right now, I need to polish this some more.
-Mitch
So, the double picture from the filter was messin' me up. I'll come back to that later.
I've implemented a Random Image block. At first, i was pulling records for all images. Tooo many hits against API if you had LOTS of albums. TOOO much. Instead, i'm randomly selecting 5 albums, then getting all image ID's for the 5 albums. Then, from those, I randomly select XX images that I want to see.
The module is comming along nicely. I think after I do a code clean up, I'll release it it the public. Soo, if you have a Drupal site, and interested, let me know here. Also, test out warmy.com and let me know of any bugs or where things could look better. I'm not going to implement an album viewer at this time - maybe next week.
Also, I've bumped the API cache timeout from 30 minutes to 60 minutes. I may even bump it up to 2 hours. Eventually i'll make this an administrative setting, but still have a minimum of around 30 minutes. I don't want to kill smugmug API.
-Mitch
BTW, If you found this post and you are running Drupal and don't have smugmug yet, please use my coupon. : This will push me along to continue developing this module.. That, and you get $5 off. Here's the coupon code to enter when joining: qgSctxuKhAiAE
Just a status update on the drupal module.
I now have full album viewing from within the drupal module. You can view albums, or images. You can also select the image size.
Changes since last update:
* Improved API cache system. Should lower the load on the API system even more. You set a base cache timeframe, say 24 hrs. Then, you have the following cache times:
List of albums = base cache / 2 (12 hrs)
ImageURLs = base cache * 10 (240 hrs - 10 days)
ImageInfo = base cache
Subcategories = base cache * 2
Categegories = base cache
* Fixed cache reads - some reason wasn't always reading the cache. Changed cache lookup algorithm.
* Display albums within module
* Display images within module
* API errors are handle more gracefully - if API error, users are sent to smugmug.com album.
* URL for albums, images, gallery, category, and subcategory is set from module settings menu. For example: Can set the album url to warmy.com/smugmug/album/AlbumTitle or warmy.com/album/AlbumTitle
* Number of images displayed in random block setable in block control panel.
Yet todo:
* Perform full security analysis of code - mainly user variables passed in from web browser - only minimal checking
* Code clean up
* More in-code doco
* Debating how to implement "most recent" images in a block. No good API exists, most likely have to parse an RSS/Atom feed of some sort (not prefered method).
Please check out the website, open to suggestions/modifications before publishing code. http://www.warmy.com/gallery/
I'm moving this topic over to Drupal since I'll eventually publish the module there. I'm assuming I'll also be using their bug tracking features if needed.
Link to Drupal.org thread: http://drupal.org/node/70166
-Mitch
I've updated the Drupal module to access Smugmug images easily from with blog posts, or placing your gallery within your one website.
The new module works with Drupal 5.1, won't be maintaining older versions.
More details at:
http://www.warmy.com/2007/drupal_smugmug_module_105b
Enjoy.
After a lot of work and tinkering, I _finally_ have slideshows available for the drupal module for smugmug. It uses javascript, with a <noscript> tag to display a single static image for browsers that don't have javascript enabled/support.
Change log: http://www.warmy.com/sm-changelog.txt
Download: http://www.warmy.com/smugmug_nightly.tgz
Also: This has been test with Drupal 5.2 at http://dev.warmy.com
Cheers!
- Mitch Schwenk
Hey Tazzi,
Anything new with the Drupal API since the Smug SS release? I am just setting up my drupal site, wanted to check before I attempted the module you discussed here.
I noticed on your site that your app has different target URLs, a feature request I submitted to SM.
I'm running with drupal 5.7, but am a newbie and want to stick w/ SM. Should I go ahead and try your module?
Thanks,
I can't seem to find a current download for your module. Do you have a 6.x version or plans for one?
http://images.tonyschreiber.com
(technocraft.smugmug.com)
As best as I can tell, the SQL database is inconsistent with the PHP code. The tables for drupalxx.smugmug_image_urls are missing.
Would have been nice if it worked...
Is anyone working on SM support via the Embedded Media Field module? It would seem like a good place to start.
Smugmug is top-dog for gallery display so I'd mainly like to be able to highlight smugmug gallery content in drupal.
Specifically I'd like to be able to integrate images in my smugmug gallery into drupal (presumably with click-through to the gallery). Okay, so this can already be done manually by getting the link to an image and putting it into a drupel content field as an href, but it'd be nicer to select the image 'natively' in drupal by selecting the gallery then the image....
I'd also love to be able to configre the Dynamic Display block module to use images from specific smugmug galleries.
I'm not sure if that's what you have in mind, but as I say, I'd be interested in some collaboration.
As an aside.. does anyone else have Warmy's module working under drupal 6.x?
Keep up the good work.
In a few hours this afternoon, I was able to write the core functions that retrieve a random image from a gallery. Now all I have to do is wrap that code into a proper Drupal module and then test. I'll be targeting Drupal 6 with this module. Also, I'm using lildude's awesome phpSmug libraries for this.
-Erik
http://andersonfam.org
http://andersonfam.smugmug.com
D70 | SB-600 | Nifty Fifty | Tamron 17-50 f/2.8 | Nikon 70-300 f/4-5.6G
I didn't know about phpSmug - I'd never thought to try to integrate smugmug to my website till last week. So thanks for the link.
-jon
I've been hacking at tazzy's code and got to the point where it logins and displays categories of albums. When I display an actual album, I get the navigation icons but not the images. I'm using drupal 5.7.
The first time you look at a smugmug gallery it fills your drupal database with your gallery and category information. This can take a long time.
Alex
I saw Warmy's information, but the delivered file I'm not exactly sure what to make of since it combines html, php, and more.
I'm also a neopyhte when it comes to writing Drupal modules and the process for getting them brought into the Drupal community. That doesn't mean I'm new to coding or software development practices. Just have been out of it a few years.
I do have a significant investment of photos hosted here at Smugmug so any Drupal module that brings them together is worth some time assisting.
Capturing and creating fashion, film, festivals around Detroit
Wordpress-ed Fuzzytek
Does anyone know if there have been any modules released for integrating SmugMug into Drupal 6.x?
Many thanks,
Charles
I've just contributed the following patch for the Drupal emfield module (embedded media field).
http://drupal.org/node/451842
For those interested in using smugmug photos on your Drupal based sites please try my patch and submit a response to my issue that you tried it and it works.
It is a single file that you need to put in your emfield folder specifically at
/sites/all/modules/emfield/contrib/emimage/providers
Unzip it there so that there is a smugmug.inc file there.
You can then go to your emfield configuration page at yoursite/admin/content/emfield to enable it (you'll need to get yourself an api key).
If you don't use emfield yet, then you'll need to install that on your site first (use the 6.x dev version).
I just switched from flickr to smugmug and I was shocked that smugmug wasn't already there!
- Peter
What do you mean "they aren't populated with the photo". What exactly isn't populated with the photo? With emfield the photo itself doesn't come down to your site.
I don't use feedapi and feed element mapper myself at the moment (will have to give this a shot over the weekend).
I was researching this last week and I got the feeling that the code for feedapi/feed element mapper may not be working with emfield at the moment, but I could be wrong.
- Peter