Aviary Module

AuspeX

Joined: 2012-04-08
Posts: 1
Posted: Sun, 2012-04-08 12:07

Hey everybody!

Is there any module, that makes use of the API, provided by http://www.aviary.com/web ?
I think the tools for photo editing, would be a nice addition to the standard feature set.

-
AuspeX

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Mon, 2012-04-09 03:58

No but you are welcome to start a new module.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Wed, 2012-04-11 03:41

I have this working, but need to add an admin setting for the API key for aviary... I'm not familiar enough with how this is done on activating the module.

Right now, I have to manually edit one of the files to include the API key.

Dave:?
Is there a module I can look at for how to add a variable (API key) on activating the module?

Thanks.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Wed, 2012-04-11 04:13

You need a admin page. That has a very simple view file in the view folder of the module then a controller to save the data to the modules settings page.
I guess the simplest module is the 'about' module. It saves 3 settings and you can just remove the extra settings you don't need.

then just use:
module::get_var("your_module_name", "your_saved_code_name")
to retrieve the code.

Or the other option some modules do is in the install code is to set the module code and then have the user use the advance settings to change.
That method is done in the album tree install.
module::set_var("albumtree", "style", "select"); then the admin has to manually go to the advance settings to change the style.

If you want to get fancy you can have a warning message that the module needs configuration. There is a few modules that do that but I think that is overkill as an admin should read directions on the modules docs to know that it needs some site specific data.

if you get stuck let me know and I can help out.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Wed, 2012-04-11 13:59

Thanks, I'll give it a shot. I figured it'd be easiest to do your second solution. I don't feel like getting fancy with a form for entering the code on install. Perhaps someone else can pick that up once I get 'er done.

I'm now contemplating how the module should function, as right now, you can edit the pic, but the save function just 'replaces' the current -view- of the picture, not the file itself. I think that I can force a download of the image, or have it save out somewhere, but that would require a bit of configuration on the admin's part. For now, I'm just leaving it as is, and just alerting the user that it's been 'edited' but not saved anywhere... It's kind of strange how it works, but I'm open for ideas on what to do with the 'edited' photo.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2012-04-12 13:23

Great. It is hard to figure out what we should do with the edited file. I don't think we should alter the original.
I guess if the admin is the user and he wants the original altered that would work. No sure about the other options, perhaps the community will come up with a vary good detailed user story.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Thu, 2012-04-12 14:55

Yea, I'm not convinced it's that useful as a module. However, I've got it working, and currently it just prompts a download (via a php call with altered headers) to save the image locally to the client. I'm guessing there are many many options, including the ability to 'import as a new photo', 'save elsewhere on the server' etc.

The free Aviary use is restricted to 800x800 image size.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2012-04-12 15:54
Quote:
The free Aviary use is restricted to 800x800 image size.

That is a bit of a bummer. The usefulness just went down in my books as well.

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
undagiga

Joined: 2010-11-26
Posts: 693
Posted: Fri, 2012-04-13 00:33

There was a recent module - perhaps Emboss ? - that took a copy of the full sized image and placed it in a back-up location on the server before it edited and replaced the publicly viewable versions. That would be an option for this module. I agree that 800x800 is a limitation for some people. Personally I'd prefer to edit the image on my computer and re-upload it.

U-G

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Fri, 2012-04-13 01:34

undagiga, nice idea on the 'backup' image, I may offer several options if I get some time to code them.

I also agree, editing locally is my choice...

However, it was a request for this aviary module, so I gave it shot. But, I also think 800x800 severely limits it's usefulness...

Out of curiosity, do either of you know how to reference the full size image? I haven't really looked deep, but only found refs for resize and thumbnail.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2012-04-13 03:47
Quote:
how to reference the full size image?

full size image url:
$item->file_url()

but I bet you want the path?
I don't understand the question.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Fri, 2012-04-13 13:05

Correct, the path would be more helpful.

Also, trying to get the full URL, not just the urlpath (host/webserver name)

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Fri, 2012-04-13 13:52

$item->file_url(true)
should be the full url
or
$item->abs_url()

and the path:
$item->relative_path()

if you look at modules/gallery/models/item.php you should be able to find what you are looking for. It is documented well but not perfect.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Fri, 2012-04-13 15:35

Bingo, perfect, thanks!

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Sun, 2012-04-15 01:47

well, I wrote the installer, admin settings, warning about missing API key, and all is well...

I did notice something strange however, with the moduleorder module installed, it appears as if it may not be loading parts of the last module... (when I had this (my aviary module) as the last module installed, (most weighted), my installer, and admin menu append did not function... not sure if this is the moduleorder module or what... but weighing my aviary module to load -before- the last module, the admin menu append and installer script worked with no code changes...

I've got to dig deeper in to this error/bug... (hopefully the description made sense)

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Sat, 2012-04-14 17:17

The only playing around with the moduleorder module, that I have done, is to have the comments above or below another module that uses the same function to place the data.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
markusk

Joined: 2006-04-20
Posts: 60
Posted: Wed, 2013-03-20 07:32

since i can't find this published anywehere - did it ever get finished? would really like to have a look&try..

thanks,
markus.

--
regular git puller.

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Wed, 2013-03-20 17:16

I'd be happy to send you over a zip of the module. However, it's been quite a while since I've looked at it, or played with it. Let me know if you're interested, and I'll zip it up and post it up for grabs. Keep in mind that I am NOT a programmer, and that, more than likely, the code is a mess. :)

 
jnash
jnash's picture

Joined: 2004-08-02
Posts: 814
Posted: Wed, 2013-03-20 21:33