Image Gallery Plugin

I took a stab at creating a plugin that can organize a bunch of images into somewhat of a gallery. See a screenshot of it in action here: Screenshot here:

Imgur

This doesn’t handle displaying images in lightboxes, instead it wraps the existing Discourse lightboxing that occurs on images.

You can customize the size the images get scaled down to.

Usage is like this:

[image-gallery]
 <img src="whatever" />
 <img src="whatever" />
[/image-gallery]

Repo is here: GitHub - crob611/discourse-image-gallery: Image gallery plugin for Discourse

24 Likes

Nice! Added to the list!

1 Like

@crob611, cool plugin, can you provide a link where I could see it in action?

1 Like

@Mahamsamatan Unfortunately, I don’t have it running anywhere. Sorry.

There is a minor detail that I would like to see fixed - on any forum you cannot quote the tags to give rise to a description, for example:

On my forum, a line containing code quoted [image-gallery][/image-gallery] will process these words/tags wherever they are written, unlike the [spoiler] plugin.

Does this work on the latest version of Discourse? I tried to install it on my development version of Discourse, I can’t get it to work. When the tags are used on a new post, I can’t save it as it gives me “Internal Server Error 500”. I will include the production.log error message as soon as possible as I can get to my devbox.

EDIT: added error message from production.log:

Started POST "/posts" for "IP-ADDRESS" at 2015-01-13 21:06:42 +0000
Processing by PostsController#create as */*
  Parameters: {"raw"=>"[image-gallery]\n<img src=\"/uploads/default/17/02c9eeb0ca7f57e9.png\">\n<img src=\"/uploads/default/10/d2d06cb573f66f29.jpg\">\n<img src=\"/uploads/default/18/6033609447a3dc8c.jpg\">\n[/image-gallery]", "title"=>"testiaaanaskffgbkvb", "is_warning"=>"false", "archetype"=>"regular"}
Completed 500 Internal Server Error in 81ms

PrettyText::JavaScriptError (Object [/image-gallery] has no method 'exec'):
  lib/pretty_text.rb:165:in `block in markdown'
  lib/pretty_text.rb:330:in `block in protect'
  lib/pretty_text.rb:328:in `synchronize'
  lib/pretty_text.rb:328:in `protect'
  lib/pretty_text.rb:146:in `markdown'
  lib/pretty_text.rb:198:in `cook'
  app/models/post_analyzer.rb:12:in `cook'
  app/models/post_analyzer.rb:104:in `cooked_document'
  app/models/post_analyzer.rb:49:in `raw_mentions'
  app/models/post.rb:154:in `block (2 levels) in <class:Post>'
  lib/validators/post_validator.rb:40:in `max_mention_validator'
  lib/validators/post_validator.rb:10:in `validate'
  lib/post_creator.rb:258:in `save_post'
  lib/post_creator.rb:81:in `block in create'
  lib/post_creator.rb:140:in `call'
  lib/post_creator.rb:140:in `block in transaction'
  lib/post_creator.rb:138:in `transaction'
  lib/post_creator.rb:76:in `create'
  app/controllers/posts_controller.rb:80:in `create_post'
  app/controllers/posts_controller.rb:65:in `create'
  lib/middleware/anonymous_cache.rb:119:in `call'
  config/initializers/quiet_logger.rb:10:in `call_with_quiet_assets'
  config/initializers/silence_logger.rb:26:in `call'
  lib/middleware/unicorn_oobgc.rb:95:in `process_client'
1 Like

Same thing, dead I guess?

Are old no-longer-working plugins going to be trimmed from this section to a ‘old’ section or so?

1 Like

I’d too would be interested in this.
Got a github link you can post or M me? :wink:

Reply on any broken plugins, if author has abandoned we will close or move out of plugin category

4 Likes

It’s broken for me too, and last commit was feb, 2014

np, moved to broken plugins for now. @crob611 let me know if you fix it.

1 Like

Sorry all for not keeping this updated. I’ll be glad to get it updated when I get a chance, or merge any pull requests if someone else wants to fix it. Would love to get back into making some other Discourse plugins.

7 Likes

i fix
https://github.com/chasovoy85/discourse-image-gallery/tree/chasovoy85-patch-1

1 Like

Nice. You should make a pull request to @crob611’s original repo.

1 Like

I’m a novice in GitHub… but I’ll try

Just click here :wink:

1 Like

Thanks. Done :slight_smile:

1 Like

Great. If you don’t hear from @crob611 in a week or so we can point to your fork instead of the defunct repo and move this out of #plugin:broken-plugin, provided someone else confirm that it’s working!

1 Like

Cool. Thanks! :grinning:

1 Like

I can merge it in, but I’m not setup to test to make sure it’s working or anything. I’d also be glad to transfer the repo if someone else would like to maintain it going forward. @chasovoy85?

2 Likes