Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-12-27 10:46:09

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

lam_image_uploader v0.6c (improved upload images from the write tab)

lam_image_uploader

download here: lam_image_uploader v0.6c

Allows you to upload images via the Write tab. Based on stm_image_uploader but with a few improvements including:

  • automatically appending image id to article
  • or: show a text link to manually attach id to article
  • or: show a text link to manually append multiple ids to article
  • ability to display thumbnail (important: in order for thumbnail to show up you need to have specified a size for thumbnails in image tab)
  • assign image category on upload
  • assign caption on upload
  • move the upload form to the left sidebar instead of below the excerpt(important: your thumbnails will be resized by the browser to a width of 150px. this is ugly but currently a temporary solution so as to not wreck your write screen if your thumbnail sizes are relatively large)
  • installable/removable preferences for all of the above

the alt input field stays because you need that to validate anyway.

Changelog

0.6c – issue where you sometimes have to ‘log in’ again to see the upload form should be fixed now
0.6b – got rid of some homebrew functions and now relies on more reliant cross-browser library jquery. improved some minor styling issues as well
0.6 – changed caption input to textarea (thanks mrdale)
0.5b – whoops went a little too far with the lang file. should fix some installation issues on non-english txp installs
0.5 – updated to use localised lang file (let me know if i missed anything)
0.4 – added ability to move upload form to left sidebar
0.3 – fixed a silly typo causing “Attach Article Image” link not to work.
0.2 – added “Append Article Image” ability (ala upm_img_popper) to allow for multiple article image id insertion (must upload an image each time though of course)
0.1 – initial release

Screenshots

(edit: i have no idea what this image was and why it was removed. i’m sure the other screenshots should be more than self explanatory though)

preferences (admin -> extensions -> lam_image_uploader)

Installation

Once plugin is installed, head over to admin -> extensions and install the preferences first. They will be stored in your database. You can also remove the preferences at any time by returning to the same page. Then feel free to play around with the settings.

TODO/BUGS

  • Styling could definitely still be improved upon. If anyone wants to toy around with it, by all means. at the moment, everything just sorta sits on top of each other.
  • make viewable thumbnail’s dimensions configurable via preferences (currently hardcoded to display your thumbnail at 160px if you choose to display the upload form in the left sidebar. although this really is just browser resizing and will look ugly unless you’re running safari or until firefox 3 officially comes out with better image rendering. if anyone has a better idea on how to control the size i’m all ears)
  • if you choose to have the upload form in the left sidebar and you have really long categories, it’ll probably mess up the layout. i could either truncate the category names or supply a fixed width via css, none of which are good cross-browser solutions. (IE of course messes up the css method and truncates the names anyway while FF doesn’t).

Credits

Stanislav Müller for the original stm_image_uploader plugin.
original thread for stm_image_uploader
mary and bastian for unknowingly allowing me to peek at their various plugins to see how plugin preferences were installed/uninstalled via the backend.

Tested

  • FF 2.0.1.1, Safari 3.04 beta, Opera 9.24, IE6, IE7

Last edited by iblastoff (2009-06-01 22:33:03)

Offline

#2 2007-12-27 11:16:45

Joey
Member
From: Netherlands
Registered: 2005-01-19
Posts: 257

Re: lam_image_uploader v0.6c (improved upload images from the write tab)

Great plugin, thanks!


Regards,

Joey

Offline

#3 2007-12-27 11:26:57

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: lam_image_uploader v0.6c (improved upload images from the write tab)

Niiiiiice. Works very well, many thanks for your hard work.

A few tiny things:

  1. When used in conjunction with glx_admin_image the thumbnails don’t show up. This is just a FYI, as I think it’s more to do with the fact you have to explicitly hit “Save” in the Images tab before the thumbs are generated when that plugin is installed. I’m sure the thumb generation works fine if glx_admin_image is disabled. People who use glx_admin_image and your plugin are likely mutually exclusive groups anyway I should think
  2. I’d second an option to use the left side bar if the fields could somehow be squashed to fit without too much detriment to usability. As maverick said, zem_event takes up a lot of space in the central column
  3. If you can harness jQuery for the javascript insertion (look at the .html() or .append() calls for starters) you might save yourself a tonne of DOM calls!

This is a vastly improved workflow for quickly authoring articles. I’m off to play.

You da man!


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#4 2007-12-27 12:37:32

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: lam_image_uploader v0.6c (improved upload images from the write tab)

Bloke wrote:

Niiiiiice. Works very well, many thanks for your hard work.

A few tiny things:

  1. When used in conjunction with glx_admin_image the thumbnails don’t show up. This is just a FYI, as I think it’s more to do with the fact you have to explicitly hit “Save” in the Images tab before the thumbs are generated when that plugin is installed. I’m sure the thumb generation works fine if glx_admin_image is disabled. People who use glx_admin_image and your plugin are likely mutually exclusive groups anyway I should think
  2. I’d second an option to use the left side bar if the fields could somehow be squashed to fit without too much detriment to usability. As maverick said, zem_event takes up a lot of space in the central column
  3. If you can harness jQuery for the javascript insertion (look at the .html() or .append() calls for starters) you might save yourself a tonne of DOM calls!

This is a vastly improved workflow for quickly authoring articles. I’m off to play.

You da man!

thanks bloke! to address your tiny things:

  1. i also use glx_admin_image and the thumbnails seem to show up just fine for me. as long as your images tab is set up to automatically generate a thumbnail on upload it should display it. (as all the plugin does is append a ‘t’ to the image name/id and display it. if it isn’t found then it probably means thumbnails aren’t being automatically generated? not sure)
  2. i think that would be a good idea as well but i’m not sure how to manage it if people still want their thumbnail to show up. since thumbnail sizes will vary for people i could see it easily wrecking the write screen pretty fast. bastians bas_img_selector seems to crop the image to fit the sidebar and shows it fullsize on hover. although it works i personally don’t like that setup..im all for suggestions!
  3. my knowledge of jquery (and javascript in general) is nonexistent save for toying around with random lightbox-style scripts and such. i’ll definitely look into it though. as i know the current javascript i threw in there is probably a mess!

Last edited by iblastoff (2007-12-27 12:38:17)

Offline

#5 2007-12-27 13:18:18

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,250
Website GitHub

Re: lam_image_uploader v0.6c (improved upload images from the write tab)

iblastoff wrote:

i also use glx_admin_image… as long as your images tab is set up to automatically generate a thumbnail on upload it should display it.

Ah, maybe that’s it then. I’ll check out the options. My bad, sorry.

… since thumbnail sizes will vary for people i could see it easily wrecking the write screen pretty fast

Yeah. One thing that might work is a(nother) option to set the displayed thumbsize width x height. If not set, you get whatever’s thrown at you, but if set you could add the given width and/or height attributes to the thumbnail you display? Sure the browser’ll probably do a lousy job of resizing, but it’s better than a smashed Write screen. FWIW, the fullsize-on-hover facility was one thing that turned me off bas_img_selector.

And the js is just fine as it is; it works. Going jQuery may just save you some lines of code and cross-browser headaches.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#6 2007-12-27 15:15:51

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: lam_image_uploader v0.6c (improved upload images from the write tab)

Steve,

Great work man…seriously.
This is MUCH appreciated!

A couple quick things:
1. Is there a way to allow for multiple images to be attached to the articles?
(uploaded one-at-a-time of course) I’ve got a site where almost every article has between 3-6 images.

2. Just a heads up: If you don’t specify an image but still hit upload, the error message “no file was specified” creates vert and horz scrollbars. Not a big deal at all, but just makes things look a little messy.

Thanks again.
I’m still toying with this…I’ll report back anything else.

Cheers!

Tom

Offline

#7 2007-12-27 15:52:24

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: lam_image_uploader v0.6c (improved upload images from the write tab)

renobird wrote:

Steve,

Great work man…seriously.
This is MUCH appreciated!

A couple quick things:
1. Is there a way to allow for multiple images to be attached to the articles?
(uploaded one-at-a-time of course) I’ve got a site where almost every article has between 3-6 images.

2. Just a heads up: If you don’t specify an image but still hit upload, the error message “no file was specified” creates vert and horz scrollbars. Not a big deal at all, but just makes things look a little messy.

Thanks again.
I’m still toying with this…I’ll report back anything else.

Cheers!

Tom

  1. that could be possible. i know another plugin does this so i’ll take a look at how its done (i think it was upm_img_popper if i’m not mistaken). you’ll probably see this incorporated within the hour or two!
  2. just curious what browser were you using? either way i think the issue should be fixed now. you can redownload the plugin to see if it does.

Last edited by iblastoff (2007-12-27 15:59:04)

Offline

#8 2007-12-27 15:57:53

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: lam_image_uploader v0.6c (improved upload images from the write tab)

iblastoff wrote

just curious what browser were you using? either way i think the issue should be fixed now. you can redownload the plugin to see if it does.

FF 2.0.0.11

Thanks man, I’ll redownload now.

You’re right upm_img_popper does allow multiple images…that’s what I’ve been using until now.

Cheers!

Tom

Offline

#9 2007-12-27 16:41:17

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: lam_image_uploader v0.6c (improved upload images from the write tab)

hey renobird, v0.2 is out

now you have an “Append Article Image” text link that should let you append multiple id’s for each upload. (can be set to turn on via the plugin preferences. probaby want to disable the regular “Attach Article Image” link)

ps. if anyone can help with styling the form after someone uploads an image that would be great! (ie. where the thumbnail shows up, where the attach/append image links show up, how the copy-paste txp:image id input looks, etc) i personally hate styling forms as i can never get them to look decent across all browsers.

Last edited by iblastoff (2007-12-27 16:48:42)

Offline

#10 2007-12-27 16:57:12

renobird
Member
From: Gainesville, Florida
Registered: 2005-03-02
Posts: 786
Website

Re: lam_image_uploader v0.6c (improved upload images from the write tab)

Steve,

Damn…that was quick! I’ll download in a few and check it out.

Nice way to close out the year by releasing one of the years best plugins. (imo)

If I had to vote…I think it would be a 3-way-tie between:

1. lam_image_uploader
2. glz_custom_fields
3. sed_section_fields

There’s been some other really good stuff…but those really stand out.

Sorry for the digression.

)


Tom

Offline

#11 2007-12-27 20:08:22

variaas
Plugin Author
From: Chicago
Registered: 2005-01-16
Posts: 402
Website

Re: lam_image_uploader v0.6c (improved upload images from the write tab)

Moved to seperate thread

Last edited by variaas (2007-12-27 22:07:34)

Offline

#12 2007-12-27 20:57:34

variaas
Plugin Author
From: Chicago
Registered: 2005-01-16
Posts: 402
Website

Re: lam_image_uploader v0.6c (improved upload images from the write tab)

Moved to seperate thread

Last edited by variaas (2007-12-27 22:07:24)

Offline

Board footer

Powered by FluxBB